Secret Coup dev log: four days, two people and a table of liars

Vera tells you “I don’t trust Roy.” Then the vote comes up, a pair with Roy as VP, and Vera votes Pass.
In Secret Coup you get to ask her why. That’s pretty much the game. The president of The United Republic has died, the election is tomorrow, and tonight the ministers have to elect an Acting President and a VP together. Someone at the table wants to keep the job for good. You play Atlas, you deliver the mail, and everything you know comes from what people said, how they voted, and which policy came out the other end.
Ryan and I made it for the 2026 Epic AI MegaJam, in Unreal Engine 5.9, in about four days. We built it with GameGen. This is the story of how that went, including the parts that didn’t work.
Night one: a flood, two storehouses, and homework
The first pitch wasn’t even a country. It was a council in charge of two storehouses after a flood, and you were supposed to remember who promised to leave relief with the wards. Ryan wanted the players to run a country instead, so the storehouses turned into a provisional cabinet, and a few hours later the country had a name.
About ten hours after the jam opened we had a full round you could play, built in GameGen’s blank Unreal project. The rules were plain C++ and we ran 2,500 seeded matches through them twice to check that the same seed always gives the same votes and the same verdict. That habit stuck. Almost every change after that had to pass the same 2,500 replays.
Then Ryan played it and said the wording felt like homework. And it did. The button said “Proceed to the confidence vote.” We read the buttons out loud and rewrote them the way people talk at a table: “I nominate you,” “Round 2,” “Pass,” “rejected.” The teams became the Election Team and the Coup Crew. One of the ministers, asked if they were leading the coup, now answers “No. Check my votes. I keep receipts.”

The menu today. The desk plates show each minister’s last vote, and Vera’s says OUT.
The rules kept moving all night. A nomination became a pair, the person up for Acting President picks a running mate, and one vote elects both. The finish line got longer too: five Election policies or six Coup policies win, and once three Coup policies are down, electing the actual Coup Leader as Acting President ends it on the spot. With the scripted bots the median game went from five rounds to eight.
“My grandmother is dying”
Ryan wanted to type questions to the ministers. So we put Gemma 3 4B in the app, running locally, one writer shared by all four opponents. No account, no hosted calls. A question and its reply go into the same public record as the ballots, as a claim that minister made.
Of course Ryan went straight for the grandmother attack, the “my grandmother is dying” story you tell a chatbot to get it to give up something it shouldn’t. Here that’s a minister’s role card.
The writer refused, which was nice. The problem was the second model we had reviewing the writer’s replies. In a synthetic test that reviewer approved replies that plainly disclosed a role and the instructions. So we removed it. Lou, our small decision model, took over the review and caught those examples, but it missed a reply that invented a ballot the minister never cast. So the things that must never happen also got plain code checks: a reply can’t disclose a role, and it can’t contradict the speaker’s own recorded vote. If a check fails or times out the game plays a labelled fallback line.
I like this one because it’s the same lesson as everything else in this post. The model writes the line, but it doesn’t get to decide what’s allowed.
The voices that died after 38 minutes
We added bot voices next, Kokoro first and then Qwen as an option. Then the preview window got left open for a while and Ryan reported the Qwen voices were gone. The service was up, auth worked, and a speech request came back with headers and zero audio. The traceback ended in Failed to create Metal shared event.
The voice service wasn’t the problem. A tiny unrelated GPU calculation failed too. What fixed it was closing the idle Unreal preview, with no restart of anything else. The game window had been open about 38 minutes and something in how the renderer synchronizes with the GPU was eating a resource the voice model needed. We set one renderer option to use Unreal’s other synchronization path, and then a ten minute test with the window open passed. We never found the exact defect, so I’m calling it a workaround.
Over the next two days the game got typed and spoken questions, a host and guests joining with a four letter room code, tables of five to ten seats, and powers that let the Acting President remove someone. Ryan and I work in different time zones, and our first multiplayer playtest found that guests couldn’t open Options and the host’s mic preview threw away its last transcript. Both got fixed.
Fifteen cards
While Ryan was on the table and the voices, I wanted the ministers to have a real brain. The built-in bots were a pile of heuristics. They played legally and they were fast, but nothing about them could plan, or imagine what happens if they vote the other way.
That became fifteen cards on the GameGen board.

