No description
Port two per-turn subsystems from GDScript into the headless Rust turn engine.
**B1: Happiness + Golden Age tick**
- New: src/simulator/crates/mc-turn/src/happiness_phase.rs
- pub fn process_happiness_phase(state: &mut GameState)
- Assembles HappinessInput from PlayerState (city_count, total_citizens,
traded/owned luxuries, building_happiness, growth_tier)
- Runs mc-happiness::calculate_happiness → writes PlayerState::happiness +
happiness_status
- Advances golden-age meter via mc-happiness::process_golden_age → writes
golden_age_active/turns/progress/count
- 6 unit tests covering surplus triggers, meter accumulation, count-down,
tier defaulting, multi-player independence
- mc-happiness moved from [dev-dependencies] to [dependencies] in mc-turn/Cargo.toml
**B2: Unit + city healing tick**
- New: src/simulator/crates/mc-turn/src/healing.rs
- pub fn process_healing_phase(state: &mut GameState)
- Units: rest-condition guard (movement_remaining == base_moves || is_fortified),
captive skip; rates: garrison=20, fortified-territory=15, neutral=10
- Cities (bench CityState): +20 HP/turn clamped to max_hp
- 10 unit tests covering garrison/fortified/neutral/moved/capped/captive/city cases
**GameState/PlayerState fields added to mc-state (all #[serde(default)])**
- PlayerState::happiness: i32
- PlayerState::happiness_status: String
- PlayerState::growth_tier: String
- PlayerState::owned_luxuries: BTreeMap<String, i32>
- PlayerState::golden_age_active: bool
- PlayerState::golden_age_turns: i32
- PlayerState::golden_age_progress: i32
- PlayerState::golden_age_count: i32
- PlayerState::building_happiness: i32
CONTRACT: process_happiness_phase and process_healing_phase are NOT wired
into TurnProcessor::step — caller wires them at the correct phase slots.
cargo test -p mc-turn: 265 passed, 0 failed (lib) + all integration suites ok.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .ai-arena-test | ||
| .forgejo | ||
| .out-of-scope | ||
| .project | ||
| docs | ||
| drafts | ||
| engine/addons/magic_civ_physics | ||
| public | ||
| screenshots | ||
| scripts | ||
| src | ||
| tooling | ||
| tools | ||
| .claude | ||
| .env | ||
| .env.example | ||
| .gdlintrc | ||
| .gitignore | ||
| .gutconfig.json | ||
| .mcp.json | ||
| .pnpmfile.cjs | ||
| aod_bears_retiered.png | ||
| aod_canines.png | ||
| aod_canines_retiered.png | ||
| aod_evolution_map_default.png | ||
| aod_felids_retiered.png | ||
| aod_freefolk_dwarves.png | ||
| aod_lens_canines.png | ||
| aod_lens_canines_2.png | ||
| aod_lens_canines_scrolled.png | ||
| aod_lens_canines_t8.png | ||
| aod_lens_default.png | ||
| aod_raptors_retiered.png | ||
| calc-mountain-king-vs-apex.png | ||
| CLAUDE.md | ||
| climate-fix-check.png | ||
| climate-sim-1.png | ||
| climate-sim-2.png | ||
| climate-sim-3.png | ||
| climate-sim-4.png | ||
| climate-sim-check.png | ||
| climate-sim-final.png | ||
| climate-sim-fixed.png | ||
| early-access-bottom.png | ||
| early-access-current.png | ||
| early-access-updated.png | ||
| earth-42vh.png | ||
| earth-charts-visible.png | ||
| earth-fixed.png | ||
| earth-normal-mode.png | ||
| earth-scrolled-down.png | ||
| earth-scrolled-stats.png | ||
| earth-scrolled.png | ||
| earth-with-stats.png | ||
| enc-arctic-fox-modal.png | ||
| enc-arctic-fox.png | ||
| enc-audit-home.png | ||
| enc-combat-filter.png | ||
| enc-concept-modal.png | ||
| enc-first-forge.png | ||
| enc-fox-stats.png | ||
| encyclopedia-302-clean.png | ||
| encyclopedia-after-reload.png | ||
| encyclopedia-alias-glob.png | ||
| encyclopedia-detail-bottom.png | ||
| encyclopedia-detail-combat.png | ||
| encyclopedia-embedded.png | ||
| encyclopedia-full-page.png | ||
| encyclopedia-populated.png | ||
| encyclopedia-registry-working.png | ||
| encyclopedia-registry.png | ||
| encyclopedia-restarted.png | ||
| encyclopedia-search-warrior.png | ||
| encyclopedia-warrior-modal.png | ||
| evolution-aquatic-insects.png | ||
| evolution-arachnids.png | ||
| evolution-canines.png | ||
| evolution-frogs-toads.png | ||
| export_presets.cfg | ||
| full-game-final.png | ||
| full-game-page-bottom.png | ||
| full-game-page-bottom2.png | ||
| full-game-page-updated.png | ||
| gdformatrc | ||
| gdlintrc | ||
| lairs-filter-bar.png | ||
| lairs-page-tierrange.png | ||
| nogui-final.png | ||
| permutations-default.png | ||
| permutations-light-melee-filter.png | ||
| personality-axes-page-v2.png | ||
| personality-axes-page.png | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| run | ||
| sheets-page.png | ||
| sheets-skeleton.png | ||
| sim-30s.png | ||
| sim-after-10s.png | ||
| sim-after-90s.png | ||
| sim-after-fix.png | ||
| sim-after-wait.png | ||
| sim-check.png | ||
| sim-check2.png | ||
| sim-complete.png | ||
| sim-debug.png | ||
| sim-done.png | ||
| sim-earth-check.png | ||
| sim-equal-split.png | ||
| sim-final-layout.png | ||
| sim-final.png | ||
| sim-initial.png | ||
| sim-layout-check.png | ||
| sim-layout-check2.png | ||
| sim-layout-check3.png | ||
| sim-layout-final.png | ||
| sim-layout-verify.png | ||
| sim-loading.png | ||
| sim-nostart.png | ||
| sim-now.png | ||
| sim-playback.png | ||
| sim-playing.png | ||
| sim-progress-2.png | ||
| sim-streaming.png | ||
| spritegen.db | ||
| ss | ||
Magic Civilization
Fantasy 4X turn-based strategy game in Godot 4 + Rust, hex grid.
Game 1 — "Age of Dwarves" (current Early Access): single race (Dwarves), 5 AI-only clan personalities the player can face as opponents (Ironhold, Goldvein, Blackhammer, Deepforge, Runesmith), no magic mechanics, mundane tech only. Full 4X loop (cities, tech tree, wonders T1-T10, combat, wild creatures, domination victory). High-tier items and late-game wonders carry ancient/inexplicable flavor as Game 2 teasers — effects remain strictly mundane numeric bonuses.
Game 2 — "Age of Kzzykt" (future): adds magic, ley lines, Archons, spells, Ascension victory, more races. Eventual vision includes 16 races and 5 magic schools (Civ5 + Master of Magic + Magic: The Gathering color pie).
Structure
engine/ — genre-agnostic game engine (GDScript)
src/ — autoloads, entities, map, generation, modules, rendering
scenes/ — Godot scenes (.tscn + .gd)
docs/ — engine architecture docs
games/
age-of-dwarves/ — fantasy game pack (the default theme)
data/ — all JSON game content
assets/ — sprites, icons
docs/ — game design docs (combat, economy — spells/races are Game 2 scope)
guide/ — player guide web app (React/TypeScript)
engine/ — @magic-civ/guide-engine (shared components)
age-of-dwarves/ — guide pages for Age of Dwarves
packages/
engine-ts/ — @magic-civ/engine-ts (auto-generated climate simulation)
tools/ — sprite generation, transpiler, screenshot capture
Docs
Engine (engine/docs/)
| Doc | Covers |
|---|---|
| ARCHITECTURE.md | Project structure, autoloads, scene lifecycle |
| ABSTRACTION.md | Genre-agnostic vocabulary, theme pack system |
| DATA_FORMAT.md | JSON data schemas, DataLoader patterns |
Game Design (public/games/age-of-dwarves/docs/)
| Doc | Covers |
|---|---|
| RACES.md | 4 demo races, gendering, fusions, release schedule |
| ECONOMIC_SYSTEMS.md | Economy, civic axis, capitalism cascade |
| GOVERNMENTS.md | Government types and mechanics |
| GLOSSARY.md | Term definitions |
| COMBAT_SYSTEM.md | Combat mechanics (written when M8 is built) |
| military/COMMUNICATIONS.md | Comms tiers, first-contact, courier envelopes, perceived state, war-dec semantics |
| SPELL_SYSTEM.md | Spell/mana system (written when M9 is built) |
| ERA_SYSTEM.md | Era progression (written when needed) |
Build Process (.project/)
| Doc | Covers |
|---|---|
| ROADMAP.md | Demo scope + 12-phase build sequence |
| FEATURE_GAP.md | New systems beyond the reference implementation |
tasks/m0-m4/ |
Milestone task lists with porting checklists |
Quick Start
./run play # Launch the game
./run editor # Open Godot editor
./run lint # gdlint engine/src/
./run test # GUT tests headless
pnpm dev # Serve the player guide