StatefulAI
← Selected projects

Civ AI.

Civilization VII gives every decision a consequence. I built a bridge that lets a model inspect its own board, issue an order, and see what the game did with it.

Field film / 3 min 31 sec

What are we really testing when AI plays Civilization?

The opening reconstructs Civ’s menu using the game’s reward text. The original tool output, Qwen’s choice and the board check come from the recorded trials. Scenario animated the tabletop miniatures.

Listen or read the transcript

Download film (MP4) Download narration (MP3)

I gave an AI control of France. I figured I’d be writing about strategy. Anyway, it’s turn twenty-two and I have some thoughts about a menu. France gets to pick a reward. The first Despotism adds science to production buildings and their warehouses. The other Despotism helps you train and buy military units. Both last four turns. I asked Qwen for science. Pretty generous job interview for the leader of France.

Then I pulled up the menu I’d actually sent it. Despotism one. Despotism two. I’d managed to leave out what either one did. Civ needs to know how long the celebration lasts to write those descriptions. My code never gave it the number. So what did Qwen do with my little reading test? In a replay with that menu, it picked Oligarchy. Two hundred gold, payable immediately. I put the four turns back in and loaded the same French position. This time Qwen got the descriptions you and I got. I asked for science again. It picked the first Despotism. I checked the live board. France had the science reward, with four turns left. At this point the one confirmed performance issue on the French team is me.

Egypt had a different problem. Its Scout took one step, and before the map came back, Civ interrupted with a story. The player decided to leave a gift for future travelers. Nice thing to do. Worth twenty-two Influence, as it happens. When I looked at what my tool told the player next, the gift had apparently also moved the Scout and uncovered five tiles. That is a lot of upside for a gift basket.

I could account for the Scout. Same unit, standing one tile over, exactly where the player sent it. The five tiles were trickier. I had a map from before the move and another from after the gift. Guess which map I wanted. I put the Scout’s arrival back under the move. For the fog, the most accurate thing I could write was “I don’t know.” Which matters when you’re the one grading exploration and you’ve also built the software handing out exploration credit.

The one fix I really wanted to keep was two words long. Gemma kept typing “End turn” into the tool for moving units and buying things. I had a separate button for that. Okay, but if I know what it means, why make it find the other button? I let either tool take the order. I tried both menus on seventeen saved decisions where Gemma had run into this. With the old menu it chose to end the turn twice. With the new one? Seventeen out of seventeen. I would like it on record that this was a very pleasant part of the experiment. Then I tried the same change on eight decisions Gemma had already gotten through just fine.

Seven came back the same. Which brings us to the Scout in Waset. In the actual game Gemma spent sixty gold buying that Scout. Egypt had seventy-three gold to its name. Give it the old menu in the replay and it makes the same purchase. Same city, same treasury, plus my handy new menu option? It ends the turn. The replays stop there. Maybe Egypt should save the money. I’d have to let it play to find out. What I can tell you is that I changed how you finish a turn and somehow got involved in military procurement. That fix is still an experiment.

I still want to know how well an AI can play Civilization. I just didn’t expect to spend this much time reviewing my own work. If I score that first French replay, Qwen gets a zero for finding science. Where do I put my zero for sending it this menu? Because I feel like I earned that one.

Did the Scout move?

On turn 11, Qwen said it wanted to explore. It picked order 21 from a numbered menu. London got a Farm. The Scout was still on the tile where it started. Reading the board again let me trace the mistake all the way from the model’s explanation to the city that received the order.

I tried the same model on three other saved positions, each with a specific Scout and destination. With named orders it reached the requested tile on all three. With numbered orders it submitted no move in any of the three. Neither version finished a turn within the 16-call budget. Reaching the tile and handing off the turn became two separate things to measure.

Four runs from the same opening

Cumulative distinct tiles revealed by verified moves through turn 50. Each model played one Egypt campaign.

Model Tiles revealed
Qwen 2.5 7B 62
Qwen 3.5 9B 471
Gemma 4 12B 324
Ministral 3 14B 412
Related writingI gave four AI agents Civilization. They gave me a measurement problem.Read the article →
Field film / 47 seconds

The Scout and the Farm

Terrain reconstruction with a Scout animated in Scenario. The orders and tile positions come from the turn 11 journal.

Listen to the field film

Download film (MP4) Download narration (MP3)

Read the transcript

Keep an eye on the Scout. On turn eleven in Civilization Seven, an AI player wanted to explore. The Scout was standing on tile twenty-three, thirteen.

The player picked order twenty-one. A perfectly legal choice. Watch what changed. Over by London, a Farm appeared. The Scout was still on its original tile.

Now comes a different order. This time, the player selected the Scout and a neighboring tile. The game put the Scout at twenty-four, fourteen. It had one movement point left.

Later that turn, it took one more step onto the plains. Twenty-four, fifteen. No movement left.

Three legal orders. One Farm. Two steps. To score exploration, we have to find the same Scout on the board again and see where it actually went.

See the evidence →