← p11c

Story Tools

Branching stories as state, not as trees. A Petri net decides what can happen next; plain text says how it reads. Two files, kept apart on purpose.

A choice-driven story is usually written as a tree, and a tree is the wrong shape: every branch that rejoins has to be duplicated, every combination of "has the sword" × "told the truth" × "night time" multiplies the nodes until the thing is unmaintainable. Multilinear models the story as a set of independent aspects — location, mood, who knows what — that change in parallel under constraints. An event fires only when its conditions hold. What the player can do next falls out of the state, and never has to be enumerated.

Underneath sits a Petri net, so the story is a simulation you can actually inspect: reachable states, dead ends, events that can never fire.

Structure and Prose Are Separate Files

example.mld — what can happen
# Leave home

location: home > outside
mom: > alone

# Sidestory mom

mom: alone > party
example.pk — how it reads
# Leave home

So you decide to leave.

You hug your mom and go outside.
example.vng — glue
multilinear example.mld
story example.pk

The structure file never contains a word of prose, and the prose file never contains a condition. They are matched by heading. Rewrite the text without touching the logic; rewire the logic without touching the text.

The Tools

PN Editor · Download ▸

Build and run Petri nets visually — place transitions, fire them, watch the tokens move. The direct way to see whether a story's state machine does what you think it does.

VNgine · Download ▸

Visual novel player. Reads a .vng file, runs the multilinear simulation, renders the prose with dialog boxes and choices. The engine games ship with.

mlplay · Download ▸

Play a story in the terminal — no assets, no renderer, just the branching. The fastest way to test whether a plot actually works before anyone draws anything.

Downloads

The Libraries

Everything above is built on a stack of small crates. Each is usable on its own.

In the Game

The simulation decides what can happen. These decide how it looks and sounds when it does — a separate layer, deliberately, so the same story runs in a terminal, a visual novel, or a 3D game.

Links