Guide

Use AI to Generate a Complete Text Adventure Game

How to use ChatGPT or Claude with the Dungeon Mastron AI Companion to generate a complete, playable text adventure game — plus an honest look at AI's limits.

Here's a thing that genuinely wasn't possible a few years ago: you can describe a story idea to an AI, and ten minutes later be playing it — real choices, real branches, real endings — in your browser. Not a chat transcript that pretends to be a game, but an actual structured game file you can save, edit, and share.

This post explains exactly how the Dungeon Mastron AI Companion workflow works, and — because we'd rather be useful than hype-y — an honest accounting of what AI does well and badly when it writes interactive fiction.

The core idea: a template, not an app

The AI Companion isn't a chatbot we built, and it doesn't require an API key or a subscription to anything of ours. It's a carefully engineered prompt template. The workflow:

  1. Copy the template from the AI Companion page. It contains the full specification of Dungeon Mastron's game format, the structural rules of a good branching story, and instructions for the AI.
  2. Paste it into ChatGPT, Claude, or any capable LLM — whichever you already use and pay for (or use free).
  3. Describe your game. A premise, a tone, maybe a setting: "a melancholy mystery on an arctic research station, 20 scenes, three endings."
  4. Receive a complete game.json file. The AI writes every scene, every choice, every branch, in valid Dungeon Mastron format.
  5. Play it immediately in the Web Player — drop the file in and go. Or open it in the Visual Builder to see the whole branching map and start editing.

That's the whole trick. The template does the heavy lifting: it teaches the AI the format and, just as importantly, the craft rules — branch-and-merge structure, meaningful choices, consequence tracking — so what comes back is a game, not a linear story with decorative buttons.

Because the output is plain JSON, you own it completely. Hand-edit it, regenerate one branch, or rebuild half of it in the builder. There's no lock-in and no black box.

What AI is genuinely good at

What AI is honestly bad at

We'd be lying if we stopped at the previous section. Here's what you should expect to fix:

The workflow that actually works: AI drafts, you direct

After watching a lot of games get made this way, the pattern that produces things worth playing is:

  1. Generate the skeleton with AI. Get a complete, playable draft in one shot.
  2. Play it twice — once following your instincts, once deliberately choosing "wrong."
  3. Open it in the builder and look at the map. Prune fake choices, merge redundant scenes, add one branch the AI didn't dare to.
  4. Rewrite the scenes that matter by hand: the opening, every ending, and the two or three pivotal decision scenes. Maybe 20% of the text — the 20% that carries the whole game.

Think of the AI as an enthusiastic collaborator who types fast and never gets writer's block, but has read too many of the same books. You're the director. (If you'd rather build from scratch and skip AI entirely, our no-code tutorial covers that path.)

A design tip for your prompt

One instruction dramatically improves AI-generated games: tell it that failure should wound the story, not end it. Ask for branches where bad choices cost the player something they carry forward — an injury, a lost ally, a burned bridge — instead of "game over" screens. The Companion template bakes this philosophy in, and it's the single biggest difference between AI games that feel cheap and ones that feel authored. We wrote about why this works: Wounds, Not Death.

Where this goes next

Games made this way aren't stuck in a browser tab, either. Any game.json — AI-generated or handmade — runs on the DIY Raspberry Pi console, which is a strange and delightful thing: a story you described to a chatbot on Tuesday, playable on physical arcade buttons by the weekend.

Try it: grab the template on the AI Companion page, generate something, and play it in the Web Player. If your AI produces something wonderful or hilariously broken, we genuinely want to see it — share it on Discord.

Build your own story game

The Visual Builder is free, open source, and runs in your browser. No account needed.

Open the Visual Builder
← Back to all posts