3.5 KiB
Task B5 — Floor 0, descent/ascent and multi-floor state
- Worktree:
/home/hectelyon/Documents/Projects/ProjetsPersos/DungeonCrawlerWorld/.worktrees/b5 - Brief:
docs/superpowers/plans/2026-10-02-full-dcwascii-godot-port.md, Task B5 - Scope: authored surface floor, deterministic procedural floor transitions, cached per-floor state, and transition UI/tests. B6 time pressure, deadlines, beds, collapse, and staircase gating are deliberately not included.
Delivery
- Added
SurfaceGenerator: a fixed authored 30×20 floor 0 with the existing tutorial door/chest/stairs layout, entrance(4, 12), exit(18, 4), andhand_authoredmetadata. - Added
FloorTransitionin the planned run-domain location. It caches floors by number inRunState, uses the existing deterministicseed-floorNgenerator for procedural floors, and makes both the entry/up stair and exit/down stair explicit on generated floors. - Descending from floor 0 reaches generated floor 1 at its entrance; using that entry stair returns to cached floor 0 at its exit. Each later procedural floor follows the same up/down convention.
Gameswaps the activeFloorState, map renderer visibility, player/camera, enemy views, and HUD after a stair interaction.GameState.set_floor_statecentralizes the active-floor aliases and FOV refresh.- Persistent visited-floor state is retained through the cached
FloorState; chest opening now marks its floor-state chest record open as well as changing the map cell. - HUD distinguishes floor-1+ entry stairs with
Espace — Monter l’escalier; exit/down stairs retainEspace — Descendre l’escalier. - Added unit coverage for authored-vs-procedural/deterministic floors and cache persistence, plus a real menu E2E descent and return trip. Existing stair and route E2Es now assert the actual floor transition.
Failure correction during finalization
The first complete E2E run found two stale expectations in pre-existing B5-adapted E2Es: following descent to floor 1, they still expected the down-stair prompt. The implementation correctly puts the player on the generated floor's up stair, so the tests were corrected to require Monter l’escalier.
A standalone visual capture initially exposed strict GDScript warnings treated as errors in three pre-existing dependency scripts (Variant type inference). Explicit type annotations were restored because the new transition imports that dependency path and visual verification must compile it. No behavior was changed by those annotations.
Verification
Executed with Godot 4.5.0 (/snap/bin/godot4):
./scripts/test-unit.sh PASS — 73 tests, 734 assertions
./scripts/test-integration.sh PASS — 4 tests, 9,239 assertions
./scripts/test-e2e.sh PASS — 19 tests, 217 assertions
./scripts/run-visual-check.sh PASS — Xvfb capture and PNG validation
./scripts/verify.sh PASS — unit + integration + E2E + visual
git diff --check PASS
Visual capture artifacts (ignored by Git) were produced and validated:
artifacts/visual-check.png:
dungeon_non_black_pixels=489308
visible_pixels=17524
explored_pixels=10438
unknown_pixels=366972
artifacts/visual-check-exit.png:
dungeon_non_black_pixels=489252
visible_pixels=17404
explored_pixels=17146
unknown_pixels=441144
The test/visual runners report pre-existing GUT resource UID warnings and ObjectDB/resource cleanup diagnostics on exit. They have no SCRIPT ERROR or Parse Error; all runner exit statuses were successful.
Git
Local commit only; no push or PR.