Skip to content

BDSP AutoStory walk: RouteIO seam and scripted walker tests - #166

Merged
dayfine merged 2 commits into
bdsp/walk-v4from
bdsp/walk-v4-routeio
Nov 2, 2026
Merged

dayfine merged 2 commits into
bdsp/walk-v4from
bdsp/walk-v4-routeio

Conversation

@dayfine

@dayfine dayfine commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Depends on #129

The planned route walker (RouteWalker, behind walk_route() and talk_to_npc()) talked to the console directly in about 25 places, so its trainer and wall-check decisions could only be tested on the Switch. The first commit puts those steps behind a seven-method RouteIO with no change in behaviour: ConsoleRouteIO makes the same controller commands, waits and screen reads as before (holding_against_wall() moved unchanged), the public signatures stay, and new overloads take a RouteIO&. Taps, A presses and waits become a RouteInput that records the kind (D-pad or stick) and the duration, so tests can see a stick tap. The second commit adds ScriptedRouteIO, a strict script of console outcomes, with tests for a trainer on a wall leg (r54), Logan stopping an open leg on Route 202's row 5 (r55: the replan starts from (27, 5) and (26, 5) and never walks into him), a wall leg out of time needing the holding check, and route_turn() being a single D-pad tap of 80 ms or less. Review commit by commit; the moved code shows with git diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change bdsp/walk-v4...bdsp/walk-v4-routeio.

Tested locally on macOS: all PokemonBDSP:: and Pokemon:: unit tests pass. With the two fixes undone, the r54 and r55 tests fail. Code health reports 0 failures against bdsp/walk-v4. Not run on the Switch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

dayfine and others added 2 commits November 2, 2026 00:24
No behaviour change. RouteWalker (walk_route(), talk_to_npc()) now does
everything on the console through a RouteIO: walks to a wall, D-pad tap
walks, presses and waits, the dialogue watch, the at-the-wall holding
check, screen looks and its log and failures. ConsoleRouteIO is today's
code: holding_against_wall() moved unchanged into RouteIO.cpp, and each
call site makes the same controller commands, waits and reads as before.
walk_route() and talk_to_npc() keep their signatures and build a
ConsoleRouteIO; overloads take a RouteIO so tests can script the console.

route_turn() and the walker's taps, A presses and waits are now a
RouteInput (kind, direction, hold, release, count, whether to wait for
them), pressed by press_route_input(); route_turn_tap() is the D-pad tap
route_turn() turns with.

Review with:
git diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change HEAD~1 HEAD

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
ScriptedRouteIO plays a strict script of console calls and outcomes; a
call the script does not expect fails the test. New tests:

- A trainer's line freezes the at-the-wall check (DIALOG), the battle
  runs, and the walk on reaches the wall (BLOCKED): the walker goes on
  (r54: it judged the stale DIALOG and failed).
- Logan (Route 202, (26, 4), looking south) stops an open leg west along
  row 5 after 3 taps: the replan starts from (27, 5) and (26, 5), and its
  legs never walk into him from either (r55).
- A wall leg out of time whose check also runs out of time counts as at
  the wall only when the holding check says so.
- route_turn() turns with one D-pad tap of at most 80 ms (40 to 80 ms
  only turned on the console; a 100 ms stick tap stepped 0.6 tile).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine merged commit 5286265 into bdsp/walk-v4 Nov 2, 2026
8 checks passed
@dayfine
dayfine deleted the bdsp/walk-v4-routeio branch November 3, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant