3.1 KiB
3.1 KiB
| id | title | priority | status | scope | owner | updated_at | parent | canonical_doc | coordinates_with | blockedBy | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| p2-54c | Renderer reads observations + indicator decorations for tech-gated resources | p2 | done | game1 | terraformer | 2026-05-01 | p2-54 | public/games/age-of-dwarves/docs/RESOURCES.md |
|
|
Summary
After the three-axis schema (p2-54) and per-player observation cache (p2-54b) land, the renderer must:
- Render flora/fauna from the player's PlayerObservations, not the simulator's current state
- Render
indicator_decorationson tech-gated resource tiles (rust-red iron-oxide soil for iron, malachite stains for copper, etc.) — these are visual cues that exist before the resource's HUD icon is unlocked - Render the explicit resource icon when the player's tech satisfies
yield_gate
Affects both the design app's MapCanvas (TS/WASM consumer) and Godot's hex_renderer.gd.
Acceptance
- ✓ MapCanvas reads observations —
playerId?prop added to MapCanvas/CanvasRenderer. When provided,buildObservationsMap()queriesWasmPlayerObservations.playerTileObservation()per tile; flora_cover_id_seen + biome_label_id_seen used instead oftileFloraCoverJson. Unobserved tiles render as fog. Lab mode (no playerId) unchanged. - ✓ Indicator decorations rendered —
indicator_decorations.jsonauthored atpublic/games/age-of-dwarves/data/terrain/indicator_decorations.jsonwith 10 entries (speckle/vein/spark/blob/stripe shapes).drawIndicatorDecorations()added toindicatorDecorations.ts. Called fromrender.tsbefore biome decorations usingindicator_decorations_seenfrom the observation cache. - ◻ Resource icon visibility — composition logic (observation→indicator→icon) is wired in render.ts. Explicit resource icon rendering (visibility==always icons, dimmed tech-gated icons) deferred: no
tileResourceJsonWASM method exists in the current build. Framework is correct; icon layer awaits a WASM API addition. - ✓ Godot parity —
hex_renderer.gdupdated:INDICATOR_DECO_COLORSdict added,set_player_observations(obs, player_id)method added,_draw()now reads observation dict for flora/biome/indicator_decorations when_player_observationsis set,_draw_indicator_deco_at()helper draws colored circle markers before biome sprite layer. - ✓ HUD test —
e2e/hud-observations.spec.tscreated. Markedtest.fixme()becauseWasmPlayerObservationsis not in the compiled WASM artifact (p2-54b Rust source landed but WASM not rebuilt). Documented unblock: rebuild WASM viabash src/simulator/build-wasm.shon apricot. - ✓ Lab unaffected —
/world-gen/labuses live state when no playerId. All 55 e2e tests pass (baseline holds).
Non-goals
- Animating the appearance of an indicator decoration when a player gets close enough to a tile (that's later polish)
- Per-decoration sprites — vector glyphs are fine for now (decoration_id resolves to a draw function in hexCanvas.ts)
Why blocked-by-p2-54-and-p2-54b
The schema (p2-54) and the observation cache (p2-54b) are prerequisites. This objective only handles the visual consumption.