Skip to content

BBQ Farmer: don't retry a failed quest every round while it stays on the panel - #6

Closed
dayfine wants to merge 7 commits into
bbq/verified-rerollfrom
bbq/persistent-quest-retries
Closed

dayfine wants to merge 7 commits into
bbq/verified-rerollfrom
bbq/persistent-quest-retries

Conversation

@dayfine

@dayfine dayfine commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

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

Part of PokemonAutomation/ComputerControl#263.

process_and_do_quest() gives up on a quest after NUM_RETRIES retries. But the failed quest stays on the panel, so the next round attempts it again with a fresh set of retries. A quest that can't be done, such as a sneak-up whose target never spawns, is retried forever. With NUM_RETRIES = 1 that means 2 attempts every round, indefinitely.

Change

All of this is in run_bbq_rounds(); process_and_do_quest() is unchanged.

  • A quest whose do_quest() call fails (meaning it used all of its retries) is remembered as failed and left out of later rounds. With NUM_RETRIES = 1 it gets 2 attempts in total.
  • A failed quest is forgotten once a panel read shows it gone, so it gets its attempts again if it comes back. Only a read of 4 known quests counts. The first 3 slots are always read, as UnableToDetect if OCR fails, but a 4th slot only appears when OCR reads it, so a 3-slot read may have missed a quest. A missed read must not hand a failing quest new attempts.
  • If the only doable quests left on the panel are failed ones, the farmer logs why and stops instead of spending BP to reroll them. Choosing a different action for this case is out of scope here.

Tests

4 new PokemonSV::BBQFarmerRounds scenarios, run against the simulated quest panel from PokemonAutomation#1632. The fake can now have quests that never complete, and a custom list of quests that replace completed ones.

Scenario What it checks
failed quest is not attempted again sneak-up fails in round 1 and is skipped in round 2
stops when only failed quests are doable the farmer stops before round 2 dispatches anything
failed quest that leaves a full panel is attempted again after a 4-slot read without sneak-up, it is attempted again when it returns
failed quest missing from a 3-slot panel stays failed the same sequence on 3 slots keeps it failed

All 10 farmer-round scenarios pass.

This replaces the earlier version. That version passed an optional retry tracker into process_and_do_quest(), used forward declarations and #pragma once, and had Python replay tests that compiled pieces of production code cut out of the source by text matching. The live smoke run it reported (3 quests completed on the first attempt) never reached the failed-quest path. No live run of the failed path has been done for this version either.

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. A failed quest staying on the panel did not come up (each failure was rerolled first); covered by the BBQFarmerRounds tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

@dayfine
dayfine force-pushed the bbq/save-milestone-tracker branch from f4a95b1 to 21b53ed Compare October 27, 2026 06:52
@dayfine
dayfine force-pushed the bbq/persistent-quest-retries branch from 50a3704 to 00a5ce3 Compare October 27, 2026 06:52
@dayfine
dayfine changed the base branch from bbq/save-milestone-tracker to bbq/verified-reroll October 27, 2026 06:53
@dayfine
dayfine force-pushed the bbq/verified-reroll branch from 7c4feb6 to 6ebb53d Compare October 27, 2026 19:16
@dayfine
dayfine force-pushed the bbq/persistent-quest-retries branch from 00a5ce3 to 90cb78e Compare October 27, 2026 19:16
@dayfine
dayfine force-pushed the bbq/persistent-quest-retries branch from 90cb78e to 7a7c880 Compare October 28, 2026 03:43
@dayfine
dayfine force-pushed the bbq/verified-reroll branch from 6ebb53d to 99d6497 Compare October 28, 2026 03:43
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
@dayfine
dayfine force-pushed the bbq/verified-reroll branch from 99d6497 to e6afd5e Compare October 28, 2026 08:14
@dayfine
dayfine force-pushed the bbq/persistent-quest-retries branch from 7a7c880 to 6e412fc Compare October 28, 2026 08:14
@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 1 PR #272.

@dayfine dayfine closed this Nov 9, 2026
@dayfine
dayfine deleted the bbq/persistent-quest-retries 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