QuestLine
2026-02-28Design document for an async AI-powered RPG played in a chat-style web interface. An AI Game Master runs the game โ no apps to install, no rulebooks. Share a link, open your browser, and play. A Corn Collective production.
๐ Project Status โ Feb 28, 2026
Last updated: February 28, 2026
Decisions Made
- Platform: Web-first (chat UI in browser). Signal adapter for internal playtesting. Discord/Telegram planned.
- Ruleset: Fully original custom system designed for AI DM + async multiplayer chat. Not D&D 5e, not ICRPG.
- Two game modes, one engine: Quick Play (tactical roguelike, 30โ60 min) and Campaign (persistent world, async over weeks/months).
- Build order: Quick Play first (faster feedback loops, tests core mechanics), Campaign second (the market differentiator).
- Full Quick Play rulebook published: cleo.computer/questline-quickplay.html
Core Mechanics at a Glance
- 4 stats: Might, Finesse, Wits, Presence (each 0 to +3)
- No classes โ 6 Backgrounds + 12 mix-and-match Talents
- Room Target Number: one TN per encounter, d20+mod to beat it
- 2 actions per turn, effort dice for damage (d4/d6/d8/d10)
- Mana pool for magic, 20 spells with original names
- 10 inventory slots, HP 15โ20 range, 3โ4 round fights
Campaign Mode Highlights (Planned)
- XP bar: continuous XP from actions โ fills bar โ AI DM privately sends 3 upgrade choices
- Whisper mechanic: DM sends private messages to individual players โ secrets, temptations, conflicting intel
- The pitch: "play D&D with your friends without scheduling a 4-hour session"
Competitive Landscape
- AI Dungeon: solo, no real mechanics, narrative sandbox
- AI Game Master: mobile, solo, structured quests
- Friends & Fables: Discord, 5e, synchronous multiplayer only
- Our gap: zero-install web app with chat UI feel + async multiplayer + real game mechanics + friend-group native + whisper mechanic. Everyone has a browser โ no app to install, no account on a specific platform. Share a link and play.
Team
- Corn Collective designs the game (rules, mechanics, balance)
- Sean + Cleo build it (code, AI, infrastructure)
QuestLine: Async AI RPG
Design Document โ Corn Collective
February 28, 2026
1. Concept
An AI-powered multiplayer RPG that runs in a chat-style web interface. Players type what they want to do in natural language. An AI Game Master narrates the story, enforces rules, rolls dice, and manages combat. No apps to install, no rulebooks to read, no 4-hour sessions to schedule. Open a link in your browser and play โ it looks and feels like a messaging app, because everyone has a browser but not everyone has this or that chat app.
Web-first, with an adapter pattern for alternate transports. Signal adapter available for internal dogfooding (the infra already exists). Discord and Telegram adapters planned. The game engine is platform-agnostic โ the web UI is just the primary way in.
The killer insight: the hardest part of D&D isn't the rules โ it's getting 5 adults in the same room at the same time. QuestLine solves this by making the game async and the DM an AI. The second insight: everyone has a browser. Zero-install, share a link, you're in.
2. Game System
A fully original ruleset designed specifically for AI DM + async multiplayer in a chat interface. Optimized for brevity, clarity, and text-based play. Every mechanic was chosen to minimize the number of messages needed per encounter while maximizing tactical depth.
๐ Full Quick Play rulebook โ
Stats & Characters
- 4 stats: Might, Finesse, Wits, Presence โ each starts at 0 to +3
- No classes. Instead: 6 Backgrounds (Soldier, Rogue, Scholar, Mystic, Ranger, Bard) that set starting stats and flavor
- 12 Talents at launch โ mix-and-match abilities that customize your character. Acquired during character creation and as upgrades
- Character creation: 5 scenario-based questions โ AI generates a character from your answers. No menus, no stat allocation. Your personality shapes your character.
Core Resolution
- Room Target Number (TN): every encounter has one target number. Roll d20 + stat modifier to beat it. Simple, clean, one number for the AI to track.
- 2 actions per turn: move + act, or act + act. Keeps turns tight in chat.
- Effort dice for damage: d4 (basic) / d6 (weapon) / d8 (magic) / d10 (ultimate). Roll effort when you succeed โ this is how you wear down the encounter.
Combat & Resources
- HP 15โ20 range. Fights are 3โ4 rounds. High consequence, fast resolution.
- Mana pool for spellcasters. 20 spells, each described in one sentence, all with original names (Fireball โ Inferno, Lightning Bolt โ Thunderstrike, Sneak Attack โ Backstab).
- 10 inventory slots. Forces meaningful choices about what to carry.
Design Philosophy
3โ4 high-consequence rounds beat 12 low-stakes rounds. Room target as single progress bar is perfect for chat UI. โ Don Piano
3. Two Game Modes, One Engine
Same core ruleset, same game engine. The mode toggle changes the AI DM's behavior, session structure, and progression system.
Quick Play โ Build First
Tactical roguelike dungeon crawl. 30โ60 minute sessions. Characters don't persist.
- 3โ5 encounters with escalating difficulty, boss climax
- Roguelike progression: after each encounter, pick 1 of 3 random upgrades (new talent, +1 stat, new spell, special item, +3 HP, +2 mana)
- Emoji tile maps for spatial awareness
- Fast to play, easy to restart, tests every mechanic
Campaign Mode โ Build Second (Market Differentiator)
Persistent world. Async over weeks or months. Play on your schedule.
- Persistent world state, NPC memory, cascading consequences
- Character death is real, no take-backs
- XP bar system for continuous progression (see below)
- Whisper mechanic for secret player communication (see below)
- AI-generated story summaries and "Previously on..." recaps
Campaign mode fills the gap nobody else has: async multiplayer + real game mechanics + friend-group native + zero-install web UI. Every competitor is either solo, synchronous-only, or lacks real mechanics.
4. XP Bar System
A continuous experience meter that fills from in-game actions. Inspired by VS/fighting game super meters โ always building, always visible, always one more action away from filling.
| Action | XP Gained |
|---|---|
| Successful check | +1 |
| Deal damage | +1 |
| Critical hit | +2 |
| Clever RP / creative solution | +1 |
| Complete objective | +2 |
When the bar fills: the AI DM privately messages the player with 3 random upgrade choices. The private level-up message is the push notification that brings async players back. It's an engagement hook disguised as a game mechanic.
- 10 XP to first level, +2 each subsequent level
- Upgrades can arrive mid-encounter โ you don't have to wait for a clean break
- In Quick Play: upgrades also happen between encounters (roguelike style)
- In Campaign: the XP bar is the primary progression system, layered with milestone moments
5. Whisper Mechanic (Campaign Mode)
The DM sends private "inner monologue" messages to individual players โ via the web UI's private channel or via platform DM on adapters. Secret motives, visions, temptations, conflicting intel โ creating natural party tension without anyone knowing who got what message.
Two-Channel Design
- Group thread: all public gameplay โ combat, exploration, dialogue, recaps
- Player whispers: private messages from the AI DM โ supplements, not requirements
Examples
- "You sense the artifact is cursed โ but it's the only weapon strong enough to kill the warden." (knowledge asymmetry)
- "+2 damage on your next attack if you let the prisoner escape." (temptation buff)
- Player A is told an NPC is trustworthy. Player B is told the same NPC is lying. (conflicting intel)
- Character arc nudges based on player behavior patterns
Design Rules
- Whispers never deadlock the game. They add color and tension, but the group game moves forward regardless.
- Not every player gets a whisper every session. End-of-session review determines who gets one.
- Should work even if players screenshot and share their whispers. The value is in the choice to share, not enforced secrecy.
Catch-Up Flow
DM posts "Previously on..." recap in the group thread. Players check their whispers. Play resumes. Async naturally enforces no-metagaming โ you can't read faces around a table in a chat.
Why async-first matters: players check their phone between sessions, find a whisper that changes how they approach the next session. Engagement between games = retention hook. No other TTRPG platform does this.
6. Architecture
High-Level Flow
Player sends message in web chat UI (primary)
โ or via Signal/Discord/Telegram adapter โ
โ
WebSocket server / adapter receives message
โ
Game engine identifies player + session
โ
Load game state from PostgreSQL
โ
Build AI prompt: system prompt + state + history + action
โ
Claude API generates narration + structured state updates
โ
Validate state update JSON, apply to database
โ
Push response to web UI via WebSocket
(+ optional whisper to individual players)
(+ mirror to Signal/Discord if adapter connected)
Adapter Pattern
The game engine is platform-agnostic. Transport adapters handle platform-specific I/O. The web chat UI is the primary interface โ our own frontend that looks and feels like a messaging app. Signal adapter is secondary, used for internal playtesting since the infra already exists. Discord and Telegram adapters are planned.
Each adapter implements: parse incoming messages into a standard format, send messages (group and whisper), and handle platform-specific quirks (message length limits, media, reactions). The abstract adapter interface keeps the engine clean โ adding a new platform means writing one adapter module, not touching the game engine.
Web Frontend
The primary interface is a browser-based chat UI โ designed to retain the look and feel of a mobile messaging app. Options under consideration:
- HTMX + SSE: server-rendered, no build step, simplest path. Good enough for chat.
- React or Svelte + WebSocket: richer interactivity, better for real-time updates, maps, animations.
- PWA support: service worker for offline capability, installable on mobile home screen for native app feel.
- Push notifications: browser Notification API + service workers. "Your XP bar is full โ choose an upgrade" as a push notification brings players back.
The web UI handles: group chat thread, private whisper channel per player, character sheet sidebar, emoji tile maps, typing indicators, and read receipts. It's a messaging app that happens to be an RPG.
Tech Stack
| Layer | Choice | Rationale |
|---|---|---|
| Web Frontend | HTMX + SSE or Svelte + WebSocket | Chat UI in browser โ zero install, PWA-capable |
| Backend | Python 3.12 + FastAPI | Async-native, WebSocket support, Claude SDK is Python-first |
| Real-time | WebSocket (FastAPI native) | Bidirectional, low-latency chat messages |
| Database | PostgreSQL 16 | JSONB for game state, reliable, mature |
| AI Engine | Claude (Anthropic) | Best cost/quality for creative + structured output |
| Signal Adapter | signal-cli | Internal playtesting, infra already built |
| Image Gen | Gemini / DALL-E 3 | Character portraits, scene art |
| ORM | SQLAlchemy 2.0 + Alembic | Async support, mature migrations |
| Hosting | Self-hosted / VPS | WebSocket server needs persistent process |
7. AI Game Engine
Prompt Structure
Each AI call includes: the system prompt defining the DM's role and rules, the current game state (world, NPCs, environment), all active character sheets, a rolling story summary, and the last ~20 messages for immediate context.
The AI responds with narration for the group chat, plus a structured JSON state update block that includes character changes (HP, inventory, status effects), world changes (NPC states, environment flags), story beat summaries, and turn-order guidance.
State Management
Game state is a JSONB document per session/campaign, updated after every turn. Includes: current location, active NPCs with dispositions, plot threads with statuses, environment details, turn count, and whose turn feels natural next.
All state updates come as structured JSON from the AI, validated before being applied to the database. This is the primary guardrail against AI hallucination and contradiction.
Context Window Management
- System prompt + current state + character sheets (~2K tokens)
- Last 20 messages verbatim (~2K tokens)
- Rolling story summary, rewritten by the AI every 10 turns (~500 tokens)
- Total input: ~4โ5K tokens per call โ well within limits, affordable at scale
Multi-Player Async Handling
- Players can message at any time โ async, not strictly turn-based
- The AI determines narrative flow and prompts the next natural actor
- Inactive player nudges after configurable timeout
- AI gracefully writes out characters whose players go inactive
8. Key Challenges
Hard problems we know about and our current thinking on each.
LLMs have finite context windows. Long campaigns can't rely on stuffing every message into the prompt. Solution: structured game state documents (JSONB) as the source of truth, rolling AI-generated summaries every N turns, and aggressive context pruning. The game state doc, not the AI's "memory," is canonical.
The web frontend needs to feel like a real messaging app โ instant message delivery, typing indicators, smooth scrolling, mobile-responsive. WebSocket reliability matters: reconnection logic, message ordering guarantees, handling flaky mobile connections. PWA install + push notifications close the gap with native apps. If the chat UI feels janky, the game feels janky.
When does the DM send whispers? Not every player, not every session. Current approach: end-of-session review where the AI evaluates which players' actions warrant a whisper, what plot threads need development, and which character arcs could use a nudge. Whispers are supplements โ the game must work without them.
The AI may contradict earlier whispers or established facts. The game state document is the guardrail. Every whisper gets logged, every state change is validated JSON. When the AI generates narration, it references the state doc, not its own prior outputs. Structured output format forces discipline.
Some players check constantly; others ghost for days. The system can't make engaged players overpowered or disengaged players irrelevant. XP gains are bounded per encounter. AI writes inactive characters as "present but cautious" rather than removing them. Catch-up recaps keep returning players oriented.
Players might screenshot their whispers and share them. The design should work even if they do โ the value is in the choice to share, not in enforced secrecy. Whispers that create interesting dilemmas are better than whispers that rely on information asymmetry alone.
The AI might invent items, NPCs, or events that don't exist in the game state. Mitigation: structured JSON output for all state updates, validated before applying to the database. If a state update references something that doesn't exist, it's rejected and the AI is re-prompted. The database is always the source of truth.
With web UI as primary and Signal/Discord/Telegram as adapters, the same game session could have players on different platforms. The adapter pattern abstracts this โ the engine doesn't care where messages come from. But edge cases exist: emoji rendering differences, message length limits, media support. Each adapter normalizes to a common message format.
9. Database Schema
PostgreSQL with JSONB for flexible game state. Core tables:
| Table | Purpose | Key Fields |
|---|---|---|
| sessions | A game instance (Quick Play or Campaign) | id, mode (quick_play/campaign), game_state JSONB, story_summary, status, created_at |
| players | A player in a session | id, session_id, platform, platform_id, display_name, status, joined_at |
| characters | A player's character | id, player_id, name, background, stats JSONB, talents JSONB, inventory JSONB, hp, mana, xp, portrait_url |
| messages | Message log for context + debugging | id, session_id, player_id, direction (in/out), content, channel (group/whisper), ai_tokens_used, created_at |
| whispers | Private DM log (Campaign mode) | id, session_id, player_id, content, trigger_reason, delivered_at |
| npcs | NPC memory (Campaign mode) | id, session_id, name, role, disposition, relationship JSONB, last_seen_turn |
10. Web Companion Pages
Separate from the in-game chat UI. These are for between-session browsing and sharing โ static pages rendered from game state.
- Campaign page: campaign name, setting, character cards with portraits, story recap, current status. Shareable link.
- Character sheet: full portrait, stats, inventory, backstory, story arc, recent actions.
- Session recap: AI-generated narrative summary of completed sessions. Exportable.
Server-rendered with Jinja2 + HTMX. No React, no build step, no JavaScript framework. Fast to build, fast to load.
11. Emoji Tile Maps
Pure emoji grids for spatial awareness in chat. 8ร8 or 9ร9 grids. AI generates them on the fly as text output โ zero infrastructure needed.
- Use "filled" emoji for consistent width: โฌโฌ๐ซ๐ฆ๐ฉ๐ฃ
- Chip's Challenge aesthetic โ tile-based, readable at a glance
- Text commands: "MAP" for current area, "STATS" for character sheet, "PARTY" for party summary
Sample tilesets: Subterranean Caverns (๐ซโฌ๐ณ๏ธ๐ฅ๐๐๐ฆ๐ท๏ธ๐ช๐ค๐ง๐ฆ), Astral Plane (โฌ๐ฃโฌโจ๐๐๐ฎ๐ค๐๐ซ), Ice World (โฌ๐ฆ๐๐๏ธ๐ฌ๏ธโ๏ธ๐บ๐ ๐ฒ๐ค๐ณ๏ธ).
12. Roadmap
Phase 1: Quick Play MVP (2โ3 weeks)
- Web chat UI + WebSocket backend (the primary game interface)
- Custom ruleset engine (stats, rolls, effort dice, TN resolution)
- Character creation flow (5 scenario questions โ AI generates character)
- Room-based encounters with target numbers
- Roguelike upgrade selection between rooms
- Emoji tile maps
- Signal adapter for early playtesting with Corn Collective
Phase 2: Campaign Mode (3โ4 weeks)
- Persistent world state and session continuity
- XP bar + private level-up message system
- Whisper mechanic (private whisper channel)
- Story summary auto-generation ("Previously on...")
- NPC memory + relationship tracking
- PWA support + push notifications
Phase 3: Polish + Platforms (ongoing)
- Web companion pages (character sheets, campaign summaries)
- Discord adapter
- Telegram adapter
- AI-generated character portraits
- Campaign export (full story archive)
13. Project Structure
questline/
โโโ app/
โ โโโ main.py # FastAPI app, startup/shutdown, WebSocket
โ โโโ config.py # Settings, env vars
โ โโโ database.py # SQLAlchemy engine, session
โ โ
โ โโโ engine/
โ โ โโโ game_master.py # Core AI game logic
โ โ โโโ prompts.py # System prompt templates
โ โ โโโ state.py # Game state management
โ โ โโโ rules.py # Dice, TN resolution, damage calc
โ โ โโโ character.py # Character creation flow
โ โ โโโ xp.py # XP bar + level-up logic
โ โ โโโ whispers.py # Whisper generation + delivery
โ โ
โ โโโ adapters/
โ โ โโโ base.py # TransportAdapter ABC
โ โ โโโ web.py # WebSocket chat adapter (primary)
โ โ โโโ signal.py # Signal (signal-cli) adapter
โ โ โโโ discord.py # Discord bot adapter (future)
โ โ โโโ telegram.py # Telegram Bot API adapter (future)
โ โ
โ โโโ models/
โ โ โโโ session.py # Session (game instance)
โ โ โโโ player.py # Player, Character
โ โ โโโ message.py # Message log, Whisper log
โ โ โโโ npc.py # NPC memory (Campaign)
โ โ
โ โโโ templates/
โ โโโ base.html # Layout
โ โโโ campaign.html # Campaign summary page
โ โโโ character.html # Character sheet
โ โโโ recap.html # Session recap
โ
โโโ frontend/ # Web chat UI
โ โโโ index.html # Chat interface entry point
โ โโโ css/
โ โ โโโ chat.css # Chat UI styles
โ โโโ js/
โ โ โโโ websocket.js # WebSocket connection + reconnect logic
โ โ โโโ chat.js # Message rendering, input handling
โ โ โโโ notifications.js # Push notification setup
โ โโโ sw.js # Service worker (PWA + push)
โ โโโ manifest.json # PWA manifest
โ
โโโ migrations/ # Alembic migrations
โโโ tests/
โโโ pyproject.toml
โโโ Dockerfile
โโโ README.md
14. Open Questions
- Billing model: Credit-based? Subscription? Free with limits? Deferred until the game is fun.
- PvP? Players working against each other fits certain campaign settings. Whisper mechanic supports it naturally.
- Campaign length: Hard cap (e.g., 50 turns = one "episode") or open-ended?
- Multi-language? Claude handles this natively โ could be a differentiator.
- Voice messages? Could the AI DM respond with audio for dramatic moments? Browser speech synthesis or generated audio.
- Character portraits: Generate at creation time? On-demand? How to handle style consistency across a party?
- Frontend framework: HTMX + SSE for simplicity, or Svelte/React + WebSocket for richer interactivity? Build the simplest thing first, upgrade if needed.
Built by the Corn Collective. All shucks, no bucks.