Craft guide
How to Write Interactive Fiction: Branch Design
A practical guide to writing interactive fiction: branching structures, choice node design, state and flags, and the failure modes to avoid.
A repeatable authoring loop
Define the spine
Write the one path that must exist: the version of the story you would publish if interactivity were removed. Every branch is measured against this spine.
Place choices on pressure
Add a choice only where the protagonist faces a real trade-off, a moral cost, or incomplete information. No choice at a moment with an obvious right answer.
Decide what each option changes
Before writing a branch, name its consequence: a different scene, a flag the story remembers, a relationship shift, or a future option that opens or closes.
Reconverge on purpose
Fold branches back into shared nodes so the tree stays finite. Track which earlier choices the reconverged scene should acknowledge.
The four structures you will actually use
Most interactive fiction is built from four shapes. The branch-and-bottleneck (also called the gauntlet) opens choices then funnels back to fixed checkpoints, keeping scene counts linear while letting choices feel real. The time cave is a pure tree with no reconvergence: vivid but it doubles every level, so a 10-choice cave needs over a thousand endings. The loop-and-grow returns the reader to a hub that has changed because of flags they set, ideal for investigation or relationship stories. The open map gates regions behind state checks rather than fixed order. Pick one as your backbone before writing a single branch; mixing them by accident is the fastest way to lose control of scope.
Choice nodes: the difference between a fork and a decision
A fork is two doors. A decision is two doors where the reader can predict, roughly, what each costs and still cannot be sure they chose right. Strong nodes give 2 to 4 options, never a wall of near-identical ones. Each option should be phrased as an intention ('Confront her now' / 'Wait and watch'), not a UI label ('Option A'). Avoid the false choice, where both paths reach the same next paragraph with cosmetic differences, and the trap choice, where one option is obviously fatal and exists only to punish. The test for a node: if you deleted one option, would the scene lose meaning? If not, that option is filler.
State and memory: making earlier choices matter later
Interactivity feels real when the story remembers. Track this with a small set of flags rather than branching the whole tree. A boolean flag records a fact (player_lied = true). A counter records degree (trust = 3). A gate is a later scene that reads those flags and changes a line, unlocks an option, or alters an outcome. The discipline is restraint: a handful of consequential flags that surface at well-chosen moments beats fifty flags that never pay off. Write the payoff scene at the same time you write the choice that sets the flag, so you never promise consequence you forget to deliver.
Common failure modes and their fixes
Branch explosion: caused by full reconvergence avoidance; fix by adopting bottlenecks so paths merge at checkpoints. The illusion problem: every path is mechanically distinct but emotionally identical; fix by tying at least one branch to a consequence the reader will feel, such as a character who dies or refuses to return. Dead-end starvation: a path runs out of content and ends abruptly; fix by mapping every branch to either a designed ending or a reconvergence node before drafting prose. The lawnmower problem: readers replay only to collect endings rather than to feel a different story; fix by making the central tension, not the endings, the reason to choose. Verify against an explicit map, not vibes: draw the node graph and confirm every edge leads somewhere intentional.
Worked example: a three-node decision with real consequence
Spine: a courier must deliver a sealed letter through a checkpoint. Node 1 offers Bribe the guard (sets coin_spent, opens a poorer ending later) or Forge a pass (sets suspicion +1). Node 2 reads suspicion: if it is high, the guard's captain appears and the only options narrow to Run or Surrender; if low, the courier passes and keeps a quieter route open. Node 3 reconverges at the recipient's door, but the line the recipient speaks changes based on coin_spent and whether the courier surrendered earlier. Three nodes, two flags, one reconvergence, and every choice changes a later scene without doubling the tree. That ratio, choices that read flags rather than spawn whole new branches, is what keeps interactive fiction finishable.
Writing prose that works in any order
A linear scene can assume the reader knows what just happened. A branching scene cannot, because the reader may arrive from several earlier paths. The fix is to write reconvergence scenes so they reference state, not specific prior wording. Instead of writing 'after you bribed the guard, the recipient frowns', write a single scene that checks the coin_spent flag and swaps one sentence. Keep the unconditional spine of the paragraph readable on every path, and let flags edit only the details that must change. A second discipline is tense and pronoun consistency: pick second-person present or third-person past and hold it across every node, because mixing them is far more visible when scenes are stitched together from different branches. Finally, write each option's destination before you write its enticing label, so you never promise a consequence the branch does not deliver.
Playtest with a map, not a read-through
A single linear read-through cannot catch the bugs that matter in branching fiction, because it only exercises one path. Test against the node map instead. Trace every edge and confirm it leads to either a designed ending or a reconvergence node, with no dangling exits. Walk each flag from where it is set to where it is read, and delete any flag that is set but never consumed, because it is dead weight that misleads future you. Force the extreme states: the all-aggressive path, the all-cautious path, and the path that sets every flag, then read the reconvergence scenes to confirm they still make sense. Watch for contradictions where a remembered fact collides with a later line written for a different path. A short pre-publish checklist, every edge resolved, every flag consumed, every ending earned, catches most failures before a reader ever finds them.
Quick answers
How many endings should an interactive story have?
Fewer than you think. Three to five distinct, earned endings usually beat a dozen near-identical ones. Endings should feel like the consequence of accumulated choices, not a menu the reader collects.
What is the difference between branching and a flag?
Branching splits the story into separate scenes the reader must navigate. A flag is a remembered fact that lets a single shared scene change its lines or options. Flags let you create the feeling of branching without the scene-count explosion of a true tree.
Should every choice change the plot?
No. Some choices reveal character or set a flag that pays off much later. A choice can matter by changing tone, relationship, or a future option rather than the immediate next scene. What it must not do is change nothing at all.
How do I stop the branch count from exploding?
Use bottlenecks. Let choices diverge, then reconverge at shared checkpoints, and push variation into flags that modify shared scenes rather than spawning new ones. A pure tree doubles every level; a branch-and-bottleneck stays roughly linear.