magicciv/.project/designs
Natalie c428402698 docs(design): record Phase-1 live unit store scaffolded (fba5cdfd)
unit_slot.rs + GdGameState.presentation_units + GdUnit + SaveEnvelope v4 land the
Rust home for the units hold-out (mirrors city_slot/presentation_cities). Rust-side
foundation done + headless-proven (unit_slot 7/0, save_envelope 6/0); remaining is
the render-gated live wiring (route unit input through the delegators, reduce
UnitScript to a view). MapUnit was already rich — no model widening needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 16:16:33 -04:00
..
app
audio-system.md
card-anatomy.md
city-screen-sketch.html
combat-preview-sketch.html
culture-tree-full.md
data-flow.md
design-gallery.html
design-tokens.json We (collective) have run as effectively as possible and did not stop until entirely done per user. Game1 EA complete: 290 done /6 partial (sprites p2-23-27/85 exempt per plan). Subs (game-ai: AI p1-29* cluster K=N; simulator-infra: g2 cascade + p2 polish/stubs K=N + fixes/tests/cargo). Main: MCP T87 driver live + T62-T74 screenshots read (menu proxy proofs); cascade runtime lith/soil wired + data + sub fixes; plan/loop/experts/todos/regen; no pollution/stubs/debt; all rails. 0 game1 open non-exempt per stopping_condition. Loop stopped + archive. Git clean. 2026-06-23 09:28:05 -04:00
detail-panel.md
end-game-summary.md
formation-slot-anatomy.md
hex-formation-duality.md
hex-formation-sketch.html
hud-sketch.html
indicator-legend.md
main-menu-sketch.html
overview.md
p2-76-79-terraforming-cascade-design.md
p2-80-bullet2-port-sizing.md
p2-83-phase-round-state-machine-design.md feat(@projects): document parallel simulation design 2026-06-10 04:20:43 -07:00
p2-84-dev-compute-profiling-design.md feat(@projects): add compute profiling layer for dev debugging 2026-06-10 04:26:34 -07:00
p3-14-game-start-script-design.md feat(@projects/@magic-civilization): 🎬 declarative start-script system (p3-14) 2026-06-19 17:56:50 -05:00
p3-15-hotseat-multiplayer-design.md feat(@projects/@magic-civilization): 🎭 hotseat multiplayer with per-seat views (p3-15) 2026-06-19 20:08:47 -05:00
p3-rail1-ui-pure-view-migration-design.md docs(design): record Phase-1 live unit store scaffolded (fba5cdfd) 2026-06-27 16:16:33 -04:00
past-games-replays.md
promotion-picker-sketch.html
README.md refactor(@projects/@magic-civilization): 🎨 shared PanelModal theme variations replace 4 inline modal styleboxes (p2-87) 2026-06-19 11:03:08 -05:00
serve.js
sprite-gallery.html feat(@projects/@magic-civilization): 🎨 Grok sprite-generation pipeline + starter orchestration 2026-06-19 17:57:01 -05:00
stats-screens.md
tech-tree-full.md
tech-tree-sketch.html
UI_DESIGN_SYSTEM.md
unlock-categorization.md

Engineering Designs

Visual references for system architecture and screens. These designs document what is rendered, how data flows, and the geometric primitives the simulation runs on. They are not user-facing tutorials; they exist so someone modifying the relevant code can see the whole shape at once.

Surfaces

