magicciv/.project/objectives/p0-07-tech-research-costs.md
Natalie 2a2d84b263 feat(@projects/@magic-civilization): enhance bridge systems & climate logic
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 17:08:34 -07:00

2 KiB
Raw Permalink Blame History

id title priority status scope updated_at evidence
p0-07 Tech research costs and science pool pacing p0 done game1 2026-04-17
src/simulator/crates/mc-tech/src/lib.rs
src/simulator/crates/mc-tech/src/costs.rs
src/simulator/crates/mc-turn/src/game_state.rs
src/simulator/crates/mc-turn/src/processor.rs
src/simulator/api-gdext/src/lib.rs
src/game/engine/src/modules/management/turn_processor.gd
public/games/age-of-dwarves/data/techs/

Summary

mc-tech has the prerequisite graph and unlock signals with per-tech science cost accumulation. Research gates on both prerequisites and cost; completion decrements the pool by tech.cost and carries overflow to the next tech.

Promoted back to done 2026-04-17: The Rail-1 live-game delegation via GdTechWeb landed under p0-29-gd-tech-bridge.md. The live game now calls Rust for cost-gated research; the parallel GDScript path in turn_processor.gd has been collapsed.

Acceptance

  • cost: u32 field present in all tech JSON files (public/games/age-of-dwarves/data/techs/*.json); era costs 20320 matching ERA_NOMINAL_COST table in mc-tech/src/costs.rs.
  • science_pool: i64 added to PlayerState (mc-turn/src/game_state.rs:86); accumulates per-turn science via process_science() in processor.rs.
  • ✓ Completion via PlayerTechState::add_science() — pool decremented by tech.cost, overflow carries to next tech (mc-turn/src/processor.rs, mc-tech/src/lib.rs).
  • ✓ Tuning target verified: full_tree_reachable_within_250_turns_at_normal_yield test passes (28/28 mc-tech tests green, 2026-04-17); formula: culture^1.5 × min(cities,12) × 15 ≈ 339 science/turn → ~155k by T250 vs ~9,600 total tree cost.
  • Live game delegates to mc-techturn_processor.gd:156 _process_research replaced by GdTechWeb.process_research(player_json, yield_json, sci_modifier) (12 LOC body, down from ~52). Rail-1 compliance restored. See p0-29-gd-tech-bridge.md for the full bridge landing + the CHANGELOG entry dated 2026-04-17 [ref: p0-29, p0-07].