145 lines
8.0 KiB
Markdown
145 lines
8.0 KiB
Markdown
# UI, Input, Loot, and 1080p Fixes Implementation Plan
|
||
|
||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||
|
||
**Goal:** Corriger les panneaux à choix illisibles, rendre la sauvegarde accessible depuis le jeu embarqué dans l’éditeur, fiabiliser les flèches de déplacement, diversifier les coffres, matérialiser le butin des ennemis et migrer l’affichage de référence vers 1920×1080.
|
||
|
||
**Architecture:** Les panneaux modaux utilisent des conteneurs de mise en page plutôt que des offsets concurrents. Le routeur d’entrée conserve l’InputMap, mais expose une touche de sauvegarde sans modificateur qui n’est pas interceptée par l’éditeur et verrouille un seul déplacement par pression physique. Le résolveur de butin interdit de sélectionner deux fois le même objet pendant une résolution, tandis qu’une étape post-combat unique dans `Game` matérialise les tables de butin sur la cellule de mort pour toutes les voies létales. La résolution de référence devient un contrat 1920×1080 partagé par le projet, les tests et la capture visuelle.
|
||
|
||
**Tech Stack:** Godot 4.5, GDScript, GUT 9.5, scènes `.tscn`, JSON de contenu, scripts Bash/Python de vérification visuelle.
|
||
|
||
**Spec:** Retours de playtest et capture fournis le 2026-10-08.
|
||
|
||
## Global Constraints
|
||
|
||
- Préserver les nombreuses modifications locales déjà présentes et ne pas réinitialiser les fichiers hors périmètre.
|
||
- Les PNJ ne sont jamais des cibles de combat ou des sources de butin ennemi.
|
||
- Les corrections restent déterministes pour un seed et un contexte identiques.
|
||
- Les objets d’ennemis doivent être visibles au sol et passer par le flux de ramassage existant.
|
||
- Le viewport, la fenêtre de référence et les captures deviennent exactement 1920×1080.
|
||
- Les panneaux ne doivent plus superposer le récit, les choix et l’aide, y compris avec du texte long.
|
||
|
||
---
|
||
|
||
### Task 1: Résolution de référence 1920×1080
|
||
|
||
**Files:**
|
||
- Modify: `project.godot`
|
||
- Modify: `scripts/game/game.gd`
|
||
- Modify: `scripts/check-visual-capture.py`
|
||
- Modify: `scripts/run-visual-check.sh`
|
||
- Modify: `scripts/build-linux.sh`
|
||
- Modify: `tests/scripts/test_godot_import_runners.sh`
|
||
- Modify: `tests/unit/test_display_layout.gd`
|
||
- Modify: `tests/e2e/test_display_camera_grid_e2e.gd`
|
||
- Modify: `tests/unit/test_hud_layout.gd`
|
||
- Modify: `docs/PLAYING.md`
|
||
|
||
**Interfaces:**
|
||
- Produces: `Game.REFERENCE_VIEWPORT == Vector2i(1920, 1080)`.
|
||
- Produces: exact 1920×1080 PNG visual captures and smoke displays.
|
||
|
||
- [ ] Add failing assertions for the new project and `Game` reference dimensions.
|
||
- [ ] Change project viewport/window overrides and the public game constant.
|
||
- [ ] Update Xvfb, fake PNG and PNG validation dimensions; derive the measured dungeon crop from the new dimensions.
|
||
- [ ] Re-express the central HUD clearance area relative to `REFERENCE_VIEWPORT`.
|
||
- [ ] Run display, HUD, E2E camera and script-runner tests.
|
||
|
||
### Task 2: Panneaux de choix adaptatifs et non chevauchants
|
||
|
||
**Files:**
|
||
- Modify: `scenes/ui/EventPanel.tscn`
|
||
- Modify: `scenes/ui/DialoguePanel.tscn`
|
||
- Modify: `scenes/ui/QuestPanel.tscn`
|
||
- Modify: `scripts/presentation/event_panel.gd`
|
||
- Modify: `scripts/presentation/dialogue_panel.gd`
|
||
- Modify: `scripts/presentation/quest_panel.gd`
|
||
- Modify: affected E2E node paths
|
||
- Create: `tests/unit/test_choice_panel_layout.gd`
|
||
|
||
**Interfaces:**
|
||
- Produces: each modal as `PanelContainer > VBoxContainer Layout > Title, Body, Entries, Help`.
|
||
- Produces: distinct, contained narrative, choice and help rectangles at 1920×1080.
|
||
|
||
- [ ] Write a failing rectangle test with representative multiline narrative and choices for Event, Dialogue and Quest.
|
||
- [ ] Replace direct children and absolute offsets with one `VBoxContainer`, content margins and explicit vertical allocation.
|
||
- [ ] Update scripts and E2E paths from `$Body`/`$Entries` to `$Layout/Body`/`$Layout/Entries`.
|
||
- [ ] Verify at least 12 px logical separation and containment after two layout frames.
|
||
- [ ] Run choice-panel, dialogue, event and quest tests.
|
||
|
||
### Task 3: Sauvegarde utilisable depuis le debug embarqué et entrée fiable
|
||
|
||
**Files:**
|
||
- Modify: `project.godot`
|
||
- Modify: `scripts/game/input_bindings.gd`
|
||
- Modify: `scripts/game/action_router.gd`
|
||
- Modify: `scripts/game/game.gd`
|
||
- Modify: `scenes/Game.tscn`
|
||
- Modify: `tests/unit/test_action_router.gd`
|
||
- Modify: `tests/e2e/test_save_load_e2e.gd`
|
||
- Modify: `tests/e2e/test_input_action_router_e2e.gd`
|
||
- Modify: `docs/PLAYING.md`
|
||
|
||
**Interfaces:**
|
||
- Consumes: existing `save` player action and `Game.save_requested` signal.
|
||
- Produces: `V` as editor-safe save shortcut while retaining `Ctrl+S` for standalone/exported builds.
|
||
- Produces: one movement action per non-echo physical arrow press.
|
||
|
||
- [ ] Add a failing E2E test that opens save slots with plain `V` through real input.
|
||
- [ ] Add `V` as a second `save` binding and document why `Ctrl+S` is intercepted by the Godot editor’s own Save command in embedded play.
|
||
- [ ] Add a repeated alternating Up/Down E2E test proving every press is routed once and echo events do not create or swallow actions.
|
||
- [ ] Handle arrow physical keycodes deterministically before ambiguous action matching and ignore `InputEventKey.echo` for turn commands.
|
||
- [ ] Update the HUD/help text and run action/input/save tests.
|
||
|
||
### Task 4: Coffres sans objets répétés
|
||
|
||
**Files:**
|
||
- Modify: `scripts/domain/items/loot_resolver.gd`
|
||
- Modify: `scripts/domain/world/floor_populator.gd`
|
||
- Modify: `tests/unit/test_loot_resolver.gd`
|
||
- Modify: `tests/unit/test_floor_populator.gd`
|
||
- Modify: `tests/e2e/test_world_chest_loot_e2e.gd`
|
||
|
||
**Interfaces:**
|
||
- Produces: `LootResolver.resolve(...)` selects each `item_id` at most once per reward; explicit `min_qty/max_qty` remains the sole source of quantity.
|
||
- Produces: ordinary treasure rooms use `floor_treasure`, not arbitrary enemy or boss tables.
|
||
|
||
- [ ] Add a failing dominant-weight multi-roll test showing the same item is currently selected twice.
|
||
- [ ] Filter already-selected item IDs from subsequent weighted rolls while leaving gold/empty repeatable.
|
||
- [ ] Assert that generated treasure chests use the floor treasure table.
|
||
- [ ] Run resolver, chest, population and deterministic-generation tests.
|
||
|
||
### Task 5: Butin ennemi matérialisé et ramassable
|
||
|
||
**Files:**
|
||
- Modify: `scripts/game/game.gd`
|
||
- Modify: `scripts/domain/magic/magic_engine.gd`
|
||
- Modify: `scripts/presentation/loot_feedback.gd`
|
||
- Modify: `tests/e2e/test_melee_feedback_e2e.gd`
|
||
- Modify: `tests/e2e/test_ranged_targeting_e2e.gd`
|
||
- Modify: `tests/e2e/test_spell_casting_e2e.gd`
|
||
- Modify: `tests/unit/test_save_repository.gd`
|
||
|
||
**Interfaces:**
|
||
- Produces: one post-combat materialization step that resolves each `loot_dropped` descriptor exactly once.
|
||
- Produces: valid `ItemInstance` entries in `FloorState.ground_items[death_cell]` and immediate run gold credit.
|
||
- Produces: resolved `loot_dropped` payload containing `loot_table`, `items`, `gold`, and `empty`.
|
||
|
||
- [ ] Add a failing melee E2E assertion that a catalog-backed killed enemy leaves a ground item at its death cell.
|
||
- [ ] Resolve the enemy loot table using a stable `enemy:<floor>:<actor_id>` context before event journaling, create item instances, add them to `ground_items`, and credit gold.
|
||
- [ ] Add the missing loot descriptor to lethal spell outcomes so magic shares the same post-combat pipeline.
|
||
- [ ] Verify melee, ranged, companion and spell deaths each materialize once, and the existing interaction picks the item up.
|
||
- [ ] Verify save/load round-trips the generated drop and update feedback wording from “secured” to “dropped”.
|
||
|
||
### Task 6: Verification complète
|
||
|
||
**Files:**
|
||
- Modify: no production files unless a verified regression requires it.
|
||
|
||
- [ ] Run all unit tests.
|
||
- [ ] Run all integration tests.
|
||
- [ ] Run all E2E tests.
|
||
- [ ] Run visual capture and inspect both 1920×1080 images.
|
||
- [ ] Run matrix parity gate and `git diff --check`.
|
||
- [ ] Review the final diff for unrelated or generated temporary files.
|