A text adventure game engine built first, with plans to generate content later. The game is free and open source software (FOSS).
When I was a kid, I wrote a game called Whacker where it was a Rogue vs. a Freeport Guard. It was text only and the user would start the fight and the two would go at it, whacking each other until one won. This is a modern engine inspired by that idea.
Requires Node.js.
# Install dependencies
npm install
# Run the demo (a sample combat between a Fighter and a Goblin)
npm run demoThe demo runs a turn-by-turn combat with a 6-second pause between rounds so you can watch the action unfold.
D&D 2024 under the System Reference Document (SRD 5.2) / CC-BY-4.0
- CC-BY-4.0 is simpler — one attribution paragraph, no "Open Game Content" / "Product Identity" distinction, no full license text reproduction required
- CC-BY-4.0 is not viral — downstream users can license their own work however they want
- CC-BY-4.0 is irrevocable by design — survived the 2023 OGL deauthorization attempt through its own structure
- SRD 5.2 has more content — weapon mastery, expanded rules glossary, exploration mechanics, additional species (Goliath), additional backgrounds (Criminal, Sage, Soldier)
- SRD 5.2 aligns with 2024/5.5e rules — the current direction of D&D
- 12 core classes with subclasses
- 7 species (Dwarf, Elf, Halfling, Human, Goliath, and more)
- 6 backgrounds (including Criminal, Sage, Soldier)
- All core spells through 5th level
- Monster manual subset (100+ monsters)
- Full combat rules, ability checks, saving throws
- Weapon mastery mechanics
- Exploration mechanics
- Rules glossary
- Equipment, magic items, conditions
- Additional classes/races beyond the SRD
- Campaign-specific content
- Custom monsters and NPCs
- Adventure modules
├── main.ts # Game loop
├── llm.ts # OpenRouter client wrapper (future)
├── game_state.ts # World state, inventory, history
├── prompts.ts # System prompt templates (future)
├── summarizer.ts # Context compression (future)
The project is split into two layers:
- Engine — a content-agnostic game engine (MIT licensed). Handles combat resolution, character state, dice, and event emission.
- Game content — data and content that plugs into the engine. Lives in clearly marked directories.
This separation means the engine can be extracted into its own package/repo independently of any game content.
| Layer | License | File |
|---|---|---|
| Code (engine + game code) | MIT | LICENSE |
| SRD 5.2 game content | CC-BY-4.0 | LICENSE (attribution section) |
| Original game content | CC-BY-4.0 | LICENSE (declared) |
Game mechanics (ability scores, AC, HP, attack rolls) are not copyrightable. SRD 5.2 content is used under CC-BY-4.0. Original content created for this project is released under CC-BY-4.0.
- Build the engine first — no AI dependency for core gameplay
- Use SRD 5.2 as the mechanical foundation
- Design for AI content injection later (monsters, NPCs, quests, items)
- Keep it FOSS and community-friendly
- Maintain clean separation between engine code and game content