Spielerando

Lesson 14 of 14Keep it whole7 minFree

When Your AI Forgets the Story: Keep the Facts in a File

A pixel art beekeeper keeps a honey stall between two villages, one with straw roofs and one with slate roofs. Bees carry her jars to one village or the other, and a meter and a flag over each village show how it feels about her. While the east village is courted, the west one turns wary and then hostile and shuts its doors; a season later both have nearly forgotten.

A jar moves its village 10 up and the rival 5 down. A tier rises at its border but drops only 5 below it, so a flag does not flicker. A season here is 90 days in a moment, and each day pulls every standing 1 point back toward zero.

Try it: Send jars only east: the west flag turns orange, then red, and its doors shut. Bring the west up to friendly, then send one jar east: its needle dips past the border and the flag stays green; one more and it drops. Let a season pass and watch both needles slide back toward the middle.

Keys: ← a jar to the west → a jar to the east X let a season pass

This little game runs this blueprint's tested code in your browser. Nothing you press is sent anywhere. Its code on GitHub.

The game above is the playable demo of our blueprint Faction Reputation. It runs that blueprint's tested code in your browser.

A story that lives in the chat is a story nobody can check, and each new scene can quietly contradict an old one. This lesson keeps the facts in one file your AI reads first, with a check for every line, on the game above: two villages that remember everything the beekeeper did, although not one scene in them remembers anything.

Also in this lesson 5 things to read up on 3 questions to check yourself

The idea

This is the last lesson of the course. Every lesson before it turned one part of a story into facts with a check, and this one keeps them all in one place, so that they still hold in the third month of a project and not only in the first week.

The game above shows the shape. Its villages remember what you did, but no house in them remembers anything: each village's standing is kept in one place, and the doors, the flags, the prices and the waving all read it.

A story built with an AI needs the same shape: the facts and the rules of its world in one file that every chat reads before it writes a line, and a check for every line that runs after every change. Then it no longer matters what your AI remembers from last week. An engineering article in the reading list describes the same habit for AI agents: notes written to a file outside the conversation and read back in later.

How it works

Play it, and watch where the memory is. Send jars only to the east, until a heart shows over the east village. Now look west: its flag has turned orange. Keep going, and the flag turns red and the doors shut. Nobody wrote a scene for that. One rule, written once, does it: what helps one village sets the other back by half as much. Then let a season pass. Both needles slide back toward the middle, and the west's grudge fades to nothing, never into a liking.

Write the file this little world needs. Before your AI writes one scene about these villages, the facts go down as short, numbered lines:

  1. There are two villages, west and east, and each has a standing with the beekeeper.
  2. They are rivals: a jar for one raises it, and sets the other back by half as much.
  3. A standing is read as one of five moods: hostile, wary, neutral, friendly, allied.
  4. A hostile village shuts its doors and pays nothing for a jar.
  5. A mood rises at its border, and drops only 5 points below it.
  6. A season pulls every standing back toward zero, and never past it.

"The west is proud and a little old-fashioned" may be true of your story too, but no check can try it, so it belongs in a note on tone. A line that no check can try is a wish, not a fact.

Give every line its check. Next to each line goes a test that fails when the game breaks it. For line 2: send one jar east, and the west must go down by half of what the east went up. For line 6: let a season pass for a village that is cross with her, and its number must stop at zero. The blueprint behind the game has such a test for each of its rules. This course is kept the same way: every number a lesson states about a blueprint is listed with where it comes from, and a test fails when the blueprint's code says otherwise.

A scene names the lines it rests on. When your AI writes a new scene, it writes above it which lines the scene needs: "The elder of the west thanks her: needs the west at friendly or better (line 3)." Now a check can walk the orders in which a player can play, and look for one in which the scene comes while its line says otherwise. For numbers like these, that walk is a test your AI writes. For facts such as who is alive or who holds what, the checker on this site walks them in your browser.

What goes wrong

The shortcut is to let the story live in the chat. In the first week you and your AI agree that the villages are rivals, and that decision lives in one message. In the third week you open a new chat and ask for a warm scene: once the east is her ally, the elder of the west comes to the stall to thank her for the honey. Nothing crashes, and every test of the code passes, because no test knows about the rivalry.

Picture that scene in the game above. Every jar goes east, the heart shows over the east village, the west's flag is orange, and then the elder of the west walks up to thank her. The player who chose the east notices at once. You, who wrote the two parts weeks apart, may never.

You do not need to know how your AI keeps things to see why this happens. A study in the reading list found that language models often used a piece of information worse when it stood in the middle of a long input than near its beginning or end. A decision made weeks ago sits somewhere in the middle of a long chat, if it is in the chat at all. And whatever your AI keeps, you cannot read it or run a test on it. A file you can.

With the file and its checks, the new scene fails on the day it is written. Its header says it needs the west at friendly or better, and the check prints an order of play in which it comes while the west is wary: every jar to the east. Without the file, nothing fails, and a player finds it for you.

Tell your AI

My story must not depend on what you remember between chats. We keep it in a file and check it.

1. Read [the files of my game] and this chat. Write story-facts.md: every fact and rule of my story as one short, numbered line. Next to each, say where you found it: a file and line, or a message of mine, quoted. Mark anything you are not sure of with "ask me".
2. For every line, write a check that fails when the game breaks it: a test per move, or a walk through every order of play with [the checker you use, for example the story-model-check recipe from spielerando.com]. A line that no check can try goes into a list of wishes at the end, not among the facts.
3. Above every scene, write the numbers of the lines it rests on.
4. Run all checks and show me their output, not your summary of it.

From now on:
- At the start of every session, read story-facts.md and run the checks before you write anything. Show me the output.
- When we decide something, add its line and its check at once, not at the end of the session.
- After every change, run the checks again. If one fails, show me the order of play it printed and the line it breaks, and wait for my choice.
- If something is not in the file, say "I do not know". Do not answer from what you think you remember.

Try it

Read up

Where to go deeper: the pages of ours this lesson builds on, and what others have written about its point.

Check yourself: three questions

Each answer is checked and explained at once. The questions are part of the quiz, so they count for your Game Coder IQ like any other.

Question 1 of 3Easy

In the village game of this lesson, you send jars only to the east. Nobody wrote a scene in which the west turns against you, yet its flag turns orange and later its doors shut. Why?

All questions of this course · The quiz and the Game Coder IQ

How useful was this page?

Nobody has rated this page yet.

One click, no account. It tells us which pages to make better next.

Last updated: 2026-11-27