Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/at6132/econ/llms.txt

Use this file to discover all available pages before exploring further.

Realm is a 5–10 year project at full scope. The phase plan exists to prevent the project from dying in the gap between vision and shipping: every phase produces a testable, possibly sellable artifact before the next phase begins. You do not start Phase N+1 until Phase N’s test gate is passed. That discipline is how a solo or small-team project ships instead of becoming an abandoned repo.
Do not skip phase test gates. They are how this project ships instead of dies. If a gate fails, iterate within the current phase or revise the design — do not paper over it by moving forward.

Timeline at a glance

PhaseDescriptionRealistic milestone
0Spec & FoundationWeek 0
1Solo Engine Prototype3–6 months
2Solo Polish & Visual Identity3–6 months
3Solo Launch6–9 months from start
4User-Code Layer9–15 months from start
5Multiplayer Foundations + Closed Cohort 118–24 months from start
6Closed Cohorts + Open Beta27–36 months from start
7Public Persistent Multiplayer3+ years from start
Time estimates are honest but optimistic. As a solo or small-team developer, plan for 1.5–2× the listed range. The phasing is what matters — each phase produces a real artifact regardless of how long it takes.

Phases

1

Phase 0 — Spec & Foundation

Complete.
Goal: Have a complete, internally-consistent design spec before writing any engine code.The spec phase is not a formality. Its job is to validate that the 9 economic primitives can express every business a player might invent — without adding new mechanics on the fly. If you can’t describe five distinct player-invented businesses using only the primitives, the primitive set is incomplete.What was built:
  • Read and reconciled all design documents (docs 01–12)
  • Wrote five worked business examples using only the 9 primitives
  • Chose the v1 simulation stack (Python engine, Next.js frontend)
  • Set up the project repository with a clean directory structure
  • Wrote the one-pager pitch and the canonical glossary (doc 15)
Test gate:
Can you describe, in one paragraph each, exactly what 5 different player-invented businesses look like — including which primitives they use, what their daily activities are, and how they make money? If yes → Phase 1. If no → the primitives spec is incomplete. Revise the primitives and try again.
2

Phase 1 — Solo Engine Prototype

Engineering complete. Playtest gate (A1) deferred to Phase 2 cadence.
Goal: A playable solo prototype that proves the core economic loop is fun. Ugly UI is fine.Phase 1 built the simulation core from scratch. Every major primitive is implemented at a usable level. The engineering checklist (17_PHASE_1_COMPLETION_CHECKLIST.md) is closed as of 2026-05-08. The stranger playtest gate (A1) — 3 of 5 strangers saying they’d play another hour — has not yet been formally run and is tracked under Phase 2 process.What was built:Engine core:
  • Tick-based deterministic simulation loop (advance_tick; RNG via (tick, purpose) pairs — no wall-clock in sim)
  • World generation: Frontier bootstrap grid; terrain via biome noise; plot terrain, hidden subsurface composition, ownership
  • Materials (Primitive 2): 12 definitions including spoiled_grain; party-wide storage unit cap with field_stockade bonus; grain → spoiled_grain spoilage transform (conserved, Law 1)
  • Capital (Primitive 5): accounts, atomic double-entry transfers, conservation enforced at the ledger layer
  • Production (Primitive 6): 5 recipe templates (e.g., timber → lumber, ore → metal); 40% of recipe labor_cents paid to distinct stub_hires employees per batch; tool_cache / watch_hut lower labor cost on the producing plot (BPS)
  • Movement (Primitive 4): shipping with tick-based transit; fee = BASE + manhattan × PER_TILE; deliveries respect storage cap
  • Order books (Primitive 7b): asks + bids, escrow, iceberg clips, counterparty reputation minimum, FIFO by price then order_id
  • P2P trade (Primitive 7a): atomic exchange with optional idempotency key and stable structured error codes
  • Basic contracts (Primitive 8): supply FSM with buyer deposit and liquidated damages; employment with recurring wages
  • Reputation (Primitive 9 placeholder): honor/breach counters; order book filters on min_counterparty_honored
