Tuned by ear: nearVolume 1.0 -> 0.8 and farVolume 0.25 -> 0.05. At the old
values a wall out at the full radius was still loud enough to compete with
footsteps and speech, so the tones read as a wash rather than as a cue. The
wider gap between near and far also makes distance easier to judge, which is
the point of the volume ramp.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Tracker selection now survives a rescan. The scan is rebuilt every turn and
both lists are distance-sorted, so holding a bare index meant one step by the
player silently re-pointed the selection at a different rat. The tracker now
remembers identity instead -- the actor table for creatures, coordinates for
tiles -- and re-derives the indices in reanchor() after each rescan. Selection
is dropped only when the thing genuinely stops being reported (out of FoV,
killed, picked up), and the existing clamp then falls back to the nearest.
Ctrl+Home walks to the selection, reusing the exact shape of the game's own
click-to-path in ingame.mousepressed: calculatePathFromPlayer, then either
bufferInput or playerInput for a one-step path. Interruptions and threatened-
player truncation therefore behave the way a mouse click does. Most things
worth tracking stand on impassable tiles, which calculatePathFromPlayer refuses
outright, so we fall back to the cheapest of the 8 neighbours and say "next to"
rather than "to". Guarded on states.getCurrent() == "ingame": elsewhere the
input buffer belongs to another state and feeding it moves would be a bug.
Wall tones now follow the usual proximity convention -- a near wall is loud,
one out at radius is quiet. It was inverted, which read backwards in play since
a nearby wall is the more urgent fact. config.louderWhenFurther still flips it.
Testbed covers both: selection identity across a forced rescan, and that
Ctrl+Home moves the player without breaking out of the map.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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>
Game-file footprint unchanged: still one line in main.lua.
Console (Q4: speak everything queued, cancelled by explicit action):
- history.lua keeps our own unbounded history, since the game's console buffer
expires entries after 3s. Mirrors the game's (xN) coalescing so what is heard
matches what is on screen. The review cursor holds position while new lines
arrive rather than being yanked to the tail mid-read.
- patches/console.lua wraps console.print, calling the real one first so a bug
on our side cannot swallow a message the player would otherwise see.
- Any keypress reaching the game silences the pending speech backlog.
Hotkeys: [ and ] review, Shift+[/] jump to ends, \ repeat, Shift+\ copy.
Chosen from scancodes the game does not bind. Note keybindings.getCommand()
ignores modifiers, so Ctrl+Up would read to the game as a movement -- our keys
are consumed and never overlay a game-claimed scancode.
Wall tones (Q5: on step, 3D-positioned, radius 5):
- Direction and distance are deliberately decoupled. The listener sits at the
camera 4 units above the plane under an inverse distance model, so placing a
tone at the wall's real position would make distant walls quieter (the
opposite of the request) and collapse the stereo pan. Instead the source sits
at a fixed radius in the wall's direction at listener height, and volume is
computed explicitly from distance.
- Step detection polls player coordinates rather than hooking movement, so it
covers walking, pathing, portals and pushes for free.
- Respects FoV/rememberedFoV; never leaks unseen geometry.
tests/test_history.lua: 16 assertions, all passing, pure Lua.
Not yet verified in actual play -- needs a human at the keyboard.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>