(Underdepths) Prepare for Pass 4

This commit is contained in:
AlexKucera committed 2026-08-13 09:05:25 +02:00
1 parent e2a47aba6b
commit 8249da7e9b
33 files changed
+123 -4173

No files matched your search

+28 -3
View File
@@ -9,7 +9,7 @@ for all gameplay mechanics, data, and acceptance criteria.
## Tech Stack
- Python 3.11+
- pygame-ce (rendering + input only)
- pygame-ce (rendering + input + generated audio)
- Standard library for everything else (json, random, math, dataclasses, heapq, array)
- No other third-party packages unless absolutely necessary
@@ -23,6 +23,7 @@ for all gameplay mechanics, data, and acceptance criteria.
should never raise on valid game states.
- The message log is the primary feedback mechanism. Every combat event,
item pickup, level-up, and status change must log a human-readable message.
- Rendering is pure: it reads `GameSession` and draws, never mutates state. Split it into `renderer` (composition), `render/sprites` (pixel-art rasterization + Surface caching), and `render/effects` (lighting/particles). Cache sprite Surfaces; do not rebuild them per frame.
## Architecture Rules
@@ -40,6 +41,10 @@ This project uses a **self-driving build pipeline**. Your first action is to
write `orchestrate.sh` — a bash script that drives the entire build using
`pi -p` (non-interactive mode) as the build primitive. Then you execute it.
All `pi -p` dispatches use the DEFAULT model — never pass `--model` or
`--provider`. The entire build must run on whatever model is configured as the
default, so it works unchanged on any default model.
### How it works
```
@@ -98,9 +103,11 @@ calls that can run concurrently:
- Gate: spawn each enemy type, verify stats. Equip item, verify stat changes.
Kill enemy, verify XP + level-up at threshold.
**Phase 4 — Polish, Audio & Persist:**
**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`)
- 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.
### Goal backstop
@@ -119,6 +126,20 @@ next `pi -p` call, not just "try again." The agent sees what broke and
fixes specifically that. Max 3 retries per phase before the pipeline halts
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.
- 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.
- If a phase is too large for one bounded dispatch (the agent emits little/no
output as it nears the TTL — it is over-planning), split it into sequential
sub-dispatches that run before the single phase gate. Phase 4 (game-state +
serializers + audio + actions + render + sprites + main) is the usual candidate.
- A per-dispatch TTL around 50 minutes is a sane ceiling.
## Build Order
Follow the phase definitions in the Orchestration section above. Build
@@ -131,6 +152,7 @@ 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.
When you believe you are done:
1. Run `python tests/smoke.py` — must pass.
@@ -153,10 +175,13 @@ When you believe you are done:
walls, the judge sees that. Each system must be genuinely functional.
- **Stopping early.** The prompt must produce a complete game. If you finish
a phase and the acceptance criteria aren't all met, keep building.
- **Flat colored-square art.** Entities/tiles drawn as plain rectangles read as
unfinished. Procedural pixel-art sprites (distinct per type), lighting, and
particles are required — see plan.md Rendering.
## Anti-Patterns to Avoid
- Don't add networking or graphical assets (sprites/tiles).
- Don't add networking, and don't load external image / sprite-sheet / font / audio asset files. All art is procedural pixel-art drawn from in-code palettes with `pygame.draw`. Plain flat colored rectangles for entities or tiles are NOT acceptable — they read as unfinished; see plan.md Rendering.
- Don't add music, external audio files, or a complex audio engine. Generate a
few short tones with pygame and continue silently if no audio device exists.
- Don't build a character creation screen or class system.