Skip to main content
← All work

structdnd

A single-player role-playing game where a language model narrates but is never allowed to decide anything.

Status

Playable, with a playtest harness that runs the whole game deterministically and never calls a model at all.

Language
Python
Lines
20,155
Tests
711
Commits
50

The save file is the only source of truth

The failure mode of an LLM dungeon master is that it makes things up and then forgets them. Ask it what is in the chest twice and you get two answers, and neither one is binding on anything.

So the model here is a narrator and nothing else. Dice, rules, inventory, world generation and the passage of time are ordinary deterministic code writing to a structured save. The model reads that state and renders prose from it; it cannot introduce a fact, because facts only exist in the save.

Everything behind an interface

Rules, world generation and the world clock are each one module behind one interface, with a simple implementation in place and a more faithful one intended later. Swapping the rules engine does not touch the narrator, and swapping the narrator does not touch the rules.

The payoff is the playtest harness: because nothing except the prose depends on the model, the entire game can be driven end to end with no model attached. That is what makes 711 tests possible on a project whose output is meant to read like a story.