(Underdepths) Prepare for Pass 7
This commit is contained in:
30 files changed
+183
-5713
No files matched your search
+51
-22
@@ -81,9 +81,12 @@ Write `orchestrate.sh`, `tests/smoke.py` (stub with phase functions), and
|
||||
**Phase 1 — Foundation:**
|
||||
- Build: `data/constants.py`, `entities/entity.py`, `engine/map_gen.py`,
|
||||
`entities/player.py`, `entities/enemy.py`, minimal `main.py` game loop.
|
||||
- Gate: generate 5 maps, assert each has ≥3 rooms, all rooms reachable via
|
||||
flood fill, no room overlaps, and (floors 0–8) `stairs_down` is a floor tile
|
||||
reachable from the spawn room. Print ASCII render to confirm.
|
||||
- Gate: generate at least 5 maps, assert each has 8–12 BSP rooms, all rooms reachable
|
||||
via flood fill, no room overlaps, and every stored corridor path has
|
||||
`len(path) - 1 <= MAX_CORRIDOR_LENGTH == 14`. Verify every path tile is floor,
|
||||
every endpoint touches a recorded room or junction, and the generator carved no
|
||||
unrecorded corridors. On floors 0–8, `stairs_down` must be a floor tile reachable
|
||||
from the spawn room. Print an ASCII render and the measured longest section.
|
||||
|
||||
**Phase 2 — Core Systems (parallelizable):**
|
||||
FOV, A*, and combat are independent. Dispatch them as separate `pi -p`
|
||||
@@ -97,19 +100,28 @@ calls that can run concurrently:
|
||||
(enemy chases player through a test corridor)
|
||||
|
||||
**Phase 3 — Content Layer:**
|
||||
- Items, inventory, equipment, potions, scrolls
|
||||
- Items, inventory, weapon/armor/boots equipment, potions, scrolls
|
||||
- Guaranteed Shoes of Hermes on display floor 2 and Hunter's Bow on display floor 3
|
||||
- Bow ranged attack and the Shoes' held-running capability flag
|
||||
- XP, leveling, progression
|
||||
- All 7 enemy types with behaviors
|
||||
- All 7 enemy types with behaviors; regular-floor initial density is exactly
|
||||
`4 + 2 * floor_index` (4, 6, 8, …, 20)
|
||||
- Boss arena on floor 9
|
||||
- Gate: spawn each enemy type, verify stats. Equip item, verify stat changes.
|
||||
Kill enemy, verify XP + level-up at threshold.
|
||||
- Gate: spawn each enemy type and verify stats; verify exact strictly increasing
|
||||
density on floors 0–8 and the guaranteed reachable Shoes/Bow placements. Equip
|
||||
every slot and verify stat/capability changes. Through the normal Bow action,
|
||||
place a nearer chasing target and a farther fleeing target and verify the fleeing
|
||||
target is selected; place a target behind a wall and verify it cannot be hit;
|
||||
verify a valid shot spends a turn and can damage/kill with correct logs. Kill an
|
||||
enemy and verify XP + level-up at threshold.
|
||||
|
||||
**Phase 4 — Polish, Visuals, Audio & Persist:**
|
||||
- Save/load JSON, menu system, death/victory screens, UI panels
|
||||
- A visible How to Play screen, contextual pickup/stairs prompts, and simple generated sound effects with graceful silent fallback
|
||||
- Procedural pixel-art sprites / effects / lighting / UI per plan.md Rendering (`data/sprites.py`, `render/sprites.py`, `render/effects.py`)
|
||||
- Poll held direction keys only while Shoes of Hermes are equipped: one immediate step, 180 ms initial delay, 75 ms repeat, one complete turn per repeated step, immediate stop on release/block/menu/floor/state change/death/victory
|
||||
- Procedural pixel-art sprites / effects / lighting / UI per plan.md Rendering, including distinct Bow and winged Shoes (`data/sprites.py`, `render/sprites.py`, `render/effects.py`)
|
||||
- This phase is large — split it into sequential sub-dispatches (e.g. 4a persistence+audio, 4b actions+render+sprites+main) that run BEFORE the single phase gate, if one dispatch cannot finish within the TTL
|
||||
- Gate: save → load → assert state equality; all menu states reachable; simulated `g` pickup and `f` descent work; audio-disabled mode does not crash; **stairs are visibly rendered** (the renderer blits a distinct stairs sprite on `stairs_down` — assert this, since invisible stairs make the game unwinnable).
|
||||
- Gate: save → load → assert state equality including weapon/armor/boots; all menu states reachable; simulated `g` pickup and `f` descent work. Drive the real movement input clock: without Shoes, holding moves once; with Shoes, assert no repeat at 179 ms, one at 180 ms, then one per 75 ms, and no further movement after release, block, menu, floor change, death, or victory. Through real `b` input, assert the Bow prefers a fleeing target over a nearer chaser, cannot shoot through a wall, spends a turn, and can kill. Audio-disabled mode does not crash; **stairs are visibly rendered** with a distinct stairs sprite on `stairs_down`.
|
||||
|
||||
### Goal backstop
|
||||
|
||||
@@ -129,9 +141,12 @@ with a diagnostic.
|
||||
|
||||
### Operational hardening (learned the hard way)
|
||||
|
||||
- Wrap EVERY `pi -p` dispatch in `timeout --kill-after=30 <ttl>`. The pi (node)
|
||||
process ignores SIGTERM, so plain `timeout <ttl>` lets a stuck dispatch linger
|
||||
past its deadline and stall the whole loop. `--kill-after` escalates to SIGKILL.
|
||||
- Bound EVERY `pi -p` dispatch with a hard TTL and SIGKILL escalation. Use GNU
|
||||
`timeout --kill-after=30` when available, or Homebrew's `gtimeout` on macOS.
|
||||
Detect the executable at startup. If neither exists, implement the same behavior
|
||||
with Python stdlib `subprocess.Popen(start_new_session=True)`, `wait(timeout=...)`,
|
||||
and `os.killpg(..., signal.SIGKILL)`; never run an unbounded dispatch. The pi
|
||||
(node) process ignores SIGTERM, so plain timeout handling can stall the pipeline.
|
||||
- Never run two `orchestrate.sh` instances in the same directory at once:
|
||||
concurrent `pi -p` agents editing the same files corrupt them. The pipeline is
|
||||
resumable via `.build_state` — just re-run a single instance.
|
||||
@@ -151,29 +166,43 @@ proceed if it fails. Fix the failure, then continue.
|
||||
|
||||
ALL acceptance criteria in `plan.md` → Acceptance Criteria section must pass.
|
||||
The game must be playable start to finish via `python main.py`. It must not
|
||||
crash. It must have win and lose states. It must save and load. Controls must
|
||||
be explained in-game, with contextual prompts for item pickup and stairs.
|
||||
It must look polished: distinct procedural pixel-art sprites, FOV lighting, particle juice, and a clean bordered UI — not flat colored squares.
|
||||
crash. It must have win and lose states. It must save and load. Corridors must
|
||||
stay within the 14-step section limit, monster density must rise every regular
|
||||
floor, Shoes of Hermes must provide deliberate hold-to-run, and the Bow must let
|
||||
the player shoot visible fleeing enemies. Controls must be explained in-game,
|
||||
with contextual prompts for item pickup and stairs. It must look polished:
|
||||
distinct procedural pixel-art sprites, FOV lighting, particle juice, and a clean
|
||||
bordered UI — not flat colored squares.
|
||||
|
||||
When you believe you are done:
|
||||
1. Run `python tests/smoke.py` — must pass.
|
||||
2. Run `python main.py` and play through: read How to Play, move, fight, stand
|
||||
on an item and press `g`, stand on stairs and press `f`, save,
|
||||
quit, relaunch, and continue. Confirm sound effects play when audio exists
|
||||
and the game still works when audio initialization fails.
|
||||
3. Check every acceptance criterion checkbox in `plan.md`.
|
||||
4. If anything fails, fix it. Do not stop until all pass.
|
||||
on an item and press `g`, equip Shoes of Hermes and hold/release a direction,
|
||||
equip the Hunter's Bow and shoot a fleeing enemy with `b`, stand on stairs and
|
||||
press `f`, save, quit, relaunch, and continue. Confirm sound effects play when
|
||||
audio exists and the game still works when audio initialization fails.
|
||||
3. Generate multiple maps and inspect the longest corridor plus regular-floor
|
||||
enemy counts.
|
||||
4. Check every acceptance criterion checkbox in `plan.md`.
|
||||
5. If anything fails, fix it. Do not stop until all pass.
|
||||
|
||||
## What Kills Entries
|
||||
|
||||
- **Crashes during play.** Every code path must be safe. Test edge cases:
|
||||
empty inventory, no item at feet, attacking with full HP enemy, descending
|
||||
stairs on the last floor.
|
||||
empty inventory, no item at feet, attacking a full-HP enemy, and attempting
|
||||
descent on floor 9 where `stairs_down` is `None` (it must safely do nothing).
|
||||
- **Hidden or broken controls.** The game must visibly explain controls. While the
|
||||
player stands on an item show `Press G to pick up`; while on stairs show
|
||||
`Press F to descend`. Automated tests must exercise both actions.
|
||||
- **Systems that don't actually work.** If A* is there but enemies walk into
|
||||
walls, the judge sees that. Each system must be genuinely functional.
|
||||
- **Long, empty traversal.** Every generated corridor section must be at most 14
|
||||
steps, and initial monster counts on floors 0–8 must be exactly 4 through 20 in
|
||||
increments of 2. Tests must measure both rather than trusting constants.
|
||||
- **Fake mobility or ranged items.** Shoes of Hermes must poll held keys and apply
|
||||
complete turns until release; OS key repeat is not the feature. The guaranteed
|
||||
Hunter's Bow must fire with `b`, respect visibility/range/walls, spend a turn,
|
||||
and be able to damage and kill a fleeing enemy.
|
||||
- **Unwinnable floors.** Every floor 0–8 MUST have stairs on a floor tile
|
||||
reachable from spawn AND visibly rendered (the `>` staircase) so the player
|
||||
can find it and press `f` to descend. Floor 9 is won by slaying a dragon the
|
||||
|
||||
Reference in new issue
Block a user