Spielerando

Lesson 11 of 14Mysteries and endings7 minFree

Game Lore in the Order the Player Finds It, Not the One You Wrote

A pixel art beekeeper with a torch looks at grey carvings on stone tablets in a dark cave: a hive, a lightning bolt, a wasp, a flower. Each one she looks at lights up, and a small book in the corner shows a red number. In the open book three pages fill with pictures, a yellow mark shows what is unread, and the old hive's page gets a gold star once all three pieces are found and read.

Three stories, in 3, 2 and 1 pieces. A piece is new until you read its story; the red number on the book counts the stories with something unread. Looking at a carving you already have changes nothing. A story gets its gold star only when every piece is found and read.

Try it: Look at the hive carving, open the book and read: the yellow mark goes. Look at the same carving again: it only glows grey, and its page gets no new mark. Find the hive's next piece: the mark comes back, for that one piece only. Read the hive after its third piece and watch the star.

Keys: ←→ walk, pick a story X open the book Space look, read

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 Lore Codex. It runs that blueprint's tested code in your browser.

In a game the player learns the story in her own order, and often not all of it. A scene that leans on something she may not have seen lands on nothing, and a scene that tells her what she was meant to find later takes the finding away. This lesson walks the cave above out of order, reads what its book knows about her, and then has your AI check every scene against what the player can have seen by the time she gets there.

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

The idea

You write a story from its beginning. The old hive's story in the game above was written that way, in three pieces: the hive, the wasp, the bee. On the cave wall they stand apart, with a storm and a flower between them, and nothing makes her look at them in that order, or at all.

Henry Jenkins puts the difference plainly: the author of a film or a book has a high degree of control over when we receive a piece of information, while a game designer can only partly control it, by spreading the information across the game's space. Emily Short writes about letting the player get three pieces of information in any order, and why a simple branching script needs a lot of repetition for it. Both are in the reading list.

So the order in which the player learns things belongs to each play, not to your script. A scene that needs her to know something has to ask the game whether she does. In the game above, the book is the place that knows: for each story, which pieces she has found and which she has read.

How it works

Play the cave above out of order, then write down what your own scenes lean on.

  1. Learn the end first. Walk past the carvings near the entrance without looking, all the way to the bee, the hive's last piece, and look at it. A red number appears on the book in the corner. Open the book: the hive's page counts one of three, and its last slot holds the bee while the two before it stay empty. Its title shows as well, because this book shows a story's name once 1 piece is found. A name is something the player learns too: a title that says how a story ends gives away the carvings she has not seen.

  2. Read it, then look again. Read the hive's page and the yellow mark goes. Look at the bee once more: the carving only glows grey, and nothing in the book changes. Walk back and look at the wasp: the mark comes back, for that one piece only. The book keeps two lists for every story, found and read, puts the pieces in the story's order and leaves the gaps open.

  3. Leave with nothing. Walk to the far end of the cave without looking at anything. The cave lets you out with an empty book, and the game above starts over. Every scene after a place like this has to work for a player who walked straight through.

  4. Write down what each scene leans on. Take the scenes that come after the cave in your story, or make some up: a character who says the wasps came back, a door whose riddle is the storm's second picture, a last scene that names the old hive. For each, write the piece it leans on, and whether it needs her to have found it or to have read it. Found means she stood in front of it; read means she opened it. A line that repeats a detail from a page's text needs read.

  5. Give each scene an answer for the player who lacks the piece. There are three: the scene waits until she has it and says why, it has a second version for a player without it, or it hands her the piece itself. What it may not do is speak as if she knew. A scene that tells the end of a story before she has found it is the same mistake turned round: put the reveal after its pieces, or ask the book first.

What goes wrong

The shortcut is every page of lore unlocked from the start. The AI writes the world's history in one go, in reading order, puts all of it in the book, and writes the later scenes as if the player had read it, page one before page two. Each scene is right in the order the AI wrote it.

Picture the cave above with that book. You open it on the way in, and all three stories are full, with no mark anywhere. The red number has nothing to count, the carvings have nothing to give, and the book can no longer tell any scene what she has seen. A character who mentions the wasps is right for the AI and a riddle for a player who never looked at the wall.

The quieter form: the book does keep pieces, but the scenes never ask it. The AI wrote each scene alone and took for granted the order it wrote them in.

You notice it by taking one late scene and asking your AI what the player must have seen for it to make sense, and where the game checks that. If the answer is that she will have read it by then, the scene leans on the order of your script, not on the game. Then play to that scene while skipping everything you can skip, and listen to what it says.

Tell your AI

I want every scene in my game to work in the order the player really learns things, not in the order I wrote them: [your game and its story in one or two sentences].

Before you change anything:
1. List every piece of story the player can find: pages, carvings, overheard lines, items with a text. For each, say where it is, whether she can skip it, and what in the game records that she found it and that she read it.
2. List every scene and line that leans on one of those pieces. For each, name the piece and whether the scene needs it found or read.
3. Write a check in code that walks every order in which the player can reach each scene, including the orders in which she skips what can be skipped. For each scene it prints the pieces it leans on and whether she always has them by then. If you cannot write the walk yourself, use the story-model-check recipe (spielerando.com/en/recipes/story-model-check). Run it and show me the output as it came.
4. For every scene that can be reached without what it leans on, suggest one of three answers: it waits and says why, it has a version for a player without the piece, or it gives her the piece itself. Wait for my choice.
5. Make sure the book or log starts empty, except for what the opening scene gives.

Do not tell me the story reads well in order. Show me the check's output.

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

Late in your game, a character talks about a carving in a cave as if the player knew it. The player walked through that cave without looking at anything. What should the scene do?

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

Next lesson Multiple Game Endings That Follow From What the Player Did

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