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

01

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.

02

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.

03

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.

04

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.

Use AI Writing as a Drafting Partner

Quilliam is strongest when the writer gives it a real scene job. The prompt should explain the genre, protagonist, setting, conflict, point of view, and the emotional texture of the passage. A vague request produces vague fiction. A specific scene brief gives the model pressure, direction, and a reason for the prose to move.

The first output should not be treated as final. Read it for story movement first: does the scene open a question, reveal a pressure, or change the character's situation? Then read it for language: does the voice fit the genre, do sentences repeat, and can any explanation be replaced by action, image, or dialogue?

A good revision request is narrow. Ask for less exposition, sharper dialogue, a more restrained ending, a clearer first image, or a version with stronger subtext. Asking for "better writing" usually creates surface polish instead of a better scene.

What Writers Still Need to Own

The writer still owns taste, continuity, originality, research, and final voice. If a story depends on historical detail, cultural context, medical facts, legal procedure, or technical worldbuilding, verify those details separately. AI can help draft a scene, but it should not become the only source of truth for the story.

Keep a small project note beside important generations. Record the prompt, the version you kept, the revision you requested, and why the scene works. That note makes future chapters easier because you can preserve voice, character pressure, and world rules instead of rediscovering them every time.

The example pages are designed to make this process visible. They show the prompt, the output, and the editorial questions a writer should ask before turning a draft into a real chapter, short story, or manuscript fragment.

If a generated scene feels close but not right, revise the instruction instead of restarting blindly. Ask for a different opening device, a clearer character desire, less summary, stronger sensory detail, or a version where the conflict appears earlier. Those focused changes make comparison easier and keep the writer in control of direction.

For longer projects, keep a living style note. Record point of view, tense, character names, world rules, recurring images, and phrases to avoid. This prevents later scenes from drifting away from the voice that worked in the first draft.

Best fit

Opening scenes, alternate versions, tone exploration, dialogue passes, genre tests, chapter continuations, and early drafts that need momentum.

Poor fit

One-click publishing, unsupported factual claims, copying a living author's voice, or replacing human editing and continuity review.

Before using

Prepare the character, conflict, setting, point of view, tone, and revision goal. The sharper the brief, the more useful the first draft.

A Practical Revision Pass

After a useful draft appears, run one focused revision pass before generating something completely new. Look for the first moment where the scene becomes abstract, the first line where a character explains a feeling instead of revealing it, and the first paragraph that repeats information the reader already has. These are the places where a small instruction can improve the scene more than a full rewrite.

Strong revision prompts are specific: tighten the opening image, move the conflict into the first exchange, reduce backstory, make the dialogue less polite, add one sensory detail from the setting, or make the final line feel unresolved. That keeps the writer in charge of taste and makes each version easy to compare against the previous one.

Before saving the passage, read it aloud once. Repeated sentence shapes, flat verbs, and overexplained emotion usually become obvious when spoken. Mark the lines worth keeping, discard the filler, and carry only the useful material into the real manuscript.

The best use of Quilliam is therefore comparative. Generate two versions with different constraints, keep the sentence or moment that actually moves the story, then rewrite around it in your own voice. That keeps the tool useful for momentum without allowing the draft to flatten character, continuity, or personal style.

On the homepage, this matters because the visitor is deciding whether the tool respects authorship. The answer should be visible in the page: bring your premise, use the draft as material, revise deliberately, and keep the final creative judgment with the writer.