Loom: where the branching logic lives
Loom is the editor I built for the kind of interactive fiction Perpetūra is made of. I wrote about the three-day build already. This note is about one decision inside it that I keep coming back to: the logic that makes the prose branch lives inside the prose, not in a scripting layer next to it.
In Loom a scene is mostly writing. When the writing needs to bend around a
choice the reader made earlier, the condition sits right there in the
paragraph. [if met_her_before] one version, [else] another, [/if], and a
{flag} drops a stored value inline. The sentence and the condition that
governs it are read together, in one place, by the same pair of eyes.
The obvious alternative is a separate scripting layer: prose in one pane, a little logic file in another that says “if flag X, show variant Y.” Plenty of tools work that way and I’ve used several of them. The problem is drift. The prose gets rewritten, the script doesn’t move with it, and the two quietly disagree until a reader hits the branch and sees a line that no longer fits.
Logic near the thing it controls
Level scripting has the same fork in the road. You can attach a trigger’s logic to the trigger itself, living in the level, or you can keep a separate script file that reaches into the level by name. The separate file scales better for a big team with a dedicated scripting pass.
It also rots more quietly. Someone renames a volume, the external script still points at the old name, and a door stops opening for a reason that takes an afternoon to track down. Logic kept beside the thing it controls goes stale less often, because you tend to edit both in the same breath. Loom is a solo authoring tool, so I optimised for the writer staying in flow over the structure a large team would need. Inline won.
Own your words
There’s a second decision I’d defend just as hard, and it sits at the far end of the process. A finished story exports to a single self-contained HTML file. No account, no server, no runtime to install. It becomes a file you can email, host wherever you like, or simply hold onto. The editor keeps your projects on your machine the same way, as files, not as rows in somebody else’s database.
Inline templating and static HTML export are both old ideas, and I’m not claiming either as clever. What I wanted was for the two to pull the same direction: the writer stays close to their words, and the words stay in the writer’s hands. I only started trusting it once the whole Hyunjae story, all sixty-six scenes, ran through it clean.