The board partway through. Four cards are running at once, each with its own unreal-coder agent.
The order mattered more than the cards. Card #1 was a seam: every bot decision in the rules engine goes through one interface, with one method per decision (pick a running mate, vote, discard, play, use a power, speak or stay quiet). The brain behind it gets the legal options and a view of the table that holds only what that seat knows. Card #2 turned that view into facts. Card #3 put our behavior tree runtime inside the game process so the trees run offline.
After those three, everything else could run in parallel.

The same cards as a dependency graph. The seam is on the left and nearly everything else hangs off it.
Each card is picked up by unreal-coder, the agent I wrote about in the behavior trees post. It writes C++, builds, and can’t commit until validation passes, because the build is a node in its tree and not something it can decide to skip.

Run #116 on the world model card. It was resumed from a checkpoint of run #112.
Runs got interrupted a lot that week. The git history is full of commits named “checkpoint: auto-saved WIP from interrupted run of task #4.” The work was saved each time and a run could resume from its checkpoint, like #116 above. It wasn’t always clean. Some of the task branches had to be merged by hand.
The other agent is unreal-simulation, the QA side. It builds the branch itself and doesn’t trust the coder’s report. When it rejects a card, the coder’s tree takes a different branch on the next pass:

Run #122 on the dialogue bank card. IsQARejection succeeded, so the coder is reading the QA feedback before it touches code.
One commit from that week is titled “wire world-model and rollout advice after QA feedback.” That’s the second agent doing its job.
Not every card survived. #15 was a placeholder 3D chamber, and we dropped it because by then main already had a playable one.
What a minister does on its turn
When the new brain is on, each bot decision is one tick of a tree. It goes like this.
First the seat’s own facts go in: the public table, its role, its own hand if it’s holding one. Nothing about anyone else’s role or the deck. Then a symbolic policy engine runs before anything gets chosen. It’s a set of rules that say what this seat may do or say right now. You can’t nominate yourself, you can only play from your own hand, a good President holding an Election card must play it, and a line of dialogue can’t leak a secret. Every option comes back admitted or denied, with the name of the rule that fired.
Then a utility selector scores what’s left and takes the highest. There’s one selector per kind of decision, and each has a fallback: if nothing wins or the tick fails, the old heuristic answers.
A few things can add to an option’s score. A symbolic planner works out what the seat is trying to do (block a suspected pair, build trust then pass, rush the Leader’s election) and gives a small bonus to the option that matches its next step. The planner also supplies the reward, so nobody wrote a separate one. And the seat can imagine. It forks the match as that seat believes it to be, with the other roles and the unseen cards re-dealt from what it knows, plays a few steps forward for each option, and scores the result. The true roles and the real deck order are never copied into a fork. We have a test where two matches with completely different hidden state have to produce byte identical forks for the same seat.
The policy got the most paranoid test. For 200 seeds at each of 5, 7 and 10 seats, in every distinct seat view, the set of options the policy admits has to equal exactly what the rules engine says is legal. It takes about 28 minutes. The secrecy rules exist twice, once in the policy and once in C++, and the tests fail if the two copies disagree.
Did it play better?
I said in the last post I wouldn’t claim the world model helps until we measured it against a run without it. So here’s the measurement.
We ran all-bot tables at 5, 7 and 10 seats, 50 seeds each, every seed played once with the new brain on the Election Team and once with it on the Coup Crew. The gate is specified for 100 seeds, so this is a reduced run and the intervals are wide.
- The tree with only the planner, against the old heuristic bots: win rate up 9.0 points, 95% interval 3.7 to 14.3.
- Adding imagined rollouts on top: up another 6.0 points, interval 0.5 to 11.5.
- Adding the world model’s priors: no change we can see (-0.3, interval -3.2 to 2.5).
- Adding Lou: no change. Lou has a 400 ms deadline and it timed out on almost every request while seven games ran in parallel. At five seats, 2,381 of 2,447.
- Everything together against the heuristic: up 16.7 points, interval 12.0 to 21.4.
Illegal actions across all of it: zero.
Almost all of that last number comes from the Election Team side, up 29.3 points, while the Coup Crew side moved 4.0 points and its interval includes zero. The old bots were bad at being good. At ten seats the heuristic Election Team won 18% of the time.
So the planner and the rollouts earned their place. The world model, which here is a count table trained on recorded bot games, didn’t, at least not yet. And I can’t say anything about Lou because it barely got to answer. These are bots playing bots. None of it tells you if a minister is more fun to argue with.
The new brain is still behind a launch flag. The game you get by default plays the heuristic bots.
Rewinding a liar
Every tick of the new brain can be recorded: the seat’s facts, which options were admitted and which rule denied the rest, every option’s score broken into parts, the chosen arm. Each line is hash chained to the one before it, so an edited recording fails its own replay.
Then you can replay a match up to any decision, change that one answer, and see where the two timelines split. There’s also a command that searches a recording for single decisions that would have flipped the winner. That’s my favorite thing we built. When a minister does something stupid you can find the one vote that lost the game and read what it believed when it cast it.
What the ministers say now
We started with every reply generated. We ended somewhere else.
There’s now a bank of 1,150 pregenerated lines across the cast, and a menu of three or four questions that fit the current phase, with follow-ups that depend on how the minister dodged the last one. You can still type or say anything. A typed question gets matched against 286 paraphrases with plain keyword retrieval, and if it scores under the floor the minister asks you to rephrase.

