What Is This
Chronicles of the Elder Realm is a solo high-fantasy text adventure powered by AI. You create a hero, get three AI-generated companions, and explore a procedurally generated world. An AI Dungeon Master narrates the story, runs combat, and reacts to everything you do.
The game is built with vanilla JavaScript, runs entirely in the browser, and is fully open source.
Play the Game
Note: You’ll need an API key from one of the supported AI providers (Anthropic Claude, OpenAI, Google Gemini, or xAI Grok) to play. Enter it in the game’s Settings screen. Your key stays in your browser and is never sent anywhere except the AI provider.
Features
- AI Dungeon Master that narrates, reacts, and drives the story
- Party of four — you control one hero, three AI companions join you
- Procedural maps — world and location maps generated from seeds
- D&D 5e mechanics — dice rolls, combat, HP, XP, leveling
- Inventory and quests — items, quest journal, lore entries
- Save/load — auto-saves to browser storage, export/import JSON saves
- Multiple AI providers — Claude, GPT, Gemini, Grok
- No server needed — everything runs client-side
How It Works
The game sends your actions to an AI model along with the current game state. The AI responds with narrative prose and structured game updates (HP changes, new items, location moves, combat events). Everything is parsed and rendered in real-time.
All game state lives in your browser’s localStorage. You can export a full save as JSON or download your story as a readable markdown file.
Source Code
The game is open source and available on GitHub: newrealmco/elder_realm
No build step, no dependencies, no framework. Just vanilla JavaScript and ES modules.