5.1 KiB
Dungeon Crawler World — S4 Audio and visual verification
Prerequisites
Godot 4.2+ is required (verified with Godot 4.5). GUT 9.5.0 is vendored and pinned at addons/gut. Linux visual verification needs either an active display or xvfb-run; the verification script uses Xvfb automatically when DISPLAY is unset.
Run on Linux
"${GODOT_BIN:-$(command -v godot4 || command -v godot)}" --path .
Use WASD / arrow keys (and QEZC diagonals). Game.submit_test_action(Vector2i) is the deterministic public E2E seam and follows the same action processor as keyboard input.
Display, grid, and camera
The project reference viewport is 1280×720, with canvas-item stretching and a resizable window. Dungeon coordinates remain in the cell * 32 domain: MapRenderer.get_cell_rect(cell) returns the exact 32×32 world rectangle for a cell, and Game.get_actor_cell_rect(actor_id) exposes the effective actor image rectangle. Actor sprites are top-left anchored so their complete 32×32 image is contained in their cell before and after movement.
Camera2D follows the player after each valid action and is bounded to the map's world rectangle. The public HUD nodes stay below HUD (CanvasLayer, layer 1), so they remain viewport-anchored rather than moving with the camera.
Optional ASCII audio layout
Audio is optional presentation. Its absence, unknown requests, missing folders, bad files, and unsupported codecs never affect a turn or game startup. No audio files ship with this repository.
AudioLibrary first searches the directory named by DCW_AUDIO_HOME; when it is unset, it searches ~/.local/share/dcwascii. Place tracks in this exact layout:
<root>/
├── audio/
│ ├── exploration/
│ ├── combat/
│ └── danger/
└── sfx/
├── attack_given/
├── attack_received/
├── menu_select/
├── menu_cancel/
├── item_use/
└── death/
Admitted file extensions are .mp3, .ogg, .oga, .wav, .flac, .m4a, and .opus. AudioLibrary discovers the first admitted regular file in each requested directory and exposes that path only as diagnostics (get_last_ambience_path / get_last_sfx_path). This prototype never loads or plays external audio: it does not invoke AudioStream*.load_from_file, ResourceLoader, or another Godot loader on files below these roots, regardless of extension or apparent validity. A nominal or truncated .wav is therefore equally non-playable (has_playable_ambience() / has_playable_sfx() return false) and cannot affect gameplay. Directory discovery is deliberately best-effort and error-free; it is not a promise that the discovered file can be read or played. The game still selects exploration at startup, changes to combat for a combat result, and dispatches audio requests for player attacks, enemy attacks, and death without blocking those actions.
Example:
DCW_AUDIO_HOME="$HOME/.local/share/dcwascii" "${GODOT_BIN:-godot4}" --path .
Tests and visual check
GODOT_BIN=/snap/bin/godot4 ./scripts/test-unit.sh
GODOT_BIN=/snap/bin/godot4 ./scripts/test-e2e.sh
GODOT_BIN=/snap/bin/godot4 ./scripts/run-visual-check.sh
GODOT_BIN=/snap/bin/godot4 ./scripts/verify.sh
run-visual-check.sh runs the actual project with --capture, waits for it to render, logs output to artifacts/visual-check.log, and requires the project-owned capture at artifacts/visual-check.png to be a valid 1280×720 PNG. It chooses xvfb-run with a 1280×720 screen when no display is available, enforces a timeout, and reports unavailable (rather than a false pass) when neither a display nor Xvfb exists. verify.sh runs unit tests and headless E2E before visual verification; unavailable visual verification is reported distinctly from a failed test or failed visual capture.
For a direct headless startup check:
GODOT_BIN=/snap/bin/godot4 timeout 3s /snap/bin/godot4 --headless --path .
Exploration, combat, and HUD
GameState.visible_cellsrender at full brightness; cells retained inexplored_cellsrender dimly; unknown cells are black.- FOV is map-aware: walls and closed doors are visible but block cells behind them.
HUD/PlayerHealthLabel,HUD/EnemyHealthLabel,HUD/CombatSummaryLabel, andHUD/EventLogexpose the current combat state.- Every
meleeandenemy_meleeresult is routed to its actor view; the sprite's persistent red tint makes received damage visible.
Exports
Install the matching Godot export templates, then configure/export the project in the Godot editor for Linux/X11 or Windows Desktop. Linux builds may be tested on a Linux host with the resulting executable. Windows exports can be produced from Linux when the export templates are installed, but this project does not claim that a Windows export has been tested on Windows.
Limits
This compact prototype has one deterministic goblin, direct pursuit, no persistence or inventory UI, and persistent rather than animated damage tint. Audio remains intentionally nonblocking and uses no bundled assets.