Teaching a bot the whole game
The automated player only ever acts by choosing from a menu of legal moves. So
every mechanic it can't see may as well not exist. Most of this run was widening
that menu until it covered what a human can actually do.
- 412, 421 A rules endpoint the bot reads at game start — production costs, terrain, placement rules, victory conditions — all derived from the live game registries, so its understanding can never drift from the real rules. A plain-language summary of the mechanics rides along with it.
- 414, 413 A two-tier brain for the language-model player: a deliberate planner that writes a strategy every so often, and a faster executor that picks each turn's moves in service of that plan — now with the actual win conditions in front of it.
- 415 Goal-binding moves: instead of nudging a settler one tile at a time and hoping, the bot can pick "go found a city there" as a single choice.
- 416–420 Five mechanics wired into the menu in a row — buying Score with wealth, seeking out tribal villages and choosing their rewards, setting a city's Focus, claiming neutral units, and building Merchants to open trade routes.
- 425–427 Repairing pillaged land, firing back with city attacks when threatened, and parking hero units in cities for their bonus.
- 428–429 The deterministic player had quietly fallen behind the language-model one. Both were brought back to parity, and the shared logic moved into one place so they can't drift apart again.
- 431–432 The menu stopped offering moves that were illegal or redundant, and units that got stuck learned to pick a different target instead of retrying forever.
- 423–424, 422, 430 Proper logging, a network timeout so a hung request can't stall a game, and two documentation passes capturing how the whole harness fits together.
Computer players you can just add
All of that ran as a developer tool you had to start by hand, one process per bot.
This is the part that turns it into a feature.
- 434 Ten permanent leaders join the roster: Cyrus the Great, Genghis Khan, Talleyrand, Antoninus Pius, Neville Chamberlain, Lyndon B. Johnson, Hannibal Barca, George W. Bush, Idi Amin and Benedict Arnold.
- 435 A Computer players panel in the lobby: choose a leader, add them, remove them before you start. They get a starting Settler, Scout and Warrior exactly like anyone else, and play by exactly the same rules — same fog, same costs, same actions.
- 439 A single background service keeps every computer player running. It works out for itself which games need which leaders, and recovers on its own from a restart or a crash — nothing to babysit.
- 436 Vote-to-remove now covers computer players, and the vote threshold counts only the humans — so a solo player with three CPU opponents can retire a stuck one without needing a majority that could never arrive.
Ten leaders, ten personalities
A CPU opponent that plays optimally is just a difficulty setting. One that plays
predictably differently is a character. Each leader carries preferences
the others don't.
- 437 Every leader picks their own State name, colour and starting perk, from their own ordering — no two open the same way.
- 445 A build order per leader, folded into how they weigh what to build next: one favours farms and monuments, another barracks and walls, another has a particular Wonder in mind.
- 446 Tech and Government perks are now something a computer player researches and adopts — each leader working down their own wishlist once they've built a Library or a Palace.
- 453 Two appetites that shape how a leader fights: conquest and pillage. High conquest sends armies at cities. High pillage raids the countryside for gold and never commits to a siege. They vary independently, so a raider and a conqueror are genuinely different opponents — and a leader low on both is content to build.
Learning to expand, and to keep building
Watching full games surfaced problems no amount of code reading would have. Three
of them were the difference between an opponent and a spectator.
- 442–443 Computer players never built Settlers — a production improvement always outranked one, and there is always another production improvement available. Now each city works toward a Settler, once it's productive enough to finish one in reasonable time.
- 445 The same root cause was starving everything else. Build choices moved from a rigid priority ladder to a weighted score — production, yields, Score value, cost and the leader's own taste — with production weighted heaviest for a young city and easing off as it matures. Monuments, Libraries, Merchants and Wonders all became reachable.
- 448 A city that ran out of things to build would set a Focus and then never build anything again, for the rest of the game. A Focus is a fallback now, not a life sentence — the city picks up its tools the moment something worth building comes within reach.
And then they learned to fight
Until now a computer player would swing at whatever it happened to bump into
while wandering. It had no way to decide to go after anyone.
- 450 Real offensives: targets ranked instead of taken in arbitrary order, armies routed toward enemy cities rather than away from home, and — crucially — seizing a city they've reduced to zero. Taking a city needs a soldier to walk in after the bombardment, and that last step was simply never happening. Both a proximity limit and a home-defence floor keep it from throwing its whole army away.
- 451 Raiding: undefended improvements in enemy land are now targets, paying a gold bounty and denying an opponent their yields. Cheap, opportunistic, and no siege required.
- 452 Leaders now remember. Each keeps a private record of how it feels about every other player — grievance that builds when you attack it or take its cities and fades slowly with time, plus a stance it commits to rather than re-deciding every turn. Hit one, and it will still hold that against you fifty turns later.
Four bugs worth naming
Each of these was found by running real games and reading the logs, and each one
looked like something other than what it was.
- 441 When a game was won, its computer players shut down correctly — and then came straight back, forever. A finished game deliberately keeps its "active" status so you can still look at the final board, and the service that manages the players was reading exactly that field to decide who still needed to be playing.
- 444 A related one from the other side: several code paths could carry a player past the "this game is over" check, so some workers lingered for minutes after a result while others exited cleanly.
- 443 The first attempt at making computer players build Settlers let them skip the "can you actually finish this?" check. Every new city promptly started a fifty-turn Settler and did nothing else. The check went back.
- 454 With fog of war on, a city you've seen but can't currently see comes back with its live details deliberately blanked out. The new targeting code read those blanks as real numbers and crashed — and would have read them as "this city is at zero health, go take it" if patched carelessly.