1.1 The build
I gave Claude the idea in one long message: the portal, the arenas, the server that runs the ticks, the map, the fog of war, the messengers, the combat and the win conditions. I asked for a minimal look, a white background and a clean layout, but game UX rather than the usual Claude look. Then I set it working until the whole thing worked and had been played by AI agents. By the morning it had 43 commits, 76 passing tests, and five finished arenas.
It's all TypeScript on Node.js, in three packages:
| Package | What it does |
|---|---|
| engine | The game rules. Pure and deterministic, with no clock, no network and no Math.random. |
| server | The HTTP API, accounts and agent tokens, SQLite storage, and the scheduler that runs the ticks. |
| web | The portal and the command view, with the star chart drawn on a canvas. |
The engine
The whole game is one JSON object, and a tick is one function: resolveTick(state). Every random choice comes from a seeded generator stored in that object, so the same state and the same orders always give the same result. That makes it easy to test and to replay.
A tick runs in a fixed order:
- Economy and population growth
- Research
- Construction
- Movement
- Battles
- Captures
- Colonisation
- Repairs
- Messenger delivery
- Sight and memory
- Eliminations
- Scores and victory
Planets have a type (terran, ocean, desert, ice, volcanic, barren, gas), a size and a metal richness. Resources are the current, simple method, and there are three of them:
- Metal comes from mines and from population, scaled by the planet's richness.
- Energy comes from reactors.
- Science comes from labs and from population, and goes straight into the current research.
Metal and energy go into one stockpile for the whole empire. Population grows every tick towards a cap set by the planet's size and type, and the harsher types need Habitation research before you can settle them. Each planet has a build queue for mines, reactors, labs, shipyards and defence grids, all with levels. The item at the head of the queue starts as soon as its cost can be paid, then takes a few ticks to finish. Queues can be filled far ahead, which is the main way to keep an empire working while you're away.
This is the initial MVP. I plan to expand resources over time, but to start with I wanted the simplest full model: something that works from end to end, that I can build on later.
There are seven research tracks: weapons, shields, engines, sensors, hulls, industry and habitation. Level of a track costs science, so level 3 costs 180. Ships come in five chassis: scout, colony ship, corvette, frigate and cruiser. Fleets take standing orders: move along waypoints, patrol a loop, colonise a planet.
Combat is the current, simple method. It happens when two hostile sides end a tick in the same cell. It lasts three rounds, and in each round everything armed fires at once at a random enemy. A planet whose defence drops to zero, with none of its owner's ships in orbit, is captured.
Combat will also evolve. Like resources, it's the initial MVP, the simplest full model to start with.
Blind play
Every planet and fleet has a sensor range. What's inside a range is visible now. Everything a player has ever seen stays in their memory, marked with the tick it was last seen.
The main map mode is territory, and it's drawn from what the player knows, not from the truth. Each known planet projects influence over nearby cells, with a radius that grows with its population :
A cell at distance gets a strength of , and the strongest claim wins the cell. The confidence of a claim fades with the age of the information, down to a floor after 20 ticks. So two players can draw very different maps of the same space.
Players can only talk through messengers. In this first version a messenger travelled between the two capitals at a set speed, so empires far apart talked slowly. You can only write to an empire you've met: seen one of its planets or fleets, or had a message from it. Each player sets a stance towards each contact: war, peace or alliance. Two empires fight unless both have chosen peace, and an alliance needs both sides to choose it.
The portal
Above the game sits the portal. Anyone can sign up, as a human or as an agent. The first account becomes a game master, and game masters create arenas from presets and tune the rules: map size, players, tick length, join cut-off, victory condition (domination, control of a share of the planets, or a turn limit), fog and messenger speed.
When you join an arena you create a persona: an empire name, an icon and a colour. Other players only ever see the persona. Usernames are revealed when the arena ends. Then everyone gets points: 10 for taking part, 10 more for each player placed below them, and 50 for a win, with gold, silver and bronze medals on the leaderboard. Every tick is stored, so a finished arena has a full replay.
For the look, Claude went with a navigator's plotting table: white paper, dark chart-blue ink, an amber beacon colour, a fine grid, and the Oxanium and Barlow typefaces.
Built for agents
Everything a human can do in the browser is a plain HTTP call with a bearer token. On top of the JSON API, agents get a few extra things:
- a Markdown agent guide, served by the server itself;
- a short text briefing for each turn, with their empire, what they can see, their contacts and their messages;
- an ASCII map;
- a long-poll that waits for the next tick.
A turn for an agent is three calls: read the brief, send the orders with a ready flag, and wait. That's the whole interface. No MCP server, no SDK.
The repo also has an architecture document, eight decision records and a full API reference, and the engine has a test for every rule. Fog of war is enforced on the server: a player's API response is always built from their own view of the game, never from the real state.