A dungeon crawler where the rules are code and the story is written as you play.

Dice, combat, items and the map are handled by a small rules engine. A language model narrates each turn from those results and can't change them. Pick a class and a world and see how far you get.

Version 2.0.0 · MIT license · github.com/dguywhoknows/text-adventure-engine

The app itself, running inside this page. Anything you do here is saved in your browser.

Ask it to do things

Press Ctrl+K in the app (Cmd+K on a Mac) and describe what you want. The model chooses from the app's own functions, runs them in order and tells you what changed. Some examples:

Start a new run as a cautious rogueCreates the hero and begins the adventure.
Search the room, then go northSends both moves to the game engine in order.
Narrate everything like a noir detective storySaves a standing style for the narrator.

Instructions you save in the same box, such as "keep it short" or "I'm a beginner", are added to every AI request the app makes.

Features

Seeded procedural dungeons
Randomized-DFS maze with extra loops, BFS-based difficulty scaling.
Three worlds
Forgotten Crypt, Derelict Starship, Hollow Mansion.
D20 combat
With crits, AC, flee checks, traps, shrines, ambushes, leveling.
Inventory
With consumables (potions, firebombs) and passives (blade, shield, lantern, key).
Fog-of-war SVG minimap
Free-form actions
AI adjudicates as JSON, engine clamps HP/gold/damage to keep the game fair.
Streaming narration
With rolling story memory; autosave and resume.
Three hero classes
Warrior, Rogue, Mage) with distinct health, armor, attack, crit range and a cooldown-based ability (Second Wind, Backstab, Fireball.
Heroes page comparing class stats at level 1
And 5, including computed hit chances.
Bestiary page that fills
In as you defeat monsters, with kill counts and optional AI-written lore.

Runs in your browser

Dungeon generation, dice, combat, inventory, leveling, map, saves. None of this needs a network connection or a model.

Uses a language model for

Streaming narrator constrained to engine-provided facts (no invented loot or numbers). JSON adjudicator for free-form actions, sandboxed by engine-side clamping.

Notes

Cost
Free. Each account has a daily allowance of AI requests.
Your data
What you make stays in this browser on this device. Your account is only used for signing in and for the built-in AI. You can export a backup or clear everything from Settings.
AI access
Signed-in users get the built-in AI with nothing to set up. You can also use your own Groq or OpenRouter key under Settings.
Source
The code and tests are on GitHub under the MIT license. The tests also run in your browser.