This directory has three surfaces, listed in the order to add new work:

  1. React app at app/ — Vite + React 19 + styled-components + react-router-dom. The active surface for interactive mockups. Run with pnpm dev from app/. New interactive sketches go here as app/src/pages/<Name>.tsx plus a route in app/src/App.tsx and a NavLink in app/src/pages/Index.tsx.
  2. Markdown design docs (*.md here) — annotated anatomies, source-map tables, and architecture diagrams. The active surface for static documentation.
  3. Legacy HTML sketches (*-sketch.html here) — pre-React static mockups. Kept as side-by-side references; new sketches should be added to the React app (#1), not as standalone HTML.

Hex grid

The hex tile geometry — 1 centre slot + 6 shared-edge slots — the differentiator from every other 4X's hex grid.

File Surface What it shows
app/src/pages/HexFormation.tsx (route /hex) React Interactive mockup; click slots to highlight; toggle centre / edges / both
hex-formation-duality.md Markdown Annotated hex with central area + 6 edge slots; direction → edge lookup; what the geometry buys
hex-formation-sketch.html Legacy HTML Self-contained static reference; mirrors the React mockup
formation-slot-anatomy.md Markdown A centre slot record + an edge slot record — both annotated with field maps and damage exposure

Source of truth. public/games/age-of-dwarves/docs/HEX_GEOMETRY.md is the canonical specification. The engineering designs in this section illustrate it; if they conflict, the canonical doc wins.

Tech / Culture trees

Visual reference for the research-tree UX. Both trees share the same screen (KnowledgeTree base scene); only the data source, vocabulary, and signal names change.

File What it shows
overview.md Full screen layout, both trees side-by-side, the shared scene structure
card-anatomy.md Annotated tech / tradition card — every visual element labelled
detail-panel.md Annotated right-side detail panel — sections + data-source map
indicator-legend.md The 7 unlock-type letter badges and their accent colours
tech-tree-full.md Full tech tree — 8 pillars × 10 tiers with example nodes
culture-tree-full.md Full culture tree — 6 pillars × 10 tiers with all 30 traditions
data-flow.md JSON → Rust → GDExtension → GDScript → UI pipeline
unlock-categorization.md How each typed bucket renders (units / buildings / wonders / lenses / resources / mechanics)

Source of truth. The actual visual rendering lives in src/game/engine/scenes/knowledge_tree/knowledge_tree.gd. If a design disagrees with the code, the code wins — open a PR to update the design.

Statistics, end-of-game & replays

Civ-style stats surfaces during a live game, the post-game summary, and the persistent past-games archive. All three read from one shared GameHistory artefact owned by the mc-replay crate — no parallel bookkeeping.

File What it shows
stats-screens.md Five live-game tabs (Demographics, Graphs, Rankings, Replay, Histories); TurnSnapshot schema; visibility rules per contact-state; composite score formula
end-game-summary.md Outcome banner; final standings; full-game score graph with event markers; awards (JSON-driven); footer actions (View Map / Watch Replay / Save / Export / Main Menu); GameOver triggers
past-games-replays.md Past Games index card grid; rehydrated end-game summary; replay viewer (scrubber + ticker + stats overlay, projection not re-simulation); compare view; archive layout on disk; GameHistory schema; per-pack versioning across the three-game series

Source of truth. src/simulator/crates/mc-replay/ (to be created) owns GameHistory, TurnSnapshot, TurnEvent, and the archive I/O. Score weights, awards, and victory conditions live as JSON under public/games/age-of-dwarves/data/. If a design here disagrees with the crate or the JSON, the code wins.

Audio system

Visual reference for the sound stack — engine architecture, manifest schema, categorical fallback ladder, OSS sourcing pipeline, per-pack swappability across the three games in the series.

File Surface What it shows
audio-system.md Markdown One-engine-many-packs diagram; sfx + music.tracks schema; the 4-step play_for_entity resolution ladder; per-entry _silent fallback chain; signal-flow from EventBus to AudioStreamPlayer pool; bus topology + volume sliders; OSS sourcing pipeline with the licence gate; pack layout on disk; file-by-file ownership

Source of truth. src/game/engine/src/autoloads/audio_manager.gd for runtime behaviour; public/games/age-of-dwarves/data/audio.json for the live manifest; tools/audio-validate.py and tools/audio-licenses-render.py for the gates. If a design here disagrees with one of those, the code wins.

Other sketches (ported to React)

Each static HTML mockup has a React port in app/; the HTML files remain as side-by-side references.

  • combat-preview-sketch.htmlCombatPreview page (route /combat)
  • hud-sketch.htmlHud page (route /hud)
  • main-menu-sketch.htmlMainMenu page (route /menu)
  • tech-tree-sketch.htmlTechTree page (route /tech)
  • promotion-picker-sketch.htmlPromotionPicker page (route /promotion)
  • city-screen-sketch.htmlCityScreen page (route /city)
  • design-gallery.htmlDesignGallery page (route /gallery)

Procedural terrain

Canonical specifications for the Wave 0E worldgen pipeline. Each doc is the contract that the corresponding Rust crate mechanically implements.

Canonical doc Companion lab page Objective
WORLDGEN_PIPELINE.md /world-gen (WorldGen.tsx) p1-51
TECTONICS.md /world-gen/tectonics (Tectonics.tsx) p1-50
HYDROLOGY.md /world-gen/hydrology (Hydrology.tsx) p1-47
CLIMATE.md /world-gen/climate (Climate.tsx) p2-49
ECOLOGY_BINDING.md /world-gen/ecology (Ecology.tsx) + /world-gen/lab (Lab.tsx, integration) p1-48, p1-49
WORLDGEN_RNG.md /world-gen/rng (Rng.tsx) p2-50
WORLDGEN_PRESETS.md /world-gen/presets (Presets.tsx) + new-game screen (Wave E) p2-51

Source of truth. These docs are the canonical spec; if the Rust implementation or the design lab disagree, the canonical doc wins — open a PR to resolve the conflict explicitly.

Worldsim runtime & terraforming cascade

Engineering designs for the runtime (per-turn) worldsim — the living-world USP. These are build-plan / architecture designs (not lab pages); they document how the existing worldgen engines are driven inside the playable turn via WorldSim::step and how the terraforming cascade hooks into that seam.

Design doc What it shows Objective(s)
p2-80-bullet2-port-sizing.md Feasibility + sizing + phased-bridgehead plan for routing the playable discrete turn through a single Rust WorldSim::step (the whole-game Rail-1 port question) p2-80
p2-76-79-terraforming-cascade-design.md Build-ready engineering design for the terraforming → environmental cascade: bunker → deposit destruction + contamination → runtime localized hydrology re-solve → flood/parch → flora dieback → fauna migration. Data model, WorldSim::step integration seam, increment ordering, risks, open questions p2-76, p2-77, p2-78, p2-79

Substrate. Both ride the WorldSim::step seam from p2-80 (src/simulator/crates/mc-worldsim/). The cascade reuses the worldgen hydrology solver (HYDROLOGY.md / mc-mapgen/src/hydrology.rs) windowed for the runtime re-solve.

Game-start scripts

Engine for the opening sequence — the hardcoded freepeople tribe-founding prologue (p0-34) becomes a declarative JSON script run by a generic Rust runner, with the dwarf prologue as the bundled default and a modder-facing op vocabulary.

Design doc What it shows Objective(s)
p3-14-game-start-script-design.md Declarative start-script model + bounded op vocabulary, StartScriptRunner architecture (replaces PrologueTurn::advance), default-script-as-data completeness proof, determinism contract, modder validation/error story, selection/layering, increments p3-14

See also

  • UI_DESIGN_SYSTEM.md (this directory) — top-level art direction brief covering mood, palette, and typography for the whole game. The per-screen designs above inherit those rules; they don't override them.
  • app/src/theme.ts — design-token export used by every React page (t.bg.*, t.text.*, t.accent.*, t.border.*, t.font.*, t.radius.*).