Storyfall

Branch Choices

Branch choices let a single choice route the player to one of several scenes based on game state. Use them for skill checks, dice rolls, percentage chances, or formulas. They replace the older pattern of stacking several conditional continue choices on the same scene.

When to Use a Branch Choice

  • Skill checks: pick the lock if lockpicking > 10, otherwise trigger an alarm.
  • Dice rolls: roll a d20 into a variable, then route to critical, hit, or miss scenes.
  • Probability: 30% chance of finding treasure, 70% chance of finding nothing.
  • Stat-based chance: 0.5 + charisma * 0.02, so the chance scales with the stat.
  • N-way splits: send a single “Investigate” choice to four or five outcomes without cluttering the scene.

How Branches Work

A branch choice has a list of branches, evaluated top to bottom. Each branch has:

  • A target scene that the player goes to if this branch is picked.
  • Optional conditions. The branch is skipped if they don’t pass.
  • Optional probability. The branch fires a percentage of the time, or based on a formula.

The last branch is always Otherwise. It has no conditions and no probability, so it always matches. This guarantees that exactly one branch fires. You can change the Otherwise branch’s target, but you can’t delete it.

At play time, Storyfall walks the branches in order and picks the first one whose conditions pass and whose probability roll succeeds. Anything below the picked branch is ignored.

Creating a Branch Choice

  1. Add a choice on your scene.
  2. Open the choice type dropdown and pick Branch.
  3. The editor replaces the single target scene with a Branches section, pre-filled with one configurable branch and the Otherwise branch.
  4. Configure each branch:
    • Click the scene picker (labelled Select scene… until a target is set) to choose where this branch routes.
    • Click the Conditions button to add condition checks.
    • Use the Chance card to set a percentage or a formula.
  5. Click Add branch to add more branches. Otherwise stays at the bottom.
  6. Use the up and down chevrons to reorder branches. The Otherwise branch can’t be moved.

Probability

The Chance card has two modes:

ModeExampleBehavior
Percent100%Branch fires when its conditions pass and the roll succeeds.
Formula0.5 + charisma * 0.02Branch chance is computed from a formula.

Formulas reference story variables by name. They can also use discovered NPC sentiment, discovered faction sentiment, scene visit counts, and choice click counts from the dropdown. The result is clamped to the range 0 to 1. Scene and choice operands save with stable IDs, so renaming a scene or editing choice text does not break the formula.

A new branch fires whenever its conditions pass and is silent at play time. Touching the Chance card (changing the percent, switching to Formula, or otherwise interacting with it) switches the branch to a probabilistic roll - and a roll triggers the spinning dice indicator described below, even at 100%. To keep a branch silent, leave its Chance card untouched.

Dice Rolls

A dice roll is a regular effect on the choice, not a branch-native feature. The pattern is:

  1. On the branch choice, add an effect that sets a number variable to a random roll. In the effect editor, pick Set as the operation and Dice as the value mode, then set the count and sides (e.g. 1 die with 20 sides for a d20). The stored value is 1d20. See Random Value Types for the other modes (Range, Options, Formula).
  2. On each branch, add a condition that checks the variable:
    • Branch 1: IF rollResult >= 18 goes to Critical hit.
    • Branch 2: IF rollResult >= 10 goes to Normal hit.
    • Otherwise goes to Miss.

The roll fires when the player picks the choice; the branches then route based on the result.

What Players See

  • Condition-only routing is silent. The player just lands in a scene, with no indication that a check happened. This is good for skill checks where you don’t want to break immersion.
  • Probability rolls show a brief spinning dice icon and the words “Chance roll” in place of the choice’s arrow before the next scene loads. This appears any time chance was actually rolled, even when the Otherwise branch ends up winning.
  • Effect toasts (such as +5 reputation) display as they normally would.

Story Tree View

In the Story Tree, a branch choice renders as a single edge from the source scene to a small purple branch node, then fans out to each target scene. Each fan edge is labeled with its rule:

  • Conditions: IF lockpicking > 10 (amber).
  • Probability: 30% (blue).
  • Otherwise: Otherwise (muted gray).

Next Steps