Brink
A modern geopolitical strategy game on simultaneous turns: four nations plan in secret, then a pure deterministic engine resolves every order at once. Runs entirely in the browser.
CREATED OCT 25, 2026 · UPDATED OCT 28, 2026
PROBLEM
Grand strategy games resolve turns one player at a time, so whoever moves second always knows more. Simultaneous-turn games fix that and then hide the resolution inside a black box, so a lost battle cannot be explained.
HYPOTHESIS
If the whole turn is one pure function, resolveTurn(world, orders), then simultaneity is fair by construction, every outcome can be explained from the event log, and the same engine can run in a Web Worker, behind an API, and inside a 100-match soak test without changing a line.
ARCHITECTURE
A pnpm and Turborepo monorepo with a one-way dependency chain: contracts, hex map, balance data, simulation, scenarios, AI, session, then the apps. The simulation imports no React, Pixi, DOM, network or database code.
A turn is twelve phases over a plain-JSON WorldState: validation against the start-of-turn world, diplomacy, production, logistics by Dijkstra with interdiction and priority tiers, discrete-event simultaneous movement, combat with class counters, terrain and entrenchment, then economy and fog. It clones its input, never reads the clock, takes randomness from a seeded roll, and throws on a ruleset mismatch.
The UI and the three AIs only ever see a fogged NationView. The client is React with a PixiJS theatre map, and the engine runs in a Web Worker. Battles drop into a turn-based tactical arena in three.js, deterministic and played back from an event log.
STACK
RESULT
Milestone 1 is playable on GitHub Pages: The Meridian Crisis, four governments, 234 hexes, three AIs, treaties, facilities, four victory paths, three save slots and versioned save migrations. Difficulty was measured with the AI's own planner in the human seat, 32 campaigns a level: Easy now wins 88%, Normal 56%, Hard 25%.
MEASURED
| metric | value | baseline |
|---|---|---|
| unit tests | 143 · 16 files across the packages | — |
| soak | 100 matches · seeded AI vs AI, invariants checked every turn | — |
| turn phases | 12 · one pure function | — |
| Easy win rate | 88 % · 32 campaigns, the AI planner in the human seat | 34 % |
| map | 234 hexes · four nations | — |
LEARNINGS
- Measure difficulty, do not guess it. The first Easy won 34% of the time, barely above Normal, and only playing the AI against itself showed that.
- Online multiplayer (rooms, join by code, AI takeover of dropped seats) was built on day one and cut on day four. A deterministic engine makes it cheap to bring back; a single-player game that works was worth more first.
- Compute a phase from one snapshot, then commit. It is the rule that keeps twelve phases from reading state another phase is halfway through writing.
- Of 100 soak matches, 43 still end on score at the turn limit. The next lever is the AI breaking deadlocks, not more content.
PROVENANCE
Built from 2026-10-25 in Claude Code. Status lives in PROGRESS.md with a definition-of-done table, each row naming the test that proves it; conventions in AGENTS.md, design in docs/architecture.md.