Every dice roll, HP calculation, spell slot, and combat turn is resolved by TypeScript before the AI sees it. The AI receives the outcome and writes the story around something it had no part in deciding.
This separation is the entire architecture. It determines what the game can do, what it costs, and why it works when other AI RPGs do not.
Most AI RPG products give the language model authority over game state. The AI rolls the dice, tracks the HP, manages inventory, decides whether your spell worked. Language models are bad at these jobs.
They lose track of numbers across turns, apply modifiers inconsistently, forget which NPCs are alive, and hallucinate outcomes that contradict what already happened. These failures are architectural. No prompt engineering, memory system, or model upgrade fixes them permanently because the problem is what the AI has been asked to do, not how well it does it.
In Chronicles of Terros, the AI is never asked to do those jobs. Code does them. The AI writes prose about resolved facts.
Deterministic systems that must produce the same answer every time. No language model involved.
Combat runs as a state machine. Initiative is a sorted queue. Attacks resolve through code with real dice rolls, computed modifiers, and damage applied to code-owned HP fields. When a combatant reaches 0 HP, code removes them. The AI cannot keep a dead enemy alive or kill a player through narrative.
The spell’s level is checked against available slots, the slot is decremented, the attack roll or saving throw is computed per target, and damage or conditions are applied. All in code, before the AI generates a word. Cantrips scale by character level through a codified table. Upcasting consumes the correct higher slot. If no slot is available, code rejects the cast.
Inventory, currency, and equipment are typed fields with separate mutation paths. Gold cannot overwrite experience points. Equipped items occupy specific body slots: head, chest, legs, feet, hands, cloak, neck, back, two ring slots, main hand, off hand, shield. Combat bonuses from magic items feed into the attack and AC math at combat start.
The AI writes placeholder tokens during generation, and a post-generation resolver replaces them with canonical names. The AI cannot rename an NPC because it never chooses the name.
Level, XP, class features, and proficiency bonus are mutated only through the level-up code path. No AI output can write to these fields.
Prose generation around outcomes it had no part in deciding.
The AI generates the text you read. It describes the scene after a skill check resolves, narrates the consequence of a combat turn the code already computed, and voices NPCs whose identities and states are managed by code.
Multiple AI systems run in parallel, each with a scoped job: one manages the story arc, one drives companion behaviour, one orchestrates the session. None of them touch game state. They coordinate through the code layer, which is the single source of truth for everything mechanical.
Fourteen handcrafted companions have independent relationship mechanics where trust, affection, and respect track separately. A companion can trust your judgment without liking you. They disagree with your choices, interject mid-scene, and take independent action when their values conflict with yours. The companion AI generates this behaviour. It does not decide whether the companion is present, alive, or mechanically effective. Code does.
When code handles state, per-turn AI cost is bounded. The AI runs once for narrative, conditionally for companion reactions, and occasionally for classification tasks with tiny token budgets. No feature addition creates unbounded AI calls.
That bounded cost is why Chronicles of Terros is a one-time purchase, not a monthly subscription. The AI has a scoped job with a predictable cost ceiling. There is no credit system, no per-message charge, and no scenario where you pay to correct the game’s own errors.
The architecture behind the game, explained for people arriving from search.
AI dungeon masters forget because they hold authority over game state. Bigger context windows and retrieval systems don't fix the root problem. Code-owned state does.
Dice rolls, HP, AC, modifiers, and initiative belong in code. Here's what breaks when the language model does the arithmetic instead.
A survey of current options — ChatGPT, AI Dungeon, dedicated AI RPG platforms, and solo toolkits — and where each one breaks.
Nine months of building, one architectural decision, and every bug that revealed it was the right call.
Five episodes free. No card required.