Skip to content

Jonwhitefang.uk

Stardate 2026.244 · systems nominal
All log entries
Software01 September 2026

The dungeon master isn't the hard part

I set out, a little over a year ago, to build an artificial dungeon master for my family: a computer that could run a proper tabletop roleplaying campaign, voice every innkeeper and goblin, describe the world and react to whatever a table full of excitable people decided to do to it. This is the first entry in what I expect to be a long series about that project, and I should get the embarrassing part out of the way immediately. A year in, the artificial dungeon master cannot yet tell you a story. The one component the entire thing is named after is the one component I haven't built. What I've built instead is everything underneath it, and the genuinely surprising lesson of the year is that the storyteller was never the hard part.

The idea, in plain terms, is a private app that lets a household sit down together and play the kind of Dungeons-and-Dragons-style game where one person normally has to be the narrator, except the narrator is the machine. The players are the family; the dungeon master is the software. If that were all it was, it would be a chatbot in a funny hat, and those already exist. The part that makes it worth a year of evenings is a rule I decided on early and have refused to bend since: the AI is not in charge of the rules, and it is not in charge of the world's memory. A separate, entirely deterministic game engine owns the dice, the arithmetic, the map, your hit points, who is carrying which sword, and everything that has ever happened in the campaign. The AI proposes; the engine decides and records. The story the AI tells is a description of what the engine actually did, never the other way around.

It's built for the long haul, too: the sort of campaign that runs for months or years, where the world still remembers the bridge you burned down six sessions ago long after that particular conversation has scrolled out of anyone's memory, machine or otherwise. For the rules-lawyers reading: it's built on the open SRD, the freely licensed slice of fifth-edition rules, so it's D&D-shaped rather than official D&D, and there's no company, no logo, no store page. It's one person's build for one household, and I mention that mostly so nobody thinks I'm about to try and sell them something.

The reason any of this exists is that running a tabletop game by hand, for your own family, is wonderful and completely relentless. One person, in practice a parent, has to prepare the adventure, play every character, remember every rule, track every hit point, adjudicate every hopeful 'can I try to…', and, crucially, never actually gets to play. They are the one member of the table permanently stuck behind the screen. The entire premise of the project is a faintly selfish one dressed up as generosity: what if the tireless, bookkeeping, voice-of-the-world part could be handled well enough that everyone at the table, the usual dungeon master included, got to be a player for once.

The obvious objection, the one I get within about nine seconds of describing this to anyone technical, is: why not just use ChatGPT? And off-the-shelf AI models are genuinely superb at the improvising half of this. They are also hopeless bookkeepers, and I mean that as a description rather than an insult. Ask a general-purpose model to run a long campaign and it will cheerfully forget what's in your backpack, contradict something it told you last week, quietly fudge a dice roll because the story reads better if you succeed, and invent a rule on the spot when it can't remember the real one. For a one-off evening of make-believe that is completely fine, and often delightful. For a persistent, fair game that a family is going to pour months of genuine investment into, it is disqualifying. You cannot build that kind of attachment on top of a narrator that quietly rewrites history whenever it's convenient.

The other objection is the one I take more seriously than any feature, which is that handing a child an open-ended generative storyteller is exactly the thing a thoughtful parent should be nervous about. The children this is ultimately for (the design aims at ages seven and up) are the entire point and also the entire risk. An off-the-shelf model gives you no reliable, auditable boundary you can actually trust around a seven-year-old; you get a polite request buried in an instruction somewhere and a hope that it holds. That isn't good enough, and so the whole architecture is bent around turning safety from a request into an enforced constraint. I'll come back to how, because it's the part I'm proudest of and it deserves its own entry, but it's worth saying up front that it's the reason the thing is being built in the deeply unglamorous order it is.

When it does work, and I want to describe the destination because it's what keeps me soldering the boring bits, a session should feel like this. Two to six of you, each on a tablet, in the same room, because this is meant to be a social evening and not several people staring silently into separate screens. The game recaps where you left off, sets a scene, and you play: you can type or simply speak what your character says or does, pick one of the actions it offers you, or try something gloriously unlisted, like climbing the chandelier, and the world reacts. When something actually has stakes (a fight, a risky climb, a bare-faced lie to a suspicious guard) the game shows you the odds, asks you to confirm before anything happens, rolls the dice in the open where everyone can see them, and then tells the story that honestly follows from the roll. Nobody's luck is quietly improved to keep the plot tidy.

