How to Build a Branching Story That Does Not Break
Have your AI model every scene with what it needs and what it changes, then have a checker walk every path through your story. It finds the dead ends and broken paths before a player does, and it gives you the exact scenes that lead to each one.
Why does my branching story break when I add a path?
In a small pirate game, the player can burn the rope bridge or leave it standing. Later you add a scene where the crew crosses the bridge, with your own playthrough in mind. A player who burned the bridge now has nowhere to go, and the game is stuck.
The reason is simple arithmetic. Two choices with two options each make four paths. Ten choices make 1,024. You play one path, and the AI writes one scene at a time, so nobody looks at all of them. A checker does.
Which facts and rules keep a branching story whole?
- Facts: what each choice changed, such as whether the bridge still stands.
- Every scene has a way forward. No path stops anywhere but an ending.
- Every choice leads somewhere real. No choice points to a scene that does not exist.
- Every scene can be reached. No scene is lost.
- A scene's needs are true. No scene talks about something that did not happen on this path.
What does a real check look like?
Here is that bridge as a model. The player burns the bridge or keeps it. Crossing needs the bridge to be standing. After crossing comes the harbour, then the ending.
We ran this invented story through TLC 2.19 on 2 November 2026. This is TLC's real output. We only left out its housekeeping lines and put each step on one line.
Error: Deadlock reached.
State 1: scene = "Start", bridge = "standing"
State 2: scene = "Burn the bridge", bridge = "burned"
"Deadlock" means the story stops with nowhere to go. The path is two steps long: Start, Burn the bridge. That path is the proof, and no rule had to be written for it. Checking for dead ends is built into TLC.
The fix: a player who burned the bridge can take a boat to the harbour. We ran TLC again.
Model checking completed. No error has been found.
11 states generated, 9 distinct states found, 0 states left on queue.
TLC looked at all 9 states the story can reach and found no dead end on any path.
Do I need to write every path?
No. Let paths split and join again. The player who burned the bridge and the player who did not can both reach the harbour, and the captain says one different line. The game has to remember what the player did for that to work. See choices that matter.
Do I have to read any of this?
No. You never have to read the model or the checker's output, because your AI writes it, runs it and tells you the result in plain words. TLA+ is a language for modelling, and TLC is the tool that checks a model. If TLC cannot run on your computer, your AI can get a ready-made checker through our MCP server and run it in your project. Spielerando never looks at your story.
A pass means your rules held on every path in the model. It does not mean your story is good, and it says nothing about rules nobody wrote down.
Paste this to your AI
Do not just read my story and tell me the paths work. Model them and check them with a tool.
1. Read my whole story. If you cannot see my files, ask me to paste it.
2. Write a TLA+ model of the story in a folder called story-check.
- Facts, as state: the current scene, and everything a choice can change.
- Steps: every scene and choice, with what it needs and what it changes.
- Rules: let TLC report deadlocks, which are dead ends. Only endings may stop. Add invariants: no scene talks about something that did not happen on this path.
- Also check that every scene and every ending can be reached. For each one, add a temporary rule saying it is never reached and run TLC. If that rule breaks, the trace is a path to it. If it holds, nothing reaches it.
3. Run the TLC model checker on the model so that it walks every path. If TLC cannot run here, use get_recipe with story-model-check through Spielerando and run that checker in this project. If you can run neither, tell me, and do not claim that anything was checked.
4. For each dead end, broken rule or lost scene, show me the exact path of scenes, in plain words, and quote the line of my story that causes it.
5. Do not change my story yet. Suggest one fix for each and wait for me to pick. Prefer joining paths back together over adding new ones.
6. After each fix, update the model, run the checker again and show me the result.
From now on, run the checker every time you add or change a scene. Report only which rules held, how many states were checked and whether the check was cut off. Never tell me the story is good. If you cannot tell what a scene needs, say "I do not know" and ask me. Do not guess.
Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP
How to check it worked
- Play the path it gave you. Follow those exact scenes in the game. You should get stuck yourself.
- Play the path you never play. Always pick the option you like least.
- Reach every ending. Ask the AI for the exact choices that lead to each one, then follow them.
- Add one new scene. Ask for a small new scene and see if the AI runs the checker without being asked.