Repository navigation
BDSP AutoStory walk: RouteIO seam and scripted walker tests - #166
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #129
The planned route walker (
RouteWalker, behindwalk_route()andtalk_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-methodRouteIOwith no change in behaviour:ConsoleRouteIOmakes the same controller commands, waits and screen reads as before (holding_against_wall()moved unchanged), the public signatures stay, and new overloads take aRouteIO&. Taps, A presses and waits become aRouteInputthat records the kind (D-pad or stick) and the duration, so tests can see a stick tap. The second commit addsScriptedRouteIO, 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, androute_turn()being a single D-pad tap of 80 ms or less. Review commit by commit; the moved code shows withgit diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change bdsp/walk-v4...bdsp/walk-v4-routeio.Tested locally on macOS: all
PokemonBDSP::andPokemon::unit tests pass. With the two fixes undone, the r54 and r55 tests fail. Code health reports 0 failures againstbdsp/walk-v4. Not run on the Switch.🤖 Generated with Claude Code
https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E