One adult is the campaign owner, who sets the tone, can pause or overrule anything, and pointedly cannot peek at whatever the game has planned for later; no reading ahead to the last page. Before a campaign starts there's a session zero, the tabletop tradition of agreeing as a group what everyone is and isn't comfortable with, wired in as an actual step rather than a good intention. The youngest players get plain language, pictures, and narration read aloud; the adults get the full auditable detail underneath if they want it. That's the vision. Here's where it actually is.

The half that exists today is the half nobody would put in a trailer. There is a deterministic game engine, genuinely built and tested, that rolls dice with committed, replayable randomness, meaning you can play the same sequence twice and get exactly the same result, which sounds like a party trick until you realise it's what lets you prove the game never cheated. It handles combat, encounters, the geometry of a tactical grid, and the state of every character. Underneath all of it is an append-only event journal: the entire history of a campaign as an immutable, replayable ledger, so the world isn't a save file you overwrite but a list of everything that ever happened, from which the present can be rebuilt at any time.

That same principle runs through how the world is remembered. Everything is stored as structured, versioned facts rather than as chat text, and a correction is never an edit; it's a new event laid on top, so you physically cannot quietly rewrite the past even if you wanted to. There are adult accounts with the unglamorous-but-essential plumbing of proper password hashing and session handling, and a central privacy layer that decides who is allowed to see what, enforced in exactly one place in the code and tested with a small suite of deliberately hostile 'now try to leak it' tests. And there's a large and steadily growing catalogue of rules content (conditions, class features, weapons, armour, the entire adventuring-gear shop) ingested from the open SRD and turned into strongly typed, machine-checkable records with a digest that screams if a single one changes behind its back. Recent evenings have mostly been me and a fleet of agents grinding through that catalogue one item at a time, which is exactly as thrilling as it sounds and exactly as necessary.

What all of that adds up to is a table that works perfectly and has nobody sitting at it telling a story. The artificial dungeon master itself (the language model that will read 'I sneak past the guard', turn it into a move the engine understands, and narrate whatever the engine says happened) is the next major stage, and it is not built. I've run a single research spike to check the core assumption isn't nonsense: can a current top-tier model reliably turn a sentence of a player's intent into a valid, structured action the engine will accept? The answer came back promising. But a promising spike is a long way from a dungeon master, and I'd rather say that plainly than imply I'm further along than I am. The honest one-line summary of the whole project, right now, is this: it can't yet tell you a story, but it already refuses to lie to you, and it turned out that refusing to lie was the hard part.

There's a single idea holding all of this together, and it's the thing I'd most like you to take away from a first entry, because the rest of the series is really just this sentence examined from different angles. The world is canonical; the narration is a projection of it. All of the truth lives in the structured data (the engine's ledger of what is actually true) and the AI's lovely prose is generated afterwards, as a description of a decision that has already been made and recorded. The loop, when it exists, will run in a fixed order: understand what the player meant, propose an action, validate it against the rules, resolve it, commit the result to the ledger, and only then narrate. The AI owns the first step and the last one. The deterministic engine owns everything load-bearing in between. Language models propose; deterministic systems decide. Nearly every hard decision I've made on this project falls out of that one rule.

It shapes the unglamorous choices too. I haven't committed to a specific AI model yet, and when I do, the two things that will decide it are not what tops a benchmark this month. They're whether the data is processed in the UK or EU, and whether there's a genuine guarantee that my family's game is never used to train anybody's model. Those matter more to me than a few points of cleverness. The whole thing runs, for now, locally on a single machine, with no cloud involved at all, and the plan for when the AI arrives is deliberately modest: one account, one UK or EU region, encrypted backups, the ability to wind the clock back if something goes wrong. It is emphatically not a sprawling homelab empire, and I say that as someone who very much enjoys building sprawling homelab empires and had to actively resist the urge.

The safety story deserves that promised separate entry, but here's the shape of it, because it explains the order of everything else. You do not keep a child safe by asking the AI nicely, in its instructions, to behave. You check every message going to or from a child in code, before it is ever shown, and you keep a sealed record that it happened. More to the point, the system is fail-closed by schedule: the builds today contain no child capability whatsoever. There are no child profiles, no way for a child to join, and there won't be until the very first thing built in the family stage is the safety machinery itself (the profiles, the gateway that screens every message, the owner's pause button) proven to work before a single child account can exist. There's a rule I'm fond of that captures the spirit: at any table, the most cautious person present sets the content boundary for everyone, and the system never reveals whose caution it was. Nobody gets quietly blamed for the game being gentler than they'd personally have chosen.

If you're wondering why I'd build a dungeon master and leave the dungeon master till last, that ordering is the whole discipline of the project, and it doubles neatly as the map for this series. The rule I hold myself to is that the boring, correctness-and-safety-critical foundations come first and the magic comes last: the engine before any AI, the rules before any narration, the privacy tests before any private data, plain text before voice, and synthetic, made-up data before a single real detail of my actual family goes anywhere near it. The foundations (dice, geometry, the event journal, replay) are done and green. The current stage is a deliberately AI-free version you could genuinely play by passing a tablet round the table, hot-seat style, adults only, which exists to prove the accounts, the privacy, and the game state all hold up before there's a language model in the loop to blame things on. After that comes the AI dungeon master itself; then a stage whose entire job is to prove you can put a campaign down for a week and pick it up with zero contradictions; and only then the family layer, safety machinery first. Each of those is a future entry, roughly one per stage.

A word on how the thing is actually made, because it's nearly as odd as what it is. The team is one person (me) plus a rotating crew of AI coding agents, working under a rule that every change, without exception, gets an independent adversarial review by a different AI before it's allowed anywhere near the main line. One machine writes; a second, with no stake in the first one's ego, tries to tear it apart. It is the single best process decision I've made, and it is also the source of most of the comedy, which brings me to the part I've been looking forward to.

Because nobody has actually played this yet (that's the honest truth, and I'd rather tell you than dress it up) there are no war stories from the table. There are, however, a great many war stories from the workshop, and they're better than I expected. My favourite is the bug that keeps closing its own report. The project automatically marks a task as finished when a change description says the magic word 'closes' followed by the task's number, which is a lovely convenience right up until an agent writes a warning note explaining this exact footgun, includes the offending phrase in the warning itself, and thereby closes the very task the warning is filed under. This has now happened three separate times. There is a tool that scans every change specifically to prevent it, and that tool exists because the warning about the problem triggered the problem.

A close second is the day we learned the difference between counting and measuring. Early on, the design carefully listed twenty-one places where a secret might conceivably leak out of the system, a thorough-looking list, the kind you feel good about. Later, someone got tired of trusting the list and actually measured it, and the real number of exposed points was one thousand seven hundred and twenty-eight. Hiding in the gap between the twenty-one we'd imagined and the seventeen hundred we hadn't were three separate routes to a piece of data that was supposed to be sealed away entirely. The lesson, which I have since had all but tattooed on my professional conscience, is that a hand-written list of everywhere something could go wrong is not a measurement of anything. It's a list of the places you happened to think of.

The adversarial review turns up its own strange comedy. One design document went through sixteen rounds of the stuff, and something like half the problems the reviewer found were the document contradicting its own earlier paragraphs, a specification quietly arguing with itself while I refereed. And my current favourite in the you-cannot-make-this-up category: a recent change added some tidy-up code to smarten the display of prices, the 'one thousand gold pieces' sort of thing, and the tidy-up was, without anyone noticing, hiding a genuinely broken entry from every check that should have caught it. We only found it because a reviewer was told to assume a bug existed and go hunting, and it did. I had, in effect, built a helper so conscientious it started covering up crimes.

None of these are gameplay stories, and that's rather the point of this whole first entry: I'm writing a build diary for a project whose headline feature doesn't exist yet, and I think that's a more honest and more interesting place to start than pretending otherwise. The plan is running late, incidentally, in the way real plans do: the current stage is taking close to twice as long as I first budgeted for it, and I know that precisely because I write the estimates down and then let reality mark my homework. The difference between this project and most of my others is that the marking is done by something that does not care about my feelings.

So that's where we are: a dungeon master that can keep perfect faith with the truth and cannot yet say a single interesting thing. The next entry goes deep on the idea at the centre of all this, why the AI is not allowed to run the rules and exactly how it's stopped from trying, because once that clicks, the rest of the series makes sense. One promise to end on, and it's the one that matters most: no real child will ever appear on this blog. Everything you read here runs on invented, synthetic data, adults only, until the safety machinery is built and proven, and even then the children stay off the page. As for the storyteller itself: it can't tell you a story yet. Ask me again in a few months, and if I've done the boring parts properly, the first thing it says still won't be a lie.