Repository navigation
Conversation
BBQSoloFarmer::program() runs its quest rounds inline against the console, so the round logic (which quests count, when to stop, when to save) can only be exercised by running the farmer on a Switch. Move the round loop into run_bbq_rounds(), which takes the game actions it depends on as a BBQGameActions interface: read the quests, process them, do a quest, report a completed quest, and end the round (saving if due). BBQSoloFarmer implements these with the calls they replace, in the same order; the date fix, save/reset, stats and notification move together into end_round(). Startup, flying to the plaza and end-of-program handling stay in program(). The commented-out single-quest debug block declares its own egg counter now that the loop locals have moved. process_quest_list() only reads its quest list and egg count, so take them as const& and by value. Add PokemonSV::BBQFarmerRounds, a table of scenarios run against a simulated singleplayer quest panel: 3 blue quests, completed quests are replaced, impossible quests are skipped, and a panel with nothing doable is rerolled. Each scenario checks the number of completed quests and the exact action sequence: finishing the round that reaches the goal, a quest already gone, a failed quest, a panel with nothing doable, saving at exact multiples, and stopping when out of eggs. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The farmer saved and reset when the completion count was an exact multiple of SAVE_NUM_QUESTS. A round that completed nothing while the count sat at 0 or 50 saved again, and a round going from 49 to 52 skipped the 50 milestone entirely. Compare the count before and after each round and ask end_round() to save once when it crosses a multiple of the interval. Stalled rounds and an interval of 0 never save. Fix the option label to say "completing", not "attempting". Add two PokemonSV::BBQFarmerRounds scenarios that fail with the old rule: a round that skips past a milestone, and rounds with no completions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
… out process_quest_list() decided what to do with each quest and pressed the buttons for it in the same loop, so the decisions could only be checked on a Switch. plan_quests() now makes the decisions from the options alone: which quests to do, which panel slots to reroll, and whether to reroll all. process_quest_list() carries out the plan, and opening the panel is a shared helper instead of three copies. All rerolls now move the cursor to the quest's slot. The out-of-eggs reroll used to reroll the top slot; the egg quest is a red quest and red quests are listed at the top, so this is the same in practice. OOEggs::Stop reaching the planner is now an InternalProgramError, since the farmer stops before that can happen. Unit tests cover the plan for exclusions, duplicate rows, quests that are not possible, and eggs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
process_and_do_quest() gives up on a quest after NUM_RETRIES retries, but the quest stays on the panel, so the next round attempts it again with a fresh set of retries. A quest that cannot be done, such as a sneak-up whose target does not spawn, is retried forever. run_bbq_rounds() now remembers quests that failed all their attempts and leaves them out of later rounds. A quest is forgotten once a read of 4 known quests shows it gone, so it gets its attempts again if it comes back. If only failed quests are doable, the farmer stops instead of spending BP to reroll them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Move the out-of-eggs choice, the exclusions table rows, a single-slot reroll and the reroll of every slot into file-local helpers, so plan_quests() and process_quest_list() read as one level of steps. Explain why the language-selection error is commented out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
reroll_slot() opened the quest panel, pressed DOWN once per slot from where it assumed the cursor was, and pressed A twice. The panel does not always open with the cursor on the top quest: on a Switch it opened where the cursor was left, so the reroll paid for a different quest than planned. Nothing checked the menu opened or the quest changed, so running out of BP went unnoticed and the same quest was rerolled every round. reroll_quest() now does a reroll through injectable BBQRerollActions: open the reroll menu wherever the cursor is, see which quest the menu opened next to from its arrow, move to the planned quest, and only then confirm. Afterwards it reads the panel (up to 3 times, as OCR can miss a read) to check the quest was replaced. Panel or menu not found stops before spending BP; a quest not replaced stops without an error report, as it usually means out of BP. The arrow boxes for the top three slots were checked on a Switch; the fourth uses the same spacing. Reroll-all is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
plan_quests() dropped quests the farmer cannot do (pickup, flying photo and catch) before looking at the exclusions table, so a reroll row for one of them did nothing: the quest stayed on the panel and blocked the slot. Pickup could not be picked in the table at all. The table is now applied first. Reroll and skip rows work for quests the farmer cannot do; a run row for one is ignored, since there is no route for it. Pickup is listed in the table. With nothing to do and nothing rerolled, the first quest the farmer cannot do that has no table row is rerolled instead of every quest, which costs one reroll instead of three or four. Every quest is still rerolled when there is no such quest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
process_quest_list() takes the panel by const reference since PokemonAutomation#1632, so the rerolls work on a copy.
A quest that fails all its retries is skipped while it stays on the panel. That keeps the farmer going, but the quest blocks its slot, and if every doable quest is one that failed the farmer stops. OUT_OF_RETRIES now chooses what happens: - Skip (default): as before. - Reroll: reroll the failed quest, so its slot gets a new quest. Uses reroll_quest_slot(), which checks which quest it pays for and that it was replaced. - Stop: end the program there, through the normal end of program. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
# Conflicts: # SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BBQSoloFarmer.cpp
dayfine
added a commit
that referenced
this pull request
Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
This was referenced Oct 22, 2026
Closed
Give BBQRoundsScenario's `never_completes`, `new_quests` 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
Give BBQRerollScenario's `replacements`, `expected_rerolled_slots` 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
Brings in the default member initializers for its test scenario fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Brings in the default member initializers for its test scenario fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Brings in the default member initializers for its test scenario fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Give BBQRerollScenario's `read_override`, `expected_observed_panel` 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
Brings in the default member initializers for its test scenario fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Give BBQRoundsScenario's `expected_attempted` 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
After a failed quest was rerolled (OUT_OF_RETRIES = Reroll), the round loop read the panel 3 times before the next attempt, each right after a read of the same unchanged panel: - The out-of-retries reroll now returns its verified read, and the next plan starts from it unless the round ended with a save and reset. - reroll_quest() also reuses a 3-slot read when the panel used for the reroll had 3 slots, every slot is known and the other slots agree. A 3-slot read after a 4-slot panel (a missed 4th quest) is still not reused. - The first dispatch of a round reuses the panel its work was chosen from: process_quest_list() only returns work when it changed nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Give BBQRoundsScenario's `table_rerolls`, `expected_reads` 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
force-pushed
the
bbq/panel-read-reuse
branch
from
October 23, 2026 04:25
57088de to
f4d4c47
Compare
dayfine
force-pushed
the
bbq/replan-after-reroll
branch
from
October 28, 2026 08:14
e4c5cc4 to
09982bb
Compare
The base was rebuilt since this branch forked: the stack under it was re-merged onto main, the exclusions-table reroll (fork #9) was dropped, and the BBQ tests moved to Programs/Farming/PokemonSV_BBQTests.cpp. Took the base for everything except this PR's own change (7dfc056 + f4d4c47), which is re-applied on top: reroll_quest() returns its verified read and 3-slot reads are reusable when the panel had 3 slots; run_bbq_rounds() seeds the next plan from it unless the round saved, and always reuses the scheduling panel for the first dispatch, next to the base's doable-read guard and failed-quest filter. Its tests moved into PokemonSV_BBQTests.cpp; the simulated process_quest_list() keeps the base's out_of_bp, and the base-only round scenarios drop the read before each round's first dispatch. 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 1 PR #272. |
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
In the R3 live run (2026-10-22 07:39–07:40), one failed quest with
OUT_OF_RETRIES = Rerollmade the round loop read the quest panel 3 times before the next attempt, with no game action that could change the panel between those reads and the ones just before them:BBQGameActions::reroll_quest()returned nothing, so scheduling read the panel again ("Reading quest panel for scheduling").Each read is about 4–5 s.
Change
BBQGameActions::reroll_quest()returns the verified read fromreroll_quest_slot()(whenreroll_quest()found it reusable).run_bbq_rounds()uses it to plan the next round, unless the round ended with a save: the save resets the game, so the panel is read again after one. The date fix inend_round()does not change the quests.reroll_quest()also reuses a 3-slot read, but only when the panel used for that reroll had 3 slots too, every slot is known, and every other slot agrees with that panel. A 3-slot read after a 4-slot panel (a missed 4th quest) is still not reused, nor is a 4-slot read after a 3-slot panel.forget_quests_gone_from_panel()needs 4 known slots), so a missed 4th slot cannot give a failed quest new attempts.process_quest_list()only returns work when it changed nothing in game (any reroll returns an empty list), and nothing runs between it and the first dispatch. The interface comment now says so.No other behavior changes. Reads inside game steps (the reroll's own reads, the read after a quest attempt) are unchanged.
Panel reads by the round loop
From the native scenarios in
PokemonSV_Tests.cpp(the "before" numbers follow the same scenario through #13's code):Tests
BBQReroll: new 3-slot cases (reused when the panel had 3 slots; not reused with an unknown slot, another changed slot, or a 4th quest the panel missed). Two existing 3-slot cases now expect the observation.BBQFarmerRounds: the fake can now reroll a slot as an exclusions-table row does (table_rerolls), itsreroll_quest()returns its read, and scenarios can assert a read count (expected_reads). New: the R3 case with and without reusable reads, and a failed reroll before a save. Existing expectations lose the read before each round's first dispatch (read process read dobecomesread process do); "failed reroll on full board" now reuses its read.PokemonSV::BBQ*): 53 passed, 0 failed (BBQuestPlan 14, BBQReroll 17, BBQFarmerRounds 22) on 57088de, built with Ninja arm64 RelWithDebInfo. With the round-loop changes (a) and (c) reverted in place, 21BBQFarmerRoundsscenarios fail, including both new read-count scenarios (6 and 7 reads counted).How to review
Read
run_bbq_rounds()inPokemonSV_BBQSoloFarmer.cppfirst, then the reuse condition inreroll_quest()(PokemonSV_BlueberryQuests.cpp), then the tests. Nothing is moved.🤖 Generated with Claude Code
https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E