Repository navigation
Conversation
A wild battle's flash can show anywhere from ~150ms to ~650ms after the step that set it off, longer than a tile (267ms). Held through an open leg, the walker placed the battle from its timing and got it wrong both ways on console B (2026-11-01, Route 1): a battle on the 3rd tile of "west 4" was seen after the hold and taken for the end of the leg, and one on the 1st tile of "south 7" counted as no tiles walked. The next legs then ran a column off and into a sign. Open legs that can meet a wild battle are now walked one press per tile, each watched for 900ms. A step's interrupt then shows in its own window, or less than a tile into the next one, whose press it swallowed; either way it is placed on its step without a measured delay, and the leg ends on its last tile. This was chosen over calibrating the delay (it varied by more than a tile in one run) and over making the planner end such legs on a wall (not every leg has one, and it would only fix the axis of that leg). It costs about 0.6s per tile on those legs; legs to a wall and legs off wild tiles are still held through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
A leg to a wall is held two tiles longer than it takes, so a ledge the plan took for a wall was hopped: in Viridian City "south 2 (to wall)" from the Pokemon Center ended on (26,31), below the ledge, instead of (26,29), and every later leg was off (console B, 2026-11-01). The maps don't record which way a ledge faces, so a leg now never ends held into any ledge; it counts its tiles instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ter a route Two failures on console B (2026-11-01): - With the START menu still open, a Viridian Forest route of three legs to a wall reported each one done; the D-pad only moved the menu's cursor. Before each step the route now fails if the START menu, a selection menu or a message is on screen. This catches the cause; a check that the player actually moved would need a calibrated screen comparison, left for later. - A wild battle started as the last leg, "west 11 (to wall)" through grass, ended, and the route returned before it was seen; its flash was missed, and "Wild ... appeared!" shows about 2s on. A route whose last leg can meet a wild battle now watches 2.5s more before returning. The step's switch moves into walk_step(), unchanged, to keep the loop short. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Walked a tile at a time, a leg's last step onto a warp was watched for 900ms, long enough for the warp's fade out and in to pass for a battle's flash. On console B (2026-11-01) the player was already inside Viridian Forest's north gate when the walker tried to flee, and failed after 5 attempts. The step onto a warp is now pressed without watching; a battle set off by the step before still shows in that step's window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
A trainer who sees the player mid-leg speaks first; the walker closed the message as an overworld one, then saw the battle and tried to flee it (console B, 2026-11-01, Viridian Forest). After any message on the overworld the walker now watches 6s for a battle's dialog, and if one shows it stops with "trainer battle" in the error, without an error report, for the caller to fight it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Run 7 on console B (2026-11-01, Route 1) lost a whole leg twice. A
battle on the last step of a leg through grass had its flashes missed;
its "Wild ... appeared!" showed 3.7s after that press, by which time the
next leg ("east 4", "west 4", off the grass and so not watched for
battles) had been walked into the battle without moving the player. The
next leg through grass then saw the dialog 353 and 409ms after its first
press and rightly counted 0 tiles of its own, but the column was lost.
Now the last watched step of an open leg through grass is watched 3.4s
longer, and a leg to a wall through grass is watched 3.5s after it, so a
late battle is placed on the leg it belongs to. A late sighting is
placed on the step that landed nearest its delay before, and that delay
is 3.7s as measured, not the 2s guessed (other maps open battles with
other wipes, so there it's still a guess). This replaces the 2.5s watch
after a route's last leg. It costs about 3.5s per leg through grass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
In run 7 (console B, 2026-11-01) the player had drifted onto Route 1's grass, and the step meant for Oak's Lab's door set off a wild battle instead. Its flashes and wipe passed for the warp's fade, the route went on inside a "lab" and returned done, and the next screen was the battle's FIGHT menu. After a warp's fade the walker now watches 3s (it waited 1.5s before) for a battle's dialog; if one shows, it flees and fails with "a wild battle, not the warp to ...: the player is off the route", for the caller to re-plan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ext box The battle text box's detector fires on the black below a small room's map: on Oak's Lab mat the walker tried to flee a battle that wasn't there, twice (console B). The HP box shows a little later, so the watch is 5 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Three planner changes from the Route 1 runs (console B, 2026-11-01): - A leg's wildness is now worked out per step by the planner, so a leg that crosses a map's edge counts the grass on the far side: "north 22" from Pallet Town through Route 1's grass was marked not wild, and walked without watching for battles. - An open stop after a wild step costs OPEN_WILD_STOP (300) on top, so routes end legs through grass at a wall where one is close. On Route 1 there mostly isn't one; finding the player again after a battle is the next commit. - A ledge stops a player moving north. The maps don't record which way a ledge faces, but none of the loaded maps has a north-facing one (checked against pokefirered's metatile behaviors: south ledges on Route 1, 2, 22, 24, Viridian, Pewter and Cerulean, east and west ones on Route 24 only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Counting tiles after a battle went wrong in a new way on almost every console run on Route 1 (console B, 2026-11-01): the flash missed, the dialog late, the next leg walked into the battle. Timing can't say where the player is, so the walker no longer guesses. An open leg now stops at its first interruption (and a leg after which one is seen counts as stopped too). plan_reanchor() then finds, on the map grid, a wall straight along the leg, ahead past its end or else back past its start, which holding that way reaches from any tile the player may be on. The walker holds to it, as a leg to a wall, and plans a new route from there to the same end. Warps, Surf, ledges, people and unloaded maps along the line rule a wall out; with none, the route fails. A leg to a wall seen interrupted after its hold is simply walked again. The walker loads overworld_maps() for this unless it is given maps. The tile-at-a-time walk, the settle and the window rule stay in the shared walker but FRLG no longer uses them: legs are held through again. Tests: the rules on a small map, and for Viridian Mart to Oak's Lab and Pallet Town to Viridian Mart on the real maps, that every open leg through grass has such a wall and a route on from it (skipped in CI, which has no map files; run locally). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
…-mvp Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Run 16 on console B (2026-11-01, Viridian Forest): "west 6" from (11, 33) walked 2 tiles, unseen, and the next leg, "north 24" toward the exit, went up column 9, not 5. A battle stopped it; finding the player again held south down column 5 to the wall at (5, 33), but from column 9 that hold walks into the TRAINER TIPS sign at (9, 29). Its message stopped the hold six times and the route failed. - Finding the player again no longer assumes the column (or row) of the stopped leg. It takes every tile they may be on: along the leg, and up to 4 tiles to either side. Then it looks for one, two or three holds to walls that end on the same tile from all of them, with the fewest tiles held. A hold that would meet a sign, a ledge, a warp or a person from any of them is never used. If no holds work for that many tiles, it tries fewer to the side. This moves from the route planner to its own file, PokemonFRLG_OverworldReanchor; the planner keeps hold_to_wall() and leg_tiles() for it. - A leg to a wall that is interrupted again right away when held again (within 3 tiles) stops instead of holding six times: something on the way, a sign, interrupts every hold. The player is then beside a sign: if only one sign is next to a tile they may be on, that's where they are; otherwise the holds above find them. Why "west 6" fell short: not its timing. Its hold, 1468ms, is right for 6 tiles and the same as the 6-tile legs on Route 1 that ended where planned, after the same 40ms turn tap. A battle seen 353ms into the next leg had started about 3s before, during "west 6", which the map has on floor tiles and so watched only for messages. So the forest's grid may miss encounter tiles there (rows 28-33); that needs a look at the screen. The holds above cover it either way. Tests: OverworldReanchor (rules on small maps; the run 16 case on the real Viridian Forest map, from every column 3 to 9; Viridian Mart to Oak's Lab and Pallet Town to Viridian Mart), and LegWalker (a leg to a wall blocked by a sign stops). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Console B, 2026-11-01, checkpoint 00.08: Camper Liam stopped "south 9 (warp)" out of Pewter Gym, the story fought him, and finding the player again failed: the gym's trainers block every hold to a wall. Off the grass only a message stops a leg (a trainer who saw the player, a Repel wearing off), and the player stands on the leg's line, so on a leg that ends at a warp the walker now just holds on toward it, turning first (the trainer turned the player to face them), until the warp's fade. The fade ends the hold, so it doesn't matter how far the player had got. Not counted from the hold time: the trainer's approach delays the message by a second or more. Open legs that end in the open, and legs through grass, still find the player again at walls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
…-mvp #119 now has nav/shared (#114) through #117 and #118, so this PR's diff shows only its own files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
…g/autostory-mvp Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
LegPlanner's wild-step weighting moved from #119 to #114 (7008f8c) and merged down #117 → #118 → #119 → #120; #120's diff is PokemonFRLG only. Adds #119, #120, #121 to the tree and a file-ownership table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The re-anchor tests and the ledge route test planned on overworld_maps(), so CI, which has no Packages maps, skipped them. They now use test_overworld_maps() (#118), the same maps compiled into the program. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
…count Conflicts: #118 now has the fixes this branch carried (conservative ledges, cross-map wild steps, the late-battle wait, the warp-vs-battle check on BattleScreenDetector); its versions are taken, and this branch keeps its route loop.
…hooks FRLG walked open legs through grass a tile at a time for a while, placing battles on steps by their timing; it no longer does, and nothing else uses it. Removed: LegSpec's step_window, warps and settle, the window rule (steps_back_to_interrupt), the watch-only hold, and their tests. The walker keeps what position recovery needs: stop_on_interrupt (an open leg stops at its first interrupt), stop_if_blocked (a leg to a wall interrupted again right away when held again stops, as at a sign), the stopped result, and the count clear_late_interrupts() returns. Each has a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
plan_reanchor() widened the tiles the player may be on to 4 either side of the stopped leg, and when no holds found them from all of those it tried 3, 2, 1 and 0. Failing to find holds is no reason to think the player is closer to the line, so the set is now fixed. It is the leg's own tiles. Measured on the compiled-in maps, with even one tile to either side Route 1's people and ledges cut some hold for some tile, and no open leg through its grass could be recovered; on the leg's line every one of them can (both route tests). Sideways drift, as in run 16 on console B, is not recovered: there, a hold that meets a sign at once, again and again, now fails the route instead of guessing (next commit). The sign lookup that went with the wider set is removed. Recovery holds take a ledge to stop a player moving north: FRLG's ledges face south, east or west on every map loaded (pokefirered has no MB_JUMP_NORTH there), and Route 1 has no other walls on most of its legs. Planned routes still never hold into a ledge (#118). The maps don't record which way a ledge faces; recording it would let this go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…er's maps Recovery planned a new route from where it found the player to the route's last tile, on default costs, and on maps loaded with no event flags when the caller passed none. That drops the caller's flags and costs, and any shape the route had on purpose (AutoStory's fixed legs). The route loop moves into run_route() (PokemonFRLG_OverworldRecovery), with the console side passed in. After the holds that find the player, it plans only back to the stopped leg's end, with the caller's maps and costs (RoutePlanning), then walks the rest of the route as planned. walk_overworld_route() takes a RoutePlanning in place of the maps; without one, a stop that needs the player found again fails the route. A leg to a wall that is interrupted at once, hold after hold, as by a sign the plan didn't have on its line, now fails the route rather than being recovered from a guess. Tests (OverworldRecovery), with scripted steps: Viridian Mart to Oak's Lab, stopped on its first open leg through grass, is found again, walked back to that leg's end and finished as planned; with no maps, or with no walls to find the player by, the route fails; a leg to a wall seen interrupted late is walked again, and one blocked at once fails; a leg to a warp off the grass is held on to the warp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…count The maps are now built into the program; the re-anchor tests read them with overworld_maps().
dayfine
added a commit
that referenced
this pull request
Nov 1, 2026
…-mvp OverworldWalk.cpp: #119 no longer needs BattlePokemonDetector.h; its battle watchers are BattleScreenWatcher now. AutoStory_Tests plan on story_maps() again: overworld_maps() reads the maps built in from Overworld/Maps (#118), so test_story_maps() and the TestData include go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
This was referenced Nov 2, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…errupt-recount # Conflicts: # SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp
walk_overworld_route_with_recovery() takes the walker's MoveSpeed and uses it for every leg, the hold on toward a warp after a stop, and the [Speed] line of each leg to a wall. Holds back to a wall after a stop run too; the wall-check tap stays a plain tap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…re they stopped them On Route 3 (console B, 2026-11-02) Lass Robin, wandering x 40, y 10..12, saw the player on (40, 9) during "east 11 (to wall)". Her message showed after the leg's 500ms watch, and the next leg's overworld check failed the walk. A leg that crosses a trainer's sight on the maps (trainer_crossing(), from where they stand or wander and each way they look) is now watched after it for the trainer's "!", walk-up and message, and what shows goes to the leg's interrupts (AutoStory's StoryMessage fights the trainer). When the leg has a single tile in any trainer's sight and is off the grass, the player is known to stand there facing the leg's way, so the route is planned again from that tile; otherwise the existing recovery runs. A message open before a leg goes to the interrupts once (clear_open_message()). run_route() moves into a RouteRun class to stay under the function length limit; its other steps are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…count Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 3, 2026
…ng puts the player A leg that stops at its first interrupt (stop_on_interrupt) used to leave LegResult::tiles at 0, so the caller had to look for the player along the whole leg. It now carries tiles_before_interrupt()'s estimate, which the FRLG recovery walk (#119) narrows its search with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…s, or stop After a battle or a message stopped an open leg, recovery looked for the player along the whole leg, and a trainer's stop was placed only when the leg crossed one tile of sight off the grass. Now: - the stop's timing (#117's estimate) narrows the player to a tile either side walking, two running (walked_near()); - stop_candidates() adds each tile up to there a trainer may see, with the trainer standing next to the player afterwards, since a trainer's message comes later than the timing says; off the grass a message is the trainer's; - plan_reanchor() finds holds to walls that end on one tile from every candidate, on the maps as each one stands (a walked-up trainer blocks; a person on the way rejects a hold), and a way back to the leg's end that walks the same from there for all of them. One candidate needs no holds. None: the route fails rather than guess; - the tap after a leg to a wall is only logged (it can't tell a bump from a step). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 3, 2026
…top's candidate tiles) into frlg/autostory-mvp Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 3, 2026
…-player-name Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 3, 2026
…utostory-sid-helper Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 3, 2026
…tostory-starter-rng Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 3, 2026
…ng-plan-base Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 3, 2026
…-rng-plan Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 3, 2026
…callable-steps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 3, 2026
…ner stops place them Every open leg of 00.11's way into Route 3 and 00.12's way over Route 3 and 4, stopped wherever the timing may put it (walking or running) or anywhere on it, is recovered by #119's holds and way back. Lass Robin on Route 3 and the Bug Catcher at (47, 45) in Viridian Forest each see one tile of a planned leg: a stop there is theirs, with the trainer next to the player. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 3, 2026
…nto frlg/autostory-gift-rng Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…k-interrupt-recount
Owner
Author
|
Superseded by #213 (FRLG stack consolidated into stage PRs; will be resplit for upstream). |
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 #118 (and #117's leg walker, which now reports the timing estimate of a stopped leg).
When a battle or a message stops an open leg,
walk_overworld_route_with_recovery()stops the leg there and finds the player again instead of walking on from a tile count. The stop's timing narrows where they are to a few candidate tiles of the leg (walked_near(): the estimate, a tile either side walking, two running), plus any tile up to there a trainer may see, with that trainer standing next to the player afterwards (stop_candidates()).plan_reanchor()then picks holds to walls that end on one tile from every candidate, on the maps as each candidate leaves them, and a way back to the leg's end that walks the same for all of them; with one candidate it plans straight from there, and when nothing works for all of them the route fails (the program stops, nothing is saved) rather than guessing. The tap toward a wall after a leg is now only logged, since it can't tell a bump from a step.Tested with the OverworldReanchor, OverworldRecovery and LegWalker suites (Route 1 both ways and Viridian Forest stopped at every estimate, a person in the way, Lass Robin's sight on and off the grass), run locally in a small harness and in fork CI; not run on the console yet.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E