1.9 KiB
1.9 KiB
| id | title | priority | status | scope | owner | updated_at | blocked_by | evidence | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| p2-58a | TileState fauna fields — fauna_density + fauna_index for AmbientTileCtx | p2 | done | game1 | shipwright | 2026-05-07 |
|
Summary
Adds fauna_density: f32 and fauna_index: Vec<SpeciesId> to TileState in mc-core
so AmbientTileCtx (mc-ecology) can be populated from the live GameState in the
per-tile-moved encounter hook (p2-58b).
SpeciesId is the existing string newtype from mc-core::ids (snake_case fauna species
identifier, e.g. "grey_wolf"). No new type was created.
Acceptance
- ✓
TileState.fauna_density: f32field added with#[serde(default)] - ✓
TileState.fauna_index: Vec<SpeciesId>field added with#[serde(default)] - ✓
cargo test -p mc-core tilestate_faunapasses — 3/3 tests green, including backward-compat deserialization (old save files without these fields default cleanly) - ✓
cargo check --workspaceclean of new errors (pre-existing solo_dominion MapUnit/GameState field errors are pre-existing tech debt, not introduced here)
Population note
fauna_density and fauna_index default to 0/empty. The ecology pipeline
(mc-ecology::fauna_select::pick_fauna_for_tile) must be wired to write these fields
back onto TileState after worldgen — tracked in p2-58b. Until then, encounter rolls
will always see density=0 and skip (correct behaviour for uninitialized maps).
Out of scope
- Wiring the ecology pipeline to populate these fields (p2-58b)
- The actual
AmbientTileCtxcall site inmc-turn::movement(p2-58b)