magicciv/.project/objectives/p3-13a-extend-meteorological-events.md
Natalie 3c76b6b47b fix(@projects/@magic-civilization): 🐛 update fauna species data files
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-04 07:12:33 -04:00

2.9 KiB

id title priority status scope owner updated_at evidence blocked_by
p3-13a Extend meteorological events — drought, flood, dust_storm p3 done game1 unassigned 2026-05-04
src/simulator/crates/mc-climate/src/weather.rs:225-303 — derive_events extended with drought/flood/dust_storm kinds
src/simulator/crates/mc-climate/src/weather.rs:60-117 — WeatherThresholds extended with new field set + JSON loader
src/simulator/crates/mc-climate/src/weather.rs:339-407 — three new tests (drought after N dry turns / flood on riparian saturation / dust_storm on arid high-wind), all passing under `cargo test -p mc-climate`
p0-36

Context

p0-36 shipped the baseline mc-climate::derive_weather_events returning rain/snow/wind events from the per-turn weather sample. The design in public/games/age-of-dwarves/docs/terrain/CLIMATE.md calls for a wider event vocabulary; this objective extends the meteorological set with drought (sustained low precipitation over N turns), flood (precipitation spike on saturated tile), and dust_storm (high wind on arid tile).

Acceptance

  • mc-climate::derive_events extended to emit drought, flood, dust_storm WeatherEvent records keyed by tile + severity per the rules in CLIMATE.md. (src/simulator/crates/mc-climate/src/weather.rs:225-303)
  • ✓ Each event type rides the existing typed WeatherEvent struct (kind-tagged; matches the storm/heat_wave/blizzard pattern shipped by p0-36). (src/simulator/crates/mc-climate/src/weather.rs:18-32)
  • ✓ Drought reads TileState.drought_counter (per-tile rolling dry-turn counter maintained by mc-ecology) and gates on drought_min_dry_turns from thresholds JSON; flood gates on TileState.riparian_distance (the saturation/proximity-to-water signal from mc-hydrology). (src/simulator/crates/mc-climate/src/weather.rs:230-271)
  • ✓ Events flow through the existing derive_events -> turn-pipeline path that p0-36 routes to EventBus.weather_event; new kinds use the same WeatherEvent shape so no UI/observation plumbing change is needed.
  • cargo test -p mc-climate — all 10 weather tests pass including test_drought_emits_after_n_dry_turns, test_flood_emits_on_saturation_spike, test_dust_storm_emits_on_arid_high_wind. (src/simulator/crates/mc-climate/src/weather.rs:339-407)

Source-of-truth rails

  • Rust crate: mc-climate::derive_weather_events (extension); mc-hydrology provides saturation query.
  • JSON path: public/resources/climate/_config.json (thresholds + window sizes).
  • mc-core wrapper: WeatherEvent enum + EventSeverity(u8) newtype.

Out of scope

  • Geological / biological / anomalous events — p3-13b/c/d.
  • Player remediation actions — separate ticket.

References

  • public/games/age-of-dwarves/docs/terrain/CLIMATE.md
  • public/games/age-of-dwarves/docs/terrain/WEATHER_HISTORY.md
  • Parent: p0-36
  • Siblings: p3-13b, p3-13c, p3-13d