Skip to content

BBQ Farmer: let a quest that fails all its retries be rerolled or stop the program - #1645

Closed
dayfine wants to merge 7 commits into
PokemonAutomation:mainfrom
dayfine:bbq/exhausted-quest-actions
Closed

dayfine wants to merge 7 commits into
PokemonAutomation:mainfrom
dayfine:bbq/exhausted-quest-actions

Conversation

@dayfine

@dayfine dayfine commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Depends on: #1642 (on #1632) and #1659 (on #1640). Merge those first. Until then this branch merges the two stacks and shows all their commits; the change here is the last commit only. Not ready: it will be rebased onto main once they merge.

With #1642, 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 once every doable quest is one that failed, the farmer stops.

Change

A new option, Out of Retries, chooses what happens when a quest fails all its retries:

Option Behavior
Skip (default) Same as #1642: not attempted again while it stays on the panel.
Reroll Reroll the failed quest so its slot gets a new one. Costs BP.
Stop End the program there, through the normal end of program (go home, fix time, finish notification).

Tests

2 new PokemonSV::BBQFarmerRounds cases: Reroll (the failed quest is replaced and its replacement is attempted the next round) and Stop. The existing cases run with the Skip default. All 30 BBQ cases pass.

Codex's earlier version of this PR is kept in the local branch backup/exhausted-quest-actions-codex. Compared with it:

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

dayfine and others added 4 commits October 20, 2026 22:02
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
… 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
@dayfine dayfine changed the title Apply bounded fallback actions after BBQ retry exhaustion (M6) BBQ Farmer: choose Stop, Skip, or Reroll when quest retries run out Oct 21, 2026
dayfine and others added 3 commits October 21, 2026 13:05
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
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
@dayfine
dayfine force-pushed the bbq/exhausted-quest-actions branch from 00f5cca to a1b685f Compare October 21, 2026 20:10
@dayfine dayfine changed the title BBQ Farmer: choose Stop, Skip, or Reroll when quest retries run out BBQ Farmer: let a quest that fails all its retries be rerolled or stop the program Oct 21, 2026
@dayfine

dayfine commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing for now to keep the upstream queue to PRs that are ready: this one waits on unmerged parent PRs. It continues on my fork as dayfine#10, and I'll reopen it here once its parents merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant