6.3 KiB
6.3 KiB
| id | title | priority | status | scope | owner | updated_at | evidence | blocked_by | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| p3-13b | Geological events — earthquake, volcanic_eruption, landslide | p3 | done | game1 | shipwright | 2026-05-13 |
|
Context
public/games/age-of-dwarves/docs/terrain/TECTONICS.md provides per-tile mountain_proximity and plate-boundary classification. This objective wires those into a mc-tectonics::derive_geological_events(turn, world) -> Vec<GeologicalEvent> step, emitting earthquake (boundary-adjacent low-prob roll), volcanic_eruption (active-volcano tiles), landslide (high-slope + saturated, joins flood from p3-13a).
Acceptance
- ✓
mc_mapgen::events::derive_events(re-exported asderive_geological_events) returnsearthquake,volcanic_eruption,landslideevents keyed by tile per rules inTECTONICS.md+ EVENT_FREQUENCY_SPEC.md. (src/simulator/crates/mc-mapgen/src/events.rs:142-256) Note: lives inmc-mapgennotmc-tectonics— the latter crate does not exist; tectonics is a module in mc-mapgen, so events derived from plate state belong there. - ✓ Each event variant emitted as kind-tagged
GeologicalEventstruct (mirrorsWeatherEventshape from p3-13a — no separate enum, kind in a String field for serde wire compat). (src/simulator/crates/mc-mapgen/src/events.rs:25-39) - ✓ Roll seeded via
SeedDomain::Geological(variant8, appended afterAiRolloutso existing worldgen ordinals stay frozen). Per-tile rolls flow throughmc_core::seed::derive_step(seed, SeedDomain::Geological, &[turn, col, row, channel])(mc-core/src/seed.rs:60-66,mc-mapgen/src/events.rs:183-198). Save back-compat preserved: existing TileState ordinals untouched; onlyis_active_volcano: boolwas appended with#[serde(default)]. Old det_roll mixer removed. - ✓
is_active_volcano: boolfield landed onTileState(mc-core/src/grid/mod.rs:238-247) with#[serde(default) = false]. Eruption branch (events.rs:240-249) gates on(is_active_volcano || plate_kind ∈ {VOLCANIC_ARC, HOTSPOT})— the flag is authoritative when set, the plate_kind proxy is retained as a fallback so saves predating the field keep firing eruptions.mountain_proximitystill scales severity (magma-pressure proxy). - ✓
mc-ecology::tile::apply_damagewiring —mc-sim::event_dispatch::dispatch_world_eventsroutes eachGeologicalEventthroughapply_damage(TileEcoState, DamageChannel::Land, severity)(and additionally Air for volcanic_eruption). Dispatch lives in mc-sim (not mc-turn) to avoid the mc-turn ← mc-mapgen ← mc-ecology cycle.ChronicleEntry::WorldEventpushed per event. Covered byp3_13_event_dispatch_geological_applies_land_damagein mc-sim. (src/simulator/crates/mc-sim/src/event_dispatch.rs:104-120) - ✓
cargo test -p mc-mapgen events::green — 6 tests includingearthquake_only_at_plate_boundary,volcanic_eruption_only_on_volcanic_plate,landslide_requires_slope_and_saturation,determinism_same_seed_same_events. (src/simulator/crates/mc-mapgen/src/events.rs:262-372)
Source-of-truth rails
- Rust crate:
mc-tectonicsowns geological event derivation. - JSON path:
public/resources/tectonics/_config.json(probabilities, severity ranges). - mc-core wrapper:
GeologicalEventenum; reusesEventSeverityfromp3-13a.
Out of scope
- New plate-boundary classification — already shipped in worldgen.
- Player intervention to prevent eruptions — magic-school work, Game 3.
- Long-term landform regeneration — single tick effect only.
References
public/games/age-of-dwarves/docs/terrain/TECTONICS.mdpublic/games/age-of-dwarves/docs/terrain/WORLDGEN_RNG.md- Sibling:
p3-13a,p3-13c,p3-13d