Repository navigation
Conversation
return_to_plaza() flies to the closest Pokecenter on the map, and that
search can fall back to any fly point. Nothing checked where the player
landed, so every central_to_*() offset afterwards could be applied from
the wrong place (lab R3, 2026-10-22: landed near Chargestone, then
"Unable to fly to Chargestone Cavern!" ended the program).
(a) After landing, return_to_plaza() OCRs the place-name banner the game
shows ("Central Plaza" / 中心廣場) for up to 8 s. If it doesn't show
Central Plaza, it returns again with the cursor overshoot, up to 3
landings, then throws. Languages without a known name or OCR data skip
the check and log it. The loop runs against an injectable
PlazaReturnActions, unit tested with a scripted fake.
(b) map_move_cursor_fly() now throws TerariumFlyFailedException (an
OperationFailedExceptionWithScreenshot). process_and_do_quest() catches
only that type, returns to Central Plaza (checked), and lets the board
check count the attempt as failed, so the existing retry limit applies.
Other exceptions (shiny ProgramFinishedException, UserSetupError, other
operation failures) pass through as before.
return_to_plaza() takes the game language, so quest_wash_pokemon() now
takes the BBQ options.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Give PlazaReturnCase's `landings` a default member initializer (= {}), so
test cases that leave them out of a designated initializer compile on
the Windows Clang CI job.
That job builds with clang-cl /W4 /WX, which turns on
-Wmissing-designated-field-initializers: a designated initializer that
omits a field without a default member initializer is an error. Apple
clang's -Wextra does not enable that warning, so macOS builds miss it.
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
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
Owner
Author
|
Superseded by consolidated Tree 3 PR #274. |
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.
Part of PokemonAutomation/ComputerControl#263.
Problem
return_to_plaza()flies to the closest Pokecenter on the map, and when that fails the search falls back to zooming out and flying to the closest fly point, whatever it is. Nothing checked where the player landed. Everycentral_to_*()after that moves the map cursor by a fixed offset from Central Plaza, so it lands in empty space.Lab run R3 (2026-10-22 08:17–08:25): Auto Battle's return found the Pokecenter icon 130 px off, got no "Fly" menu item, fell back, and landed near Chargestone. The next
central_to_chargestone()timed out 3 × 2 min, and "Unable to fly to Chargestone Cavern!" ended the program.Change
(a) Check the arrival. After landing,
return_to_plaza()OCRs the place-name banner the game shows near the top of the screen ("Central Plaza" / 中心廣場), for up to 8 s. If the banner doesn't show Central Plaza, it returns again with the cursor overshoot it already used after a failed fly, up to 3 landings, and then throws. If the language has no known name (only English and Chinese (Traditional) are known so far) or has no OCR data, the check is skipped and a log line says so.PlaceNameBannerReader(new): white-text OCR of the banner area, at two brightness thresholds.PokemonSV_TerariumPlazaReturn(new): the pure parts,central_plaza_banner_to_check()andplace_name_banner_matches(), plus the return-and-check loopreturn_to_plaza_checked(). The loop runs the game steps throughPlazaReturnActions;Terarium.cpphas the console implementation.return_to_plaza()now takes the game language. All BBQ callers passBBQ_OPTIONS.LANGUAGE, soquest_wash_pokemon()now takes the BBQ options too.(b) A failed quest fly fails the attempt, not the program.
map_move_cursor_fly()throwsTerariumFlyFailedException, a subclass ofOperationFailedExceptionWithScreenshot, after its 3 tries.process_and_do_quest()catches only that type: it returns to Central Plaza (with the check), and then the existing board check counts the attempt as failed.NUM_RETRIESand the skip policy apply as before. Nothing else is caught: a shinyProgramFinishedException,UserSetupError, and other operation failures still end the program. If the return itself fails its check 3 times, that error is fatal.How to review
PokemonSV_TerariumPlazaReturn.h/.cpp: the decisions and the loop.PokemonSV_Terarium.cpp: the oldreturn_to_plaza()body is unchanged, renamedfly_toward_plaza()withlaggyas a parameter. After it come the console actions and the newreturn_to_plaza(). Themap_move_cursor_fly()throw changed type.PokemonSV_BlueberryQuests.cpp: inprocess_and_do_quest(), the questswitchis only re-indented into thetry. Use GitHub's "Hide whitespace" (?w=1) to see that about 100 lines are unchanged. The other edits there and inBlueberryCatchPhoto.cpponly pass the language.PlaceNameBannerReader, then the tests.Without whitespace changes, the diff is +674 / −20.
Tests
PokemonSV_Tests.cpp(data-driven, designated initializers), all passing locally:BBQPlazaBannerToCheck(5): names by language; no OCR data; unknown language.BBQPlazaBannerMatch(21): exact names, spacing, noise, one or two misread characters, each other plaza (Chinese and English), and empty or punctuation-only reads.BBQPlazaReturn(5, scripted fake): arrives first time; lands elsewhere, then arrives with the overshoot; banner missed; never arrives (fails after 3); nothing to check (no banner read).中心廣場exactly. A Chargestone-area error screenshot read nothing. These images are not committed.Live check needed
landed at Central Plaza (banner "中心廣場"). It must never retry when the player is really at the plaza: a false retry costs about 30 s, and three in a row end the program.Quest attempt failed: unable to fly, returns to the plaza, and the program continues.🤖 Generated with Claude Code
https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E