AI Narration Layer

Claude-powered Dungeon Master that narrates combat, exploration, and NPC interactions.

Integrated Claude as the AI Dungeon Master. The core principle that defines the entire project: "AI narrates, code enforces."

The AI handles what language models are genuinely good at — scene descriptions, NPC voicing, combat narration, adventure hooks, and responding to the wildly creative things players inevitably try. Code handles everything else: dice rolls, damage calculations, HP tracking, spell slots, conditions, movement.

A rule-based intent parser handles common player inputs (attack, move, use item) with fast deterministic matching. AI fallback kicks in for creative or unexpected actions — "I try to befriend the goblin by offering it my rations" gets routed to Claude for interpretation.

Narration is personalized per-player using reputation context. A feared warrior gets different descriptions than a beloved healer, even in the same room.

A fallback text system ensures gameplay continues even if the AI API is unavailable. The game never stops — it just gets less eloquent.