Files
DungeonCrawlerWorld/task-G4-report.md
T

58 lines
3.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# G4 — Full visual presentation pass
## Scope
Implemented in the dedicated `slice/g4-presentation-polish` worktree only. No DCWASCII files were read or changed; no remote push or PR was made.
## Root cause
The pre-existing `EventPresenter` queued every `GameEvent` but passed all of them directly to `CombatFeedback`. `CombatFeedback.begin()` only animated movement, projectile/combat impact, and death kinds; door, chest, loot, trap, spell-start, and quest events were intentional no-ops. Consequently, the game had no explicit one-to-one semantic-to-presentation contract, no dedicated feedback views for exploration/narrative outcomes, and no way for a real scene test to observe presentation sequence independently from domain mutation.
## TDD presentation sequence
1. Established the pre-change unit baseline: **185 tests / 1,407 assertions**, passing.
2. Added the red mapping specification for the eight required kinds. Before implementation, the missing `map_event` API made the new test fail to compile/type-check, demonstrating that no mapping contract existed.
3. Added the real `Game.tscn` E2E sequence specification before implementation: combat, door, chest, loot, trap, spell, quest, death must emit exactly one ordered presentation event each.
4. Implemented the display-only mapping and feedback views, then ran unit and E2E suites green.
## Implementation
- Added immutable `PresentationEvent`, which wraps (without mutating) one source `GameEvent`, its feedback kind, notification text, and accent color.
- Extended `EventPresenter` with:
- explicit `map_event()` mapping for the required eight semantic categories;
- a `presentation_started` observation signal;
- queue-preserving dispatch to one appropriate feedback view;
- a structural `get_feedback_metrics()` seam (`mapped_kinds: 8`) without pixel snapshots.
- Added scene-owned feedback views:
- `DoorChestFeedback`: short 160 ms cyan/gold expanding marker;
- `LootFeedback`: short 160 ms gold/red/green floating notification for loot, traps, and quests.
- Kept combat/death in the existing short combat feedback path and gave untargeted spell casts a 120 ms non-blocking cast interval rather than a silent no-op.
- Wired the new views into `scenes/Game.tscn` under `EventPresenter`. Their colors follow the established blue-black dark UI palette and existing readable gold/cyan/red/green semantic accents.
- Added mapping unit coverage and `test_presentation_event_sequence_e2e.gd`, which instantiates the real game scene and asserts the full ordered sequence.
## Verification and capture evidence
`./scripts/verify.sh` passed after the final changes:
| Suite | Result |
| --- | ---: |
| Unit | 186 tests, 1,423 assertions passed |
| Integration | 11 tests, 59,470 assertions passed |
| E2E | 58 tests, 573 assertions passed |
| Visual structural captures | passed |
The existing non-brittle capture checker was run through the full verification command and confirmed both 1280×720 scripted reference scenes:
| Capture | dungeon non-black | visible | explored | unknown | explored luminance | unknown luminance |
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
| `visual-check.png` | 489,308 | 17,524 | 10,438 | 365,325 | 0.012 | 0.001 |
| `visual-check-exit.png` | 489,252 | 17,404 | 17,146 | 439,497 | 0.012 | 0.001 |
These metrics verify the dark-art visibility/fog structure rather than comparing brittle snapshots.
Additional review passed: `git diff --check` reports no whitespace errors.
## Commit / delivery
A local task commit is created after this report. It is intentionally not pushed and no PR is opened.