2.5 KiB
Task 13: reikhelm-viz Renderer
Depends on: Task 5, Task 12
Context Files
.dev/2026-05-28-procgen-map-core/spec/design.md— §6 (viz crate), §3 (Mapcontract — renderer reads data only).reikhelm-core/src/map.rs—Map,Tile(Task 5).reikhelm-core/src/recipes/dungeon.rs—dungeon(),DungeonConfig(Task 12).reikhelm-core/src/pass.rs—Pipeline::run/run_with_snapshots(Task 6).reikhelm-viz/Cargo.toml—macroquaddependency (Task 1).
Files
- Modify:
reikhelm-viz/src/main.rs— macroquad window rendering aMap.
What to Build
The interactive renderer (spec §6). A macroquad binary that builds a dungeon from the dungeon recipe at a fixed DungeonConfig, then each frame draws one colored rectangle per cell, colored by Tile (e.g. Wall dark, Floor light, Door accent). Pressing the reroll key (Space) increments the seed and regenerates; the current seed is drawn on screen. Cell pixel size derives from window size / map dimensions.
Stretch (in scope if straightforward): generate via run_with_snapshots and let Left/Right arrows scrub through the generation stages, drawing the snapshot at the current index (and a label). Because snapshots carry regions + edges too, the partition and connect stages are visible even though they don't change tiles — draw region outlines / edges for those frames.
The renderer must contain no generation logic and reach into no engine internals beyond the public Map/recipe API (spec §3, §6) — that boundary is the proof the architecture holds.
Interface Dependencies
- Consumes:
dungeon(),DungeonConfig(Task 12);Map,Tile(Task 5);Pipeline::run/run_with_snapshots(Task 6). - Produces: the
reikhelm-vizbinary.
Tests
- Rendering is interactive/visual — no unit tests required. Validation is manual via the success criteria below.
- (Optional) a
color_of(Tile) -> Colorhelper can have a trivial unit test if extracted.
Success Criteria
cargo run -p reikhelm-vizopens a window showing a dungeon as colored tiles.- Pressing Space generates a new dungeon (new seed); the seed is visible on screen.
reikhelm-vizcontains no generation logic and uses onlyreikhelm-core's public API.cargo buildof the whole workspace succeeds.- (Stretch) Left/Right scrub generation stages, with partition/connect stages visibly distinct.
Commit
"feat(viz): macroquad dungeon renderer with seed reroll"