AI agents:
  • 6 Tier 1 behavioral archetypes: grain consumer, lumber buyer, timber relister, coal buyer, clay buyer, electricity buyer
Frontend:
  • Next.js shell with Bloomberg-style tab panels
  • SVG organic mesh world map (no Pixi.js yet — that is Phase 2)
  • Plot detail, market order book + depth chart, inventory, build menu, hire menu, action log, caravans, contracts, Bazaar (P2P) tabs
Persistence:
  • SQLite save/load including order books, P2P idempotency, and market history
Test gate:
Get 3–5 strangers to play the prototype for 1 hour. After their session, ask them: “would you keep playing if I gave you another hour?” 3 of 5 must say yes. Watch for: when they’re confused (first-hour script needs work), when the world feels empty (increase agent activity), when cause and effect are invisible (add visible price reasoning). If they call it a spreadsheet rather than a game — that’s acceptable in Phase 1. You’re testing whether the economics are fun, not the visuals.
3

Phase 2 — Solo Polish & Visual Identity

Engineering complete. Stranger $30 playtest gate (A1) deferred by project choice.
Goal: Take the proven prototype and make it visually compelling. Add Tier 2 AI agents. Add named scenarios.Phase 2 engineering is closed per 18_PHASE_2_COMPLETION_CHECKLIST.md as of 2026-05-10. All in-scope rows are ✅: 117 engine tests pass; tsc and next build green. The A1 human gate — 3 of 5 strangers saying they’d buy it for $30 after 5+ hours — is deferred and must be run before Phase 3 launch.What was built:Visuals:
  • Pixi.js v8 world map: colored terrain, plot boundaries, ownership shading, GL/SVG toolbar toggle
  • Schematic plot view (PlotSchematicPanel.tsx): drag-drop production flow editor; validates against engine recipes and party inventory via POST /plots/{id}/schematic/validate
  • Real charting (Recharts): MarketHistoryChart.tsx with axis labels, Bazaar symbol sync, ask + bid series
  • Polished UI: Cmd/Ctrl+K command palette, tab strip, notification toaster (realmToast.tsx)
  • Settings modal: pause/speed control, scenario selector, save management
