Spielerando

Lesson 5 of 14Quests that cannot get stuck8 minFree

Quest Items and Soft Locks: What the Story Needs Later

A pixel art beekeeper walks along a garden wall with three doors while her bag at the top is full. She picks up an orange key anyway, tries it on the wrong door, which stays shut, and cannot throw it away. It opens the green gate and is used up, and at once the shed, which needed the same key, is crossed out in red.

Keys go into a pocket of their own that holds 16, so the full bag never stops one. A wrong door spends nothing and a key cannot be thrown away. The shed and the gate both need the one brass key, a mistake put in on purpose: once it is used, the check crosses out the door nothing can open any more.

Try it: Take the orange key to the grey door: it stays shut and the key stays with you. Open the shed first instead of the gate, then start over and do it the other way round: each time the other door gets the red cross. The blue key opens the grey door and stays in the pocket.

Keys: ←→ walk ↑ try the door X throw a key away ↓ start over

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

A scene late in your story needs something: a key, a tool, a person who is still there, a fact the player has learned. Two questions decide whether the story can be finished: can the player always still get it, and can it be lost, sold or used up before she needs it? The garden in the game above has a mistake put in on purpose that fails the second question. This lesson finds it with you, then hands the same check to your AI.

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

The idea

Read a story backwards and it is a chain of needs. The end needs the gate open, the gate needs the brass key, the key lies in the grass. Every scene asks for something an earlier scene must hand over, and that nothing in between may take away. A designer in the reading list works exactly this way: he starts from what the player needs, not from where to hide a key, and draws what depends on what, which he says is not the same as the order of play.

For every need, ask two things:

A need that fails either one is a soft lock: the game still runs, she can walk about, and the story cannot go on. Nothing tells her. She walks back and forth until she gives up.

How it works

The game above is a garden wall with three doors. From left to right: a wooden shed with an orange lock, a grey door with a blue lock, a green gate with an orange lock. The lock shows the colour of the key it wants. The orange brass key lies in the grass after the shed, a blue key past the gate. The bag at the top left is full; keys go into a pocket of their own at the top right, which holds 16.

  1. Walk right. You pass the shed first, with nothing in your hands: press up, and it shakes. Walk on over the orange key: it goes into the pocket although the bag is full. A full bag never stops a key.
  2. Throw it away with the throw button. It flies up and drops back into the pocket: a key item cannot be dropped, sold or thrown away.
  3. Try the grey door with the orange key. It stays shut, and the key stays with you: a try that fails spends nothing.
  4. Open the green gate. It opens, the key is used up and goes to the crossed-out keys at the top right, and at that moment the shed gets a red cross. The shed needs the same key, and nothing can open it any more. The red cross is the blueprint's own check: every shut door whose key is used up and gone.
  5. Start over with the down button, pick up the key and walk back to open the shed first. Now the gate gets the cross. Whichever door comes first, the other one is lost.
  6. Fetch the blue key and open the grey door. The door opens and the key stays in the pocket, because this lock does not use it up.

Now write the garden as a list of needs, one line for each thing a door asks for:

That is the whole check, by hand: for every need, every way it can leave and every other scene that wants it. A line where the thing can leave while another scene still waits for it is a soft lock waiting for its order.

What goes wrong

The shortcut is a story whose items work in the order the AI wrote it. Picture the garden being built: first the gate, which opens with the brass key, and the story goes on behind it. Later a side scene wants a tool from the shed, and the shed gets the brass key's lock too, because it is the garden key. The AI tests the shed: put the key in the pocket, open the shed, it works. It tests the gate the same way, and it works. Each test starts with the key in hand, so each one passes. None of them walks through both doors with the one key, and that is what a player does.

The same mistake has other faces: a quest item sold in a shop before the scene that asks for it, a full bag that refuses the one thing the next chapter needs, a person the quest needs who leaves in a chapter of the main story. Every scene works alone, and the list of needs shows the line where it breaks.

A designer's rule from the reading list says it plainly: never require a player to pick up an item that is used later in the game if she cannot go back and get it when it is needed. You notice it before anyone plays by reading the "leaves" column next to the "also needed by" column. You notice it in play by doing things in the order the wall does not lead you in.

Tell your AI

Before you change my story, list what every later scene needs, and check that the player can always still get it.

1. Read my game [or: these files]. For every scene, door, quest step and ending, write what it needs: an item, an ability, a person who must still be there, a fact the player must know.
2. For every need, write every place the player can get it, every way it can leave her (used up, sold, dropped, given away, a person who leaves or dies, a choice that rules it out), and every other scene that needs the same thing.
3. Mark every need that can leave while a scene still needs it, every used-up thing that two scenes need, every need nothing in the game hands out, and every name a scene asks for that no item has.
4. For each mark, show me the order of play that loses it, step by step. Suggest one way out: give a used-up thing one scene only, make it last, or add a second way to get it. Wait for my choice.
5. Write a check that lists every scene whose need is gone for good, and a test that plays the order you found. Run the test before and after the fix and paste me the real output both times.

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 garden above, the shed and the gate both need the brass key, and opening either door uses it up. Which order of play opens both doors?

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

Next lesson Every Order a Player Tries: Scenes That Fire Twice or Too Soon

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