Skip to content

BBQ Farmer: stop instead of rerolling the quest panel forever - #5

Closed
dayfine wants to merge 7 commits into
bbq/persistent-quest-retriesfrom
bbq/endless-reroll-guard
Closed

dayfine wants to merge 7 commits into
bbq/persistent-quest-retriesfrom
bbq/endless-reroll-guard

Conversation

@dayfine

@dayfine dayfine commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Stage 1 ("never stuck"), PR 6 of 9. Based on bbq/persistent-quest-retries (#6), so the diff shows only this change. Parents: #6 → #8 → #53 → #38 → #37 → #51 → main.

Part of PokemonAutomation/ComputerControl#263.

When nothing on the quest panel is doable, the BBQ Farmer rerolls the whole panel and reads it again. If nothing can ever become doable, it does this forever, spending BP on every reroll. This PR stops the program with a setup error in that case.

Change

  • Startup check: run_bbq_rounds() throws UserSetupError before reading the panel if the exclusions table skips or rerolls every blue quest the program can do (blue quests minus not_possible_quests). A quest counts as doable when any table row for it says Run, which matches how process_quest_list() treats duplicate rows.
  • Read limit: after 30 panel reads in a row with nothing doable, it throws UserSetupError telling the user to check the game language and their BP. If the language is wrong, every quest reads as UnableToDetect. If BP runs out, rerolls stop changing the panel.

Why 30: with valid settings, a panel can have nothing doable and the next reroll fixes it. In a bad case where only 3 of the 31 blue quests are doable, a panel has nothing doable 73% of the time, so 30 such panels in a row happen with probability 0.008%. With the defaults (28 doable) the chance per panel is 0.02%.

Tests

There are 3 new PokemonSV::BBQFarmerRounds scenarios that run through the simulated quest panel from PokemonAutomation#1632. The panel can now be out of BP, meaning rerolls do nothing.

Scenario Expected
fails at start when every blue quest is excluded error before any panel read
a quest with a run row is not excluded all quests skipped except make-tm, which has a Run row, so the run proceeds
gives up when rerolling does not help 30 × (read, process), then error

All 9 farmer-round scenarios pass. Without this change, the first and third scenarios fail.

Tested on the Switch with the rest of stage 1 in runs S1b and S1c (STAGE_RUNS.md): 15 quests, no stretch over 11 min without a completion, BP check OK. Giving up on rerolls needs an empty BP balance, so it is covered by the BBQFarmerRounds tests only.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

When nothing on the panel is doable the farmer rerolls it and reads it
again. If nothing can ever become doable, the loop never ends.

Check at start that the exclusions table leaves at least one doable
blue quest, and give up with a UserSetupError after 30 reads in a row
with nothing doable (wrong game language, or no BP left to reroll).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine force-pushed the bbq/persistent-quest-retries branch from 7a7c880 to 6e412fc Compare October 28, 2026 08:14
@dayfine
dayfine force-pushed the bbq/endless-reroll-guard branch from 4fd705d to e3ef02c Compare October 28, 2026 08:14
@dayfine dayfine added farmer Farming programs game:sv Scarlet/Violet labels Nov 1, 2026
dayfine added a commit that referenced this pull request Nov 2, 2026
After the lake, the Lakefront's frame script walks the player 3 south, to
(17, 14) or a tile below (decomp, event timeline 00.02 #5), not onto the
entrance (17, 12). 00.02's end and 00.03's start take either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine

dayfine commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

Superseded by consolidated Tree 1 PR #272.

@dayfine dayfine closed this Nov 9, 2026
@dayfine
dayfine deleted the bbq/endless-reroll-guard 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