(Underdepths) Pass 7

This commit is contained in:
AlexKucera committed 2026-08-16 19:10:31 +02:00
1 parent 13512b0476
commit 952ff4b734
39 files changed
+7988

No files matched your search

+148
View File
@@ -0,0 +1,148 @@
ALL_PASS
Goal backstop audit — every plan.md Acceptance Criteria checkbox, criterion by
criterion, with the automated evidence that verifies it. All checks below were
run against the current tree and passed.
## Fixes made during this backstop
1. main.py: `--max-frames` was parsed but never passed to run() (dead flag, so
the loop could not be bounded). Now wired: `run(max_frames=args.max_frames)`.
2. main.py: added `--soak-seconds/--soak-seed` — a random-input soak driver over
the real Game loop (menu -> New Game -> hold/release directions, g/f/b/i/e/
q/r/?/m/S), proving continuous crash-free play for a wall-clock budget.
3. engine/pathfinding.py `__main__` self-check: sampled enemy-occupied floor
tiles as A* goals; enemies legitimately seal chokepoints (plan: occupied
tiles are impassable), so the any-two-tiles contract is now asserted over
free tiles with walls-only blocking. Not a game-logic bug (maps flood-fill
100% connected; 483/483 tiles on the failing case).
4. render/renderer.py: critical hits now burst the (previously defined but
unused) "crit" star particles in addition to the attack lunge.
5. tests/smoke.py gates strengthened:
- phase 1: 45 maps (5 seeds x 9 floors) instead of 9; layout-uniqueness
asserted per floor across seeds (tiles derive from seed alone).
- phase 4: added `data.sprites`, `render.sprites`, `render.effects`
self-checks and a 60 s random-input soak to the gate list.
## Verification battery (all green)
- `python tests/smoke.py` — all 4 phase gates PASS (includes 45-map gate,
pixel-art self-checks, 60 s soak, full headless playthrough).
- Module self-checks: data.sprites (47 distinct sprites), render.sprites
(cached rasterization, no enemy/item signature collisions, equipment layers
change the player sprite), render.effects, engine.fov, engine.pathfinding,
engine.clock, engine.audio, engine.serializers, render.renderer — all PASS.
- `python main.py --headless-smoke` on seeds 7, 1, 2, 42 — PASS.
- `python main.py --soak-seconds 310 --soak-seed 42` — 310 s (> 5 minutes) of
continuous random play, 794 turns, no crash.
- `python main.py --max-frames 600` under dummy drivers AND on the real
display/audio path — clean exit 0.
- 72-map measurement (8 seeds x floors 0-8): avg 9.9 rooms (8-12), avg 9.5
corridor sections/map, avg 0.7 junctions/map, longest section 14/14,
exact enemy density 4,6,...,20 on every map, full-floor flood-fill
reachability + stairs on a reachable floor tile on every map, guaranteed
reachable Shoes of Hermes (floor 2) and Hunter's Bow (floor 3) across seeds.
## Floor (must-haves) — 15/15
- [x] Launches via `python main.py` — real-driver run exits 0; dummy-driver
bounded run exits 0; `--help` works.
- [x] 5 minutes continuous play — 310 s soak PASS (794 turns).
- [x] Main menu New Game / Continue / Quit — headless smoke asserts entries;
Continue appears only with a save and restores it.
- [x] WIN state — dragon kill sets STATE_VICTORY via real input (smoke) and
real action paths (phase 3, 10/10 arena fights).
- [x] LOSE state — player death sets STATE_DEAD, death screen, save deleted
(smoke + phase 3).
- [x] 10 procedurally generated floors — `len(dungeon) == 10` asserted;
per-floor layout uniqueness across seeds asserted (phase 1).
- [x] 6 regular + 1 boss enemy types — ROSTER == 7, every template spawned
and stat-verified (phase 3).
- [x] How to Play from menu + before every New Game, `?` reopens — smoke.
- [x] Exact contextual keys — "Press G to pick up the X." / "Press F to
descend." asserted verbatim; g/f work through real input; floor-9 f is
a safe no-op with an explanatory log.
- [x] Sound effects when audio exists; silent fallback — engine.audio
self-check + forced mixer-init failure stays playable (smoke).
- [x] Distinct procedural pixel-art, no external files — 47 hand-coded
pattern sprites in data/sprites.py; rasterizer self-check proves >= 3
colors each and no signature collisions; renderer draws through the
cached sprite path only; no image/audio/font assets loaded anywhere.
- [x] Every floor winnable — 72 maps: stairs on floor tiles reachable from
spawn; renderer blits the `>` staircase sprite whenever explored
(render.renderer self-check samples actual screen pixels for the
glowing yellow stairs); floor 9 won by slaying a damageable dragon
(guaranteed floor-6 Battle Axe: 4+7 > armor 8; 10/10 simulated wins).
- [x] Compact generation — longest measured section 14/14 across 72+45 maps;
endpoints touch recorded rooms/junctions; no unrecorded carving.
- [x] Density strictly 4..20 — exact counts measured on every map.
- [x] Shoes of Hermes — guaranteed reachable on floor 2; 180 ms/75 ms cadence
unit-asserted (clock self-check), driven through the real input clock in
the smoke (complete turns, stop on release/block/menu/floor/death/
victory all covered).
- [x] Hunter's Bow — guaranteed reachable on floor 3; b prefers the fleeing
target over a nearer chaser (phase 3 + real-key smoke), walls block,
turn spent, ranged kill with correct logs.
## Systems Depth — 10/10
- [x] A* — from-scratch, Manhattan, occupancy-aware; goblin chases through a
corridor (phase 2); walls-only connectivity over free tiles (self-check).
- [x] FOV — recursive shadowcasting, radius 8, walls occlude, explored tiles
persist darker (fov + renderer self-checks sample real pixels).
- [x] Procedural generation — BSP 8-12 rooms, junction partitioning, unique
layouts per seed, 14-step cap measured.
- [x] Enemy AI — wander/chase/ranged-kiting/phase all implemented and tested;
plus split (slime, phase 3) and the dragon breath weapon.
- [x] Combat — hit chance formula, armor reduction, crits, all outcomes
logged; bow kills a fleeing target.
- [x] Progression — XP, thresholds per plan, stat gains, full heal on level
up, level-up log line.
- [x] Items & inventory — 26 slots, 3 equip slots, 3 potions + 3 scrolls
(6 distinct effects), Shoes/Bow verified.
- [x] Save/load — S save+quit; Continue restores exact state incl. equipped
boots/bow, timers, explored grids, per-entity HP (serializers + smoke).
- [x] Control usability — the automated input smoke test does exactly what
the checkbox describes (item under player + g, stairs + f, movement
clock timing without/with Shoes, stops on all listed interrupts).
- [x] Audio safety — in-memory tones via array, mute toggle, forced
mixer-init failure does not crash.
## Visual Polish — 5/5
- [x] Procedural pixel-art — every entity/tile/item is a multi-color pattern;
7 enemies + small slime variant + equipment-layer player + Bow + winged
Shoes + 14 item icons + stairs, each signature-distinct.
- [x] Lighting — radial torch falloff to radius 8, flicker, explored tint,
wall occlusion from the FOV grid, screen vignette.
- [x] Depth & shadow — beveled 3-variant walls, 3-variant dithered floors,
per-tile seeded variation, soft ellipse shadows under entities/stairs.
- [x] Juice — particles on hits/crits/deaths/pickups/level-ups/stairs shimmer
(capped pool), screen-shake on damage, eased camera, idle bob + attack
lunge + hit-flash, floating combat text.
- [x] Polished UI — bordered panels, heart-icon HP bar (red when low),
star-icon XP bar, floor/turn labels, 8-line color-coded log, equipment
slot icons, effect timers, sound icon, `B: Fire` + winged HOLD indicator,
styled context prompt chip.
## Video Requirements — 4/4 (in-game capability verified; recording is manual)
- [x] Core loop — move/explore/fight/loot/descend, Shoes held-run, bow shot at
a fleeing target: all exercised by the automated playthrough.
- [x] Systems interacting — enemy A* through the generated dungeon while FOV
gates both rendering and enemy sight (mutual vision via the FOV grid).
- [x] Death — player dies, game-over screen, any key returns to menu.
- [x] Save/quit/relaunch/continue — S quits to menu with the save persisted;
Continue restores the run including equipment.
Note: these checkboxes describe what the submission video must show; every
capability they name is implemented and machine-verified above. Producing
the continuous-take recording itself is a human step.
## Commands to reproduce
python tests/smoke.py
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python main.py --headless-smoke
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python main.py --soak-seconds 310
python -m data.sprites && python -m render.sprites && python -m render.effects
python -m engine.fov && python -m engine.pathfinding && python -m engine.clock
python -m engine.audio && python -m engine.serializers && python -m render.renderer