Building an LLM simulation, in order
Write the resolution rules before you write a prompt. Build a world that plays without a model at all, replace the decision function with one, and measure every threshold against what the model actually returns.
- Step 1
- rules that play headless
- Step 2
- a typed decision function
- Step 3
- measure the thresholds
- Step 4
- make it watchable
The order matters more than any individual choice, because the wrong order produces a system whose behaviour nobody can explain, including the person who wrote it.
1. Make it play with no model
Write the world, the actions and the resolution rules first, and drive them with a deterministic heuristic. If it is not interesting with a house brain, a model will not save it. It will only make the flatness harder to see, because a language model's output is fluent enough to be mistaken for content.
Keep that heuristic forever. It is your test harness, your offline mode and your control group.
2. Replace only the decision
The model should answer what does this person do and nothing else. It should not narrate, resolve, move anything or see the rules. Everything that happens stays in one file you can read.
Ask in typed questions built from the legal moves, so an illegal action is absent instead of forbidden, and there is no free text to parse or police.
3. Measure before you tune
Every threshold you put on a model's answer needs a ladder: the same question across six or eight hand-built situations, with the bar placed in the gap between the ones that should differ. A bar chosen by intuition usually sits somewhere the model never goes. This project shipped one at 0.72 against a question that tops out at 0.18, and no alliance ever died.
Anything with an economy gets the same treatment by playing it headless: a year in a second, then read the ledger.
4. Then make it watchable
A simulation nobody can read is a log file. Show the machine, meaning the near-misses, the overrides and the cost, and give the room a deadline so that something is always about to happen.
What to skip
- A database, until state has to outlive a process. This one has none; a night you want to keep is a file.
- Memory systems, until a fixed state object demonstrably is not enough. See generative agents.
- More agents. Four hundred people needed about thirty guts, and the rest is code and is better for it.
Read next
Why eight prompted agents behave like one
Characters written as prompts converge because they are one model reading eight adjectives. Differences that survive contact with a situation have to live in the rules, in prices and gates and floors, and not in description.
Measuring a threshold instead of guessing it
To set a threshold on a model's answer, ask the same question across a ladder of hand-built situations, look at where the answers separate, and put the bar in the gap. A number picked by intuition usually sits where the model never goes.
The house brain: running with no model at all
The house brain is a deterministic personality heuristic that answers the same nine questions and synthesises its own distributions, so the simulation stays watchable, and tunable, with no API key and no network.
Memory-stream agents and fixed decision heads
Generative-agent designs give each character a memory stream with retrieval, reflection and planning. Parlour gives everyone the same nine questions over a purpose-built state object, which is cheaper, steadier and less ambitious.
Playing a whole world in the terminal
A party plays in the terminal with no browser and no server, and a village year plays in under a second. Both run on the same primitives as the live simulation, so a rule that works headless works live.