A web-app game that allows the player to start a new text-based RPG campaign. Inspired by old-school text adventures, TTRPGs (D&D), and point-and-click classics.
The core differentiator is the Living World Engine. A Game Master Agent (GMA) manages a sophisticated Narrative Graph—tracking relationships, plot fronts, and world states—to create a universe that reacts dynamically to every player decision. No two campaigns are alike, and the story never hits a generic "Game Over."
- Node.js 18+
- pnpm 8+
- Clone the repository:
git clone <repository-url> cd generative-deep-neural-dungeon
- Install dependencies:
pnpm install
- Set up environment:
cp .env.local.example .env.local # Add DATABASE_URL and AI Provider Keys (OpenRouter/OpenAI) - Database:
pnpm db:generate pnpm db:migrate
- Run:
pnpm dev
See docs/ARCHITECTURE.md for detailed architecture.
- docs/AGENTIC-ARCHITECTURE.md: Canonical reference for AI agent patterns, data contracts, execution models, and operational best practices
- docs/ARCHITECTURE.md: High-level system architecture and technology stack
- docs/STRUCTURE.md: Project directory structure and file organization guidelines
Feature requirements are located in docs/features/ (new FRED: docs/features/chat-agent-v6-refactor.md for the AI SDK v6 chat refactor).
Instead of simple genres, players define the Ontology of their world:
- Timeframe: Ancient, Medieval, Cyberpunk, Far Future.
- Magic & Physics: Hard Science vs. Dream Logic.
- Metaphysics: Do gods exist? Is the universe indifferent? The system generates a deep history, factions, and locations based on these axioms.
Characters are created within a specific Universe.
- Professions and Origins are context-aware (e.g., "Starship Pilot" only appears in Sci-Fi worlds).
- Classic D&D stats (Strength, Int, etc.) are rolled 1-20.
- Backstories are AI-assisted to weave the character into the world's history.
Campaigns are the "Play Session" of a Character in a Universe.
- Multi-Genre: Combine "Sci-Fi" + "Horror" for an "Alien" style game.
- Narrative Graph State:
- Knowledge Graph: Tracks NPCs, Relationships (
HATES,LOVES), and secrets. - Active Fronts: Plot threats that advance if ignored (e.g., "The Void expands").
- Narrative Vectors: Tracks abstract values like Hope vs. Despair, Order vs. Chaos.
- Knowledge Graph: Tracks NPCs, Relationships (
- Narrative: AI streams descriptive text via the Game Master Agent (GMA).
- Action: Player types flexible actions.
- Visuals: Generative images for scenes automatically generated by the Visual Engine Agent (VEA).
- Agentic Chat (AI SDK v6): Three-agent architecture:
- Game Master Agent (GMA): Interactive narration and HITL skill checks only (no state mutations)
- Campaign Manager Agent (CMA): Background state reconciliation (quests, fronts, narrative vectors)
- Visual Engine Agent (VEA): Background scene image generation
See docs/AGENTIC-ARCHITECTURE.md for detailed agent patterns and architecture.
Apache v2.0