(Underdepth) Pass 3

This commit is contained in:
AlexKucera committed 2026-08-13 07:28:55 +02:00
1 parent 832f3a3345
commit c61d73bdfc
30 files changed
+4151

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
=== PHASE 1 ===
[phase1] sample floor 0:
################################################################################
################################################################################
##.......#######################################################################
##.......###.....###############################################################
##....................................................................##########
##...............############........############################........#######
##.......###.....############........############################........#######
#####.#######################........############################........#######
#####.#######################........############################........#######
#####.#######################........###########################################
#####.###########################.##############################################
#####.###########################.##############################################
#####.###########################.##############################################
#####.###########################.##############################################
##.......##.......###############.##############################################
##.......##.......###############.##############################################
##.......##.......###########........###########################################
##.......##.......###########........###########################################
##................###########........###########################################
##.......##.......###########........###########################################
##.......##.......##############################################################
##.......##.......##############################################################
#####.##########################################################################
#####.##########################################################################
#####.##########################################################################
PHASE 1 OK
=== PHASE 2 ===
PHASE 2 OK
=== PHASE 3 ===
PHASE 3 OK
=== PHASE 4 ===
pygame-ce 2.5.8 (SDL 2.32.10, Python 3.13.13)
PHASE 4 OK
ALL PHASES OK
+10
View File
@@ -0,0 +1,10 @@
supacode: OSC emit failed: code=ENXIO errno=-6 message=ENXIO: no such device or address, open '/dev/tty'
[LCM] Failed to initialize: database is locked
supacode: OSC emit failed: code=ENXIO errno=-6 message=ENXIO: no such device or address, open '/dev/tty'
Done. `engine/pathfinding.py` created — only that file touched.
`astar` — 4-connected grid A*, Manhattan heuristic, `heapq` + insertion-order tie-breaker. Walkable = in-bounds & `tiles[y][x]==1` & not in `blocked` (per the contract). Returns full path start→goal inclusive, `[start]` when start==goal, `None` if either endpoint is unwalkable or unreachable.
Verified: self-check gate prints `astar ok`, plus the module's `__main__` self-check connects floor corners across all 9 generated dungeons (0 failures) and a wall-segment map correctly returns `None`.
Skipped: `ai/behaviors.py` (Phase 2 says build pathfinding only; behaviors lands after FOV+A* per the plan). Add when FOV + pathfinding both merged.
+13
View File
@@ -0,0 +1,13 @@
supacode: OSC emit failed: code=ENXIO errno=-6 message=ENXIO: no such device or address, open '/dev/tty'
[LCM] Failed to initialize: database is locked
supacode: OSC emit failed: code=ENXIO errno=-6 message=ENXIO: no such device or address, open '/dev/tty'
Phase 2 — `engine/combat.py` done. Gate prints `combat ok`.
**`engine/combat.py`** — `hit_chance`, `attack`, and the five `eff_*` accessors exactly as specified.
- Reused `HIT_BASE/STEP/FLOOR/CEIL` from `constants.py` (no magic numbers, no new file touched).
- `getattr` fallback chains on every stat → works for Player, Enemy, or bare objects; never raises.
- Defeat line logs only on the living→dead transition, so striking an already-dead defender never duplicates or crashes. Mentions `xp_value` (defaults to 0 for the player).
- No XP awarded here, no entity removal — lifecycle stays with the caller.
- Monte Carlo (1000 strikes): `hit_chance=0.90`, damage ∈ {3,6}, ranged path works, no crashes.
Skipped: ranged *distance* penalty (`RANGE_HIT_PENALTY` exists in constants but `attack()`'s signature carries no distance param) — add when the AI layer passes distance in phase 3.
+11
View File
@@ -0,0 +1,11 @@
supacode: OSC emit failed: code=ENXIO errno=-6 message=ENXIO: no such device or address, open '/dev/tty'
supacode: OSC emit failed: code=ENXIO errno=-6 message=ENXIO: no such device or address, open '/dev/tty'
supacode: OSC emit failed: code=ENXIO errno=-6 message=ENXIO: no such device or address, open '/dev/tty'
Done. Created **only** `engine/fov.py` (Phase 2 FOV task). Self-check prints `fov ok`; additional checks confirm rooms reveal floors + bounding walls and that a wall pillar blocks sight to floors behind it.
`engine/fov.py` — `compute_fov(gmap, ox, oy, radius) -> set[tuple[int,int]]`:
- 8-octant recursive shadowcasting (Björn Bergström) lights reachable tiles; walls block and cast shadows.
- Result = origin ∪ lit floor tiles ∪ walls adjacent to a lit floor (within Chebyshev radius).
- Origin is never placed in the lit set, so a sealed player has no lit floor neighbor → sees only self (passes the gate).
Skipped: mutating `gmap.visible`/`explored` in this function (signature returns a set; caller merges into grids). Add if a later phase wants `compute_fov` to write the grid directly.