Make a Dungeon Crawler With AI, One Floor at a Time
A dungeon crawler sends you room by room through a dangerous place, spending supplies as you go, so build one hand-made floor where exploring costs something. Give it a locked door, a trap and a light that runs out, and have your AI check that every route stays winnable.
What keeps a dungeon interesting?
The question "do I press on or turn back?". Without it, exploring is just walking.
Say three mapmakers are surveying an abandoned salt mine, one square at a time. Their lamp oil burns down with every step. Each new room might hold salt worth selling, a lost survey book or a collapsing floor. They have enough oil to get home, or to see one more room. That small sum, done again and again in the player's head, is the whole genre.
This also marks the difference from a roguelike. There, the world is new each run. Here the mine stays the same, and what you learn about it carries over. So a map that fills itself in as you walk is one of your most important features.
What is the smallest floor worth playing?
Five rooms, about ten minutes of play:
| Room | What it holds | Why it exists |
|---|---|---|
| Shaft | The way out | Home, and the thing to get back to |
| Salt hall | Treasure, in plain view | Tempts you onward |
| Sump | A hidden pit with a warning sign | Teaches you to read the walls |
| Foreman's office | A key, a turn-based fight | Pays for the risk |
| Locked store | The survey book | The goal |
Notice the last column. Every room has a job. If you cannot fill in that column, the room should not exist.
Which piece comes next?
Walking on a grid comes first, with the map drawing itself. Then the oil, because it turns walking into a decision. Next the door and key, then the trap with its warning. Fights follow, then loot and a small inventory for carrying it home. Selling what you found and returning with more oil closes the loop. Only then begin a second floor.
What sinks a dungeon crawler?
Filler. Your AI can generate forty rooms before lunch, and they will all be corridors with a chest and a rat. Nothing makes a dungeon duller, and the size hides the fact that nobody decided anything.
Dungeons can also seal themselves. A hand-built floor with keys and quests can put a key behind its own door, or let the player use up the only way out. Those faults hide in the order you do things, so careful writing will not find them. The prompt below hands that job to a program.
Paste this to your AI
Build a small dungeon crawler: one hand-made floor of five rooms on a grid, one locked door and its key, one trap, one turn-based fight, and lamp oil that runs down with every step.
First draw the core loop as a state machine in a Mermaid diagram: step, look, trap or fight or find, spend oil, press on or turn back, leave. Say what happens when the oil hits zero in the middle of a fight. Build from it once that is settled.
Model the floor as facts (who is alive, who holds what, which doors are open, how much oil is left), each step with its needs and effects, and two rules: the key is never behind its own door, and the way out stays reachable. Run TLA+ and the TLC model checker across every path, or use get_recipe story-model-check if Spielerando is connected. Hand me the exact rooms, in order, for any path that breaks a rule. Keep the model to yourself.
When you say a note or quest fits the mine, quote where that fact is written. If it is written nowhere, say you do not know.
Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP
What comes back is a plain walk through the rooms, and you never read anything else. The recipe needs an MCP connection plus a sign-in with Google or e-mail, which costs nothing, and it does not look at your game.
How to check it worked
- Run out of oil. Keep walking until it is gone. Something should happen, and you should have seen it coming.
- Reach the door with no key. The game should make you want the key, and hint at where to look.
- Fall in the pit. Was the warning there, if you had looked?
- Ask why a room exists. Point at any room. If nobody can say, cut it.