Dialogue narration and wall tone retrigger fix

Game-file footprint unchanged: still one line in main.lua.

Wall tones: stop the previous tone per direction before playing the new one.
The tones are 2.33s mono; steps land far faster than that and up to four
directions sound at once, so overlapping them stacked into a continuous drone
instead of reading as a per-step cue. Cutting the old tone also means the
distance/volume you hear always reflects where you are standing now.

ingame_dialogue descriptor: speaks speaker and message on a node change, but
only the response on a selection change -- re-reading the whole speech every
time you move between responses would be unusable.

Two more bugs found by the testbed:

4. Nested states.switch announced in reverse. ingame.open() sees
   world.pendingDialogue and switches straight to ingame_dialogue; because we
   announce after realSwitch returns, the inner announcement fired first and the
   outer one interrupted and clobbered it, so entering a conversation said
   'Game' rather than 'Conversation'. Now we stay quiet if we are no longer the
   current state.

5. The game already numbers response text ('1. (Continue)'), matching the number
   key that picks it, so our own numbering produced '1. 1. (Continue)'.

9/9 testbed checks, history unit tests passing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Accessibility Mod
2026-08-01 20:59:04 +02:00
co-authored by Claude Opus 5
parent 9945703fb7
commit da512fc67e
5 changed files with 191 additions and 6 deletions
+47 -6
View File
@@ -2,7 +2,20 @@
**Read this first on any handoff.** Living document: update it whenever state changes, before ending a turn.
Last updated: 2026-08-01 · Currently: **Phase 0 complete. Phase 1 next.**
Last updated: 2026-08-01 · Currently: **Phases 0–1 done, menus + dialogue done.
Phase 2 (tile examination) next.**
**Game is now playable start-to-finish by ear** from main menu through the intro
conversation into gameplay — verified by the testbed, 9/9 checks.
### Run the testbed (do this after any change)
```
cd "D:/code/Sulphur Memories Alchemist 0.4.2 sanctified"
rm -rf ~/AppData/Roaming/LOVE/Alchemist # start from a clean save
"C:/Program Files/LOVE/lovec.exe" . --a11y-test
```
It drives the game by code via `love.event.push`, navigating by *reading* focus
rather than counting keypresses. Every bug listed below was caught by it.
---
@@ -197,13 +210,41 @@ fold and review keys.
(bound, immobilized). Walking proves nothing about the console patch; drive
`console.print` directly to test it.
### Done — dialogue narration + wall tone retrigger fix
**`ingame_dialogue` descriptor.** Speaks speaker + message on a *node* change, but
only the response on a *selection* change (re-reading the whole speech every time
you move between responses would be unusable). Responses can also be picked
directly with number keys 1–0, which the game already supports.
Two more bugs found and fixed:
4. **Nested `states.switch` announced in reverse.** `ingame.open()` sees
`world.pendingDialogue` and switches straight to `ingame_dialogue`. Since we
announce *after* `realSwitch` returns, the inner announcement ("Conversation")
fired first and the outer ("Game") then interrupted and clobbered it.
**Fix: after switching, if `states.getCurrent() ~= newState`, stay quiet** —
a nested switch already announced.
5. **Double numbering.** The game already prefixes response text with its number
(`"1. (Continue)"`, matching the number key that selects it), so adding ours
gave `"1. 1. (Continue)"`. Now only added when absent.
**Wall tones — retrigger fix (per Talon: "stop previous tones and play new ones").**
Tones are **2.33 s, mono, 44.1 kHz**. Steps land far faster than that and up to
four directions sound at once, so they stacked into a continuous drone. Now each
direction stops its previous source before starting a new one, so it reads as a
per-step cue layered over footsteps, and the volume you hear always reflects
where you're standing now. `playing` is cleared on level change.
*(Mono matters: OpenAL only spatialises mono sources. Stereo would not pan.)*
### Known gaps (next up)
- **`ingame_dialogue` announces "Game", not "Conversation", and reads no dialogue
text.** It appears to be entered via a path that announces `ingame` first.
Needs a descriptor + investigation of how it's switched to. **This is the next
blocker for actually playing.**
- `ingame` itself has no descriptor — that's Phase 2 (tile examination).
- Wall tones still unverified by ear.
- Wall tone retrigger fix not yet confirmed by ear.
- `worldmap`, `journal`, `character`, `research`, `inventory`, `craft`, `refine`,
`trade`, `actions_menu`, `alchemy_table`, `keybindings_menu`, `config_menu`,
`menu_text`, `ingame_message`, `menu_message` still have no descriptors.
### Next — Phase 2: tile examination
Patch `views/levelCursorPopup.set` to narrate the game's existing examine mode,