Skip to content

BBQ: bound the return to Central Plaza (behavior change) - #30

Closed
dayfine wants to merge 6 commits into
bbq/plaza-arrival-checkfrom
bbq/plaza-return-bounds
Closed

dayfine wants to merge 6 commits into
bbq/plaza-arrival-checkfrom
bbq/plaza-return-bounds

Conversation

@dayfine

@dayfine dayfine commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Depends on: fork #24 (bbq/plaza-arrival-check), which is based on main. Base branch: bbq/plaza-arrival-check, so the diff shows only this change. Not ready for upstream until #24 goes up and merges.

Part of PokemonAutomation/ComputerControl#263.

Behavior change: a return to Central Plaza now gives up. Before, it retried until it flew; now, after 3 failed flies or wrong landings, it fails through the existing path (OperationFailedException, "Unable to return to Central Plaza").

Problem

Roadmap M13: one return to Central Plaza took 8m50s. fly_toward_plaza() looped until it flew, with no limit. Each pass mashed B back to the overworld, then ran fly_to_closest_pokecenter_on_map(), which itself tries up to 17 times (~13 s each) before throwing. In bbq-m5 at 11:20, the same "At max warpable map level, still cannot find PokeCenter icon" failure repeated every ~13 s for minutes, and the outer loop then started over. A battle on the way also restarted the loop.

Change

  • fly_toward_plaza() tries once and returns whether it flew. A failed fly or a battle (after fleeing) returns false. A shiny still stops the program.
  • It calls fly_to_closest_pokecenter_on_map() with a limit of 3 tries per search. The new max_tries parameter defaults to 17, so other callers are unchanged.
  • PlazaReturnActions::fly_to_plaza() returns that bool. return_to_plaza_checked() counts a fly that didn't happen as one of its 3 attempts: it logs "attempt k/3: the fly didn't happen.", skips the banner read, and the next attempt overshoots, as after a wrong landing.

Worst case, a return is now 3 flies of at most 3 tries per search each, instead of unbounded. Lab runs R5a/R5b had 73/73 returns land on the first fly, so the bound shouldn't trigger in normal runs.

Not changed: map_move_cursor_fly() was already bounded (3 tries, then TerariumFlyFailedException, which fails the quest attempt and returns to the plaza).

How to review

Nothing moved. fly_toward_plaza()'s while (!returned_to_pokecenter) became a plain block, so its body is re-indented in place, not changed. Use GitHub's "Hide whitespace" (?w=1). Read in this order: return_to_plaza_checked() (3 lines), the PlazaReturnActions comment, fly_toward_plaza(), the max_tries limit in PokemonSV_WorldNavigation.cpp, then the tests.

Tests

ScriptedPlazaReturnActions can script whether each fly happens. 4 new PokemonSV::BBQPlazaReturn cases:

  • a fly that didn't happen uses an attempt, then arrives (with overshoot)
  • 3 flies that never happen fail the return, with no banner reads
  • a failed fly and a wrong landing both count toward the 3
  • with no banner to check, a failed fly is still retried

The console side (the 3-try limit, battles) is console-only. All 35 native BBQ cases pass (macOS arm64).

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

dayfine and others added 2 commits October 22, 2026 21:19
fly_toward_plaza() retried until it flew, with no limit: each pass mashed
B back to the overworld and ran fly_to_closest_pokecenter_on_map(), which
itself tries up to 17 times (~13 s each). In bbq-m5 (11:20) the same "no
Pokecenter at max warpable level" failure repeated for minutes. The roadmap (M13)
records one return that took 8m50s.

fly_toward_plaza() now tries once, with at most 3 closest-Pokecenter
tries (fly_to_closest_pokecenter_on_map() takes a try limit; it defaults
to 17, so other callers are unchanged), and returns whether it flew. A
battle on the way also ends the try. return_to_plaza_checked() counts a
fly that didn't happen as one of its 3 attempts, so after 3 the return
fails through the existing path (OperationFailedException) instead of
looping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Give PlazaReturnCase's `fly_results` 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
@dayfine dayfine added farmer Farming programs game:sv Scarlet/Violet labels Nov 1, 2026
@dayfine

dayfine commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

Superseded by consolidated Tree 3 PR #274.

@dayfine dayfine closed this Nov 9, 2026
@dayfine
dayfine deleted the bbq/plaza-return-bounds branch November 13, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

farmer Farming programs game:sv Scarlet/Violet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant