cyai109

14 November 2026 · about 10 minutes

Which story shapes a checker can check

The cost of verifying a branching story is not one number. It depends on how much state has to survive a join, and that is a property of the shape you chose before you wrote a word.

Sam Kabo Ashwell's Standard Patterns in Choice-Based Games (2015) named eight shapes that most branching stories fall into: the time cave, the gauntlet, branch and bottleneck, the quest, the open map, the sorting hat, floating modules, and loop-and-grow. The piece is about pacing and structure, but it doubles as a map of what is cheap to check. Once you see why, you can predict the answer for your own story before running anything.

The only quantity that matters

A state checker doesn't count scenes. It counts pairs: this scene, with these variable values. Two readers standing in the same scene holding the same values are indistinguishable from that point on, so everything after them can be walked once. Two readers in the same scene holding different values have to be walked separately.

So the cost of checking a story is the number of distinct pairs the story can produce. Everything else is detail. And the number of pairs depends on one thing: how many variables are still being read after a branch rejoins. If a flag only matters inside the branch it was set in, the pair count barely grows. If a flag set in chapter one is read in chapter five, every branch has to carry it the whole way, and the count multiplies.

The shapes, and what each one costs

Time cave

Everything branches and nothing rejoins. The story is a tree, and the reader walks one path down it. State is nearly irrelevant: the position tells you almost everything, so the number of pairs is close to the number of scenes. Checking is cheap. The failure mode here is a branch that runs out of content, not a gate that can't open.

Gauntlet

A corridor with a real decision late in the run. Early on, there is one way forward; the branching comes at the end, and the branches are usually short. Little state carries, so again the pair count stays near the scene count. Cheap.

Branch and bottleneck

Branches diverge and then rejoin at a shared scene, and the point of the shape is that the bottleneck remembers what you did: a character treats you differently, a door is already open, a paragraph changes. That memory is state that has to cross the join by design, so the pair count multiplies exactly where the shape is doing its job. This is the expensive shape, and it is also the one most people reach for.

Quest

A hub with gates on it: you can't open the cellar until you have the key, and the key might be in any of four places, in any order. Here the state that matters is a set of flags that are read far ahead of where they're set, which is the worst case for pruning and the best case for a reader. Expensive, and the expense grows with the number of keys rather than the number of scenes.

Open map

Free movement between locations, with each location's text depending on what you've already done there. The state is local, which helps, but there is a lot of it and it is read from many directions. Large and expensive, and the number of orderings of the same actions is astronomical even though most of them end in the same state.

Sorting hat

One early decision assigns you to a path, and the rest of the story barely looks back. This is the shape where checking gets cheaper than it looks: before the decision, state is empty; after it, the early variables are dead the moment the assignment is made, because no gate ahead reads them any more. The state space collapses at exactly the point where the story branches, which is the reverse of branch and bottleneck.

Floating modules

Interchangeable scenes slotted into a frame, in whatever order the reader meets them. Each module carries its own small state and then gives it up. Cheap, as long as the modules don't start reading each other's flags.

Loop and grow

A loop the reader can go round again, with something accumulating each time: money, days, reputation. The state is the point of the shape, and it is read on every pass, so nothing can be pruned. If the accumulator has no bound, the pair count has no bound either, and no checker can finish. Numbers that only ever appear in comparisons can be collapsed into intervals, which buys a lot, but a story that genuinely behaves differently at every value is out of reach by construction.

ShapeState across a joinCost of exact checking
Time cavealmost nonecheap, near the scene count
Gauntletalmost nonecheap
Sorting hatone assignment, then deadcheap after the decision
Floating modulesper module, discardedcheap unless modules share flags
Branch and bottleneckthe branch flags, on purposeexpensive, and by design
Questkeys read far aheadexpensive, grows with keys
Open mapper location, many orderingsexpensive and large
Loop and groweverything, foreverunbounded

Where pruning saves you

The reduction that does the work is a backward question asked at every scene: is there any gate ahead of me that still reads this variable? If not, drop it. It is exact, not an approximation, because a value nothing ahead can read cannot change anything ahead.

On a sorting hat this is dramatic: the early variables die at the decision, and the whole first act collapses into one state. On branch and bottleneck it helps less, because the flags are read on the other side of the join by design. On loop and grow it does nothing at all, because everything is still being read on the next pass.

The other reduction handles numbers: collect every constant the gates compare a variable against, and collapse each gap between them to a single representative value. oil >= 3 only ever distinguishes below, at, and above 3. This is why a counter doesn't automatically kill the search, and why a story that checks coins == 7 after checking coins >= 5 still gets walked correctly.

The line I won't cross

Being able to check "can this choice ever appear" does not mean being able to check "can the player still finish". The second question needs a decision procedure for reachability of a terminal state from every reachable state, and stories built on quests and open maps make that explode. So the tool does not report softlocks, and says so, rather than shipping a plausible-looking wrong answer.

What it does report is narrower and provable: a gate whose condition no reachable state satisfies. And when the search hits its ceiling, it reports that instead of a clean bill of health, because admitting the limit is the only honest option available.

If you're writing one

You don't have to care about any of this to write a good story. But if you find yourself wanting a machine to look over your shoulder, the practical version is: keep the number of variables that cross a join small, prefer booleans to open-ended counters, and expect a quest-shaped story to be the one where the checker eventually says it ran out of room.

That isn't a failure of the story. It's a property of the shape, and knowing which shape you're in tells you in advance which of the two you're going to get.

Open IF Editor Previous: choices nobody can see