Engine extensions:
  • Tier 2 optimizing agents: 5 archetypes in agents_tier2.py (market-maker, logistics, production-planner, employer, and a fifth); distinct from Tier 1 schedules
  • 27 materials (up from 12), 20 recipe templates (up from 5)
  • Contract stubs: loan, equity, service-subscription FSM with tick-based lifecycle and API routes
  • Surveying: survey_plot reveals terrain and recipe_ids; cost flows to system reserve; supports an optional tradable survey intel market
  • Decay (Law 5): tick_building_decay; maintain_building fee = max(1_000, cost // 5); labor bonus gated by building condition
  • Information cost (Law 6): purchase_market_intel; free tier shows last FREE_MARKET_HISTORY_TICKS ticks; paid tier extends visibility; fee → system reserve
Content:
  • 4 scenarios: Frontier (default), The Bootstrapper (5,000start,32×24grid),TheSpeculator(5,000 start, 32×24 grid), **The Speculator** (20,000 start, 40×30 grid), The Cartel (grain-side pressure overlay)
  • Scenario selection UI in settings modal
Persistence:
  • Snapshot version bumped to v2; additive fields for scenario ID, market intel expiry, building instance ID and condition BPS
Test gate:
Get 5 strangers to play for 5+ hours each (across multiple sessions, ideally a week of self-directed play). At the end: at least 3 of 5 say “I’d buy this for $30 today.” Bonus signals: testers post screenshots organically, tell friends, ask when multiplayer is coming. Those are stronger than the survey answer alone.
4

Phase 3 — Solo Launch

Planned. Begins after Phase 2 playtest gate (A1) passes.
Goal: Ship solo mode commercially. Build distribution, monetization, and community support. This is when Realm becomes a real product with real users.Duration estimate: 6–10 weeks from start of phase to public launch.What will be built:Tier 3 LLM agents:
  • LLM agent runtime (Anthropic API integration)
  • Memory system: rolling window + long-term summary
  • 5 named characters with distinct personalities (per the AI agent design doc): examples include Margaux the Industrialist, Rico the Speculator
  • Cost monitoring and per-session budget caps
Production readiness:
  • Stable build pipeline, crash reporting, opt-in telemetry
  • Save file forward-compatibility (saves from v1.0 work in v1.1+)
  • Auto-update mechanism
Distribution:
  • Steam page and/or itch.io and/or self-hosted
  • Trailer and launch video, marketing copy, screenshots
  • Demo version (limited scenario, no save)
Monetization:
  • One-time purchase, recommended 2525–50
  • Payment processing and email/newsletter collection
Support infrastructure:
  • Documentation site (this site)
  • Discord community
  • Bug report workflow
Test gate:
Launch publicly. Within 30 days of launch: at least 200 paying users with >70% day-7 retention, and a Steam (or equivalent) rating averaging 80%+. Soft-launch to beta testers first. Fix critical issues. Then public launch. If retention is below targets, the design has a flaw at scale — address it before moving to Phase 4. If reviews flag the same issue repeatedly, that issue is the priority.
What success here enables: revenue to fund Phase 4+, a community to draw closed-cohort participants from, press and streamer attention, and a library of player feedback to inform multiplayer design.
5

Phase 4 — User-Code Layer

Planned. Target: 9–15 months from project start.
Goal: Add the user-code and services layer to solo mode. Players can write code, deploy services, and subscribe to other services (which in solo mode are AI-generated or pre-shipped).Duration estimate: 12–16 weeks.The user-code layer (Primitive 9) is the “moat primitive” — it turns Realm from an economic sim into a platform where in-game SaaS businesses are structurally real businesses. This phase releases it as a free update to existing solo-mode owners.What will be built:User-code runtime:
  • Lua sandbox: sandboxed interpreter with restricted stdlib, deterministic, resource-metered
  • Read API and Write API (per the user-code layer spec)
  • Service definition, publication, and versioning
  • Resource metering: CPU and storage budgets billed in in-game currency
  • Service marketplace UI
Block-based programming UI:
  • Visual drag-drop block editor for non-programmers
  • Compilation from blocks to Lua
  • Beginner templates: “auto-restock,” “price alerts,” and similar
Solo-mode service ecosystem:
  • Pre-shipped services that AI agents publish (so the marketplace isn’t empty at launch)
  • Services that AI agents subscribe to from the player
  • Services that the player can create and sell to AI agents
In-game IDE:
  • Code editor (Monaco or CodeMirror)
  • Live preview and test environment
  • Debugging tools: logs, breakpoints if feasible
Test gate:
At least 30% of returning players (week-2 cohort) deploy at least one service or use the block editor non-trivially. At least 50% of testers can describe a service they wish existed (showing they understand the platform’s value). Track via telemetry: who opens the IDE, who writes code, who deploys, who subscribes. If fewer than 30% engage, the UX is too hard — add more templates, simplify the block editor, and improve tutorials.
6

Phase 5 — Multiplayer Foundations + Closed Cohort 1

Planned. Target: 18–24 months from project start.
Goal: Ship the multiplayer infrastructure and run the first 50-player closed cohort for 90 days.Duration estimate: 16–24 weeks.Multiplayer is a mode product built on the same engine as solo mode — not a separate game. Before opening a public mode, you run a closed cohort to validate that the multiplayer mechanics, economy bootstrap, and infrastructure all hold up under real use.What will be built:Multiplayer infrastructure:
  • Authoritative server architecture
  • Postgres-based state (migrated from SQLite for multi-user concurrency)
  • Real-time WebSocket layer
  • Auth: email + password, OAuth optional
  • Identity and account management
  • Anti-cheat (mostly automatic via the determinism and audit-log architecture)
Bootstrap mechanics:
  • Genesis bonuses: starting-capital boosts for early players who fill needed roles (shipping, finance, agriculture), phasing out as roles become saturated
  • NPC seed economy: consumers, laborers, baseline banks and utilities
  • Frontier zone reveal mechanic
Cohort tooling:
  • Invite-only registration
  • Season management: start, run, end, ranking, and archive
  • Live leaderboard
  • Spectator mode for non-participants
Operations:
  • Monitoring and alerting, backup and disaster recovery
  • Customer support workflow and moderation tools
Test gate:
Closed Cohort 1 runs for its full 90-day season with: less than 5% participant dropout, less than 2 hours of unplanned downtime total, no exploits affecting more than 5% of player state, and at least 60% of participants saying they’d join Cohort 2. Run a 7-day pre-season stress test with 20 participants before the full season. If the cohort falls apart — mass exit, major exploits, infrastructure failure — do not open public mode. Run Cohort 2 first.
7

Phase 6 — Closed Cohorts + Open Beta

Planned. Target: 27–36 months from project start.
Goal: Run multiple cohorts to refine multiplayer mechanics, then launch a public open beta.Duration estimate: 9–18 months.What will be built:
  • Cohort 2 (with lessons from Cohort 1)
  • Cohort 3 (larger, ~150 players)
  • Public open beta (1 shard, free or low-cost entry)
  • Tournament and in-season event tooling
  • Streamer and content-creator tools: replay export, embed widgets
  • Mobile companion app v1: read-only access plus the key quick-action flows from the mobile spec
Test gate:
Public open beta runs for 90 days with: 1,000+ daily active users at peak, 40%+ day-30 retention, no critical exploits, and a steady-state economy (no hyperinflation, healthy market depth across major asset classes). Monitor KPIs daily. Address economic dysfunction immediately — hyperinflation or market collapse is a design problem, not just a numbers problem. If the open beta shows systemic problems, fix and re-run before opening permanent multiplayer.
8

Phase 7 — Public Persistent Multiplayer

Planned. Target: 3+ years from project start.
Goal: Open permanent multiplayer shards. Realm becomes a live ongoing product.Duration estimate: Ongoing — there is no exit gate for this phase. The phase is live operation of a successful game.What will be built:
  • Multi-shard architecture with shard selection UI
  • Cross-shard player profile: single account, multiple worlds
  • Subscription or updated monetization model for multiplayer
  • Mobile companion v2: full functionality per the mobile spec
  • Player-issued currencies (Primitive 5 v2)
  • Advanced financial primitives: derivatives, insurance, bond markets
  • Player governance and corporations: multi-player businesses with shareholders
Ongoing health metrics: DAU, MAU, retention, ARPU, NPS. Maintain.Beyond Phase 7, possible long-term directions include player governance and nations, additional user-code language options, a Realm API for third-party tools, VR or spatial visualization layered on top of the 2D game, and single-player narrative spinoffs using the engine. These are possibilities to evaluate as the game evolves, not commitments.

Cross-cutting hygiene (every phase)

These tasks run throughout the entire project lifecycle, not as discrete phase deliverables:
  • Update spec docs whenever a design decision changes
  • Maintain the glossary — when a new term enters design discussions, add it before it appears in three docs
  • Quarterly risk review
  • Regular playtests — do not go more than 4 weeks without one
  • Performance monitoring
  • Backup save files and database

Continue exploring

Glossary

Canonical definitions of every term used in the Realm spec and design discussions.

Design pillars

The seven non-negotiable principles behind every design decision in Realm.

Economic primitives

The 9 economic atoms that players compose into every business in the game.

Architecture

How the Python engine, Next.js frontend, and SQLite/Postgres persistence fit together.

Build docs developers (and LLMs) love