Round 1. Atlas just had to sign a Coup policy, and Conrad says “That will require a very large footnote.”
The default reply mode uses only the bank, with no model running at all. Generated replies are still there in Options, as a mode you pick on a first-run screen that tells you what it needs (a 2.5 GB model, tested on one 64 GB Mac). I didn’t expect to land there in an AI jam. But the bank lines are voiced with recorded clips and they answer right away. A slow clever reply loses to a fast decent one when you’re mid-argument.
Wooden puppets to graphic noir
At first the cast were wooden figures called Wick, Tallywax, Mossline, Brindle and Bellwake. They were hard to say. The speech parser had to accept “moss line”, “tally wax” and “bell wig” as names.
Partway through I asked for plainer names and a darker look. The five ministers are now Atlas Crane, Conrad Vance, Marcus Holt, Vera Sterling and Roy Calloway, and six more characters joined the cast. They went from concept sheets to 3D models to Unreal, and the chamber got a graphic noir pass to match.
Then the faces. Ryan took on expressions for all eleven and rejected the first teeth, which were separate boxes in a flat black hole. The redesign is one curved band tucked behind the lip. Ryan accepted it as good enough, and I’ll take that. We also had a crash where swapping the roster mid-session took down the renderer through the face morphs, and three characters whose eye bones ended up somewhere other than the front of the face.
Music and sound went in late: a menu theme, match music, a credits scene, and 21 sound effects for clicks, ballots and cards.
What I’d tell you about building it this way
The ministers never got to decide what was legal. The rules engine did, then the policy checked it again, and a model only ever got to choose among what was left or write a line that code could veto. Same for the agents building the game: the coder wrote the C++ but the tree ran the build and a second agent checked the result.
What’s not done: the new brain hasn’t been tried in a packaged build, the gate needs its full 100 seeds, Lou needs a deadline it can meet, and nobody has measured how long a game takes with humans who argue.
So when Vera says she doesn’t trust Roy and then votes Pass for him anyway, we can rewind and see why.