Repository navigation
Description
What this is. On main, BBQ Farmer can stall for hours on some quest boards and spends much of its time on quests it can't finish. I've been fixing that on a Switch 1 (Traditional Chinese): run the farmer for 2 hours, look at what failed, fix it, repeat. My test build now runs 2-hour sessions without stalls at about 550 net BP per hour, where main made about 400 and then stalled.
What changes, in plain terms
- It doesn't get stuck. A quest that keeps failing is rerolled once its retries run out, instead of being retried every round forever. Quests the farmer can't do are rerolled as soon as they appear.
- It checks where it landed. After each flight it reads the place name and flies again if it's in the wrong spot.
- It finds its target. For catches it locks on to a nearby Pokémon (ZL) instead of throwing blind, and for photos it turns the camera toward the target first.
- It picks better quests. Quests are ordered and rerolled by their measured BP per minute.
- Auto Battle quests are shorter. It stops at the kill target and heals only when HP is low.
How it will arrive. About 60 small PRs, each one change with unit tests, in this order:
- Small, independent pieces: a crash fix in error reporting, splitting the test file, new detectors with their test images in CommandLineTests.
- Shared routines other programs can use: lock-on, leaving a battle, Terarium flights. These get extra testing because other programs call them.
- The farmer's own logic: quest choice, retries, Auto Battle. Most of these are already written as PRs on my fork.
- Routes for individual quests, each tested on the Switch.
- The program's docs page, listing the known gaps below.
I keep at most two PRs open here and open the next one when one merges. Behavior changes get their own PR and say so in the title. The full plan, with sizes and the risk of each PR, is here.
Where your input helps most
- Where shared routines should live, for example a new
PokemonSV_OverworldControlsfile for lock-on and riding. - Whether a species → type table belongs in Resources, like Max Lair's
rental_pokemon.json.
Known gaps: photographing flying Pokémon is unreliable; rain shortens glides; lock-on takes the nearest Pokémon even when it's the wrong species.
Earlier status (2026-10-22) and original report (2026-10-20)
Update (2026-10-22): with fixes for most items below, lab runs on Switch 1 now sustain ~600 net BP/hour with no stalls (604 BP/h over a 2-hour run, 34 quests), up from ~400 BP/hour with multi-hour stalls on main; simulations project ~715 BP/hour once the remaining items land.
Status by item (2026-10-22)
| # | Item | Fix | Live result |
|---|---|---|---|
| 1 | tera-self-defeat depends on one Kleavor |
open: look around / fight any nearby wild Pokémon | glide always lands on the right spot; Kleavor absent in 9 of 22 attempts |
| 2 | Retry limit resets every round | failed-quest memory + out-of-retries action (Reroll/Stop), was PokemonAutomation/Arduino-Source#1642/PokemonAutomation/Arduino-Source#1645 | failing quests are rerolled after NUM_RETRIES + 1 attempts |
| 3 | Unsupported quests block slots | exclusions can reroll them (was PokemonAutomation/Arduino-Source#1644); impossible quests rerolled on sight, red included | one run lost ~60% throughput to two dead slots; rerolling them restored it (259 → 604 BP/h) |
| 4 | Unreadable 4th slot | correction: slot 4 reads no matches when there is no red quest. A red quest sits in the top slot and pushes the three blue quests down, so a 4-entry board means a red is present |
no fix needed |
| 5 | No spawn wait / search | open (same work as item 1) | |
| 6 | Radar ball not found after landing | not investigated; landings are verified independently (item 7) | |
| 7 | Fly destinations not verified | landing check reads the place-name banner after returning to Central Plaza and retries | 73/73 landings confirmed, 0 false retries |
| 8 | Save/reset repeats without progress | save only when milestones advance, was PokemonAutomation/Arduino-Source#1626 | |
| 9 | Tera handler runs without a battle; heal after a failed catch | battle-entry guard (PokemonAutomation/Arduino-Source#1636); skip the heal when no battle started | heal skip seen live |
| — | Cost-aware selection | measured per-route success and time drive the reroll list; a model of BP/hour per work item orders the queue | Auto Battle 10: 337 → 230 s (heal only below 50% HP, stop at target); quest-panel reads 4.0 → 2.9 per completion |
Also found: every 10th completion pays a +110 BP bonus, and red quests pay 100–150 BP but block the next red while unfinished.
Upstream PRs open for review: PokemonAutomation/Arduino-Source#1628, PokemonAutomation/Arduino-Source#1631, PokemonAutomation/Arduino-Source#1632, PokemonAutomation/Arduino-Source#1636, PokemonAutomation/Arduino-Source#1640. The rest wait on those and are tracked in the status comment below.
Original report
Game
- Sword/Shield
- Brilliant Diamond/Shining Pearl
- Legend Arceus
- Nintendo Switch Features
- Scarlet/Violet
Type
- New Program
- Improvement to BBQ Farmer (PokemonSV:BBQSoloFarmer)
Description
BBQ Farmer can get stuck retrying quests that depend on a single wild spawn, while unsupported quests block board slots. In my run only one of three quest slots was productive.
Environment: Pokémon Automation v0.70.10 · Switch 1 · Game language: Traditional Chinese · Number of Retries = 1 · Arduino-Source main @ 889c1d5
Additional context
Observed
Board: sneak-up, pickup-10, tera-self-defeat, plus a 4th slot read as no matches. The program spent rounds retrying tera-self-defeat (~2 min per attempt) without ever finding Kleavor, while pickup-10 can't be done at all.
Log excerpt:
Quest: Tera-self and defeat any wild.
Attempting to fly to Canyon Plaza.
Unable to locate the overworld radar ball, falling back on hard coded location.
Did not enter battle. Did Kleavor spawn?
Turn 1: Tera.
Attempting to return to Central Plaza.
...
String Match Result: ... (sneak-up)
String Match Result: ... (pickup-10)
String Match Result: ... (tera-self-defeat)
String Match Result: no matches
Current quest exists on list. Quest did not complete.
Quest: Tera-self and defeat any wild.
When I stopped the program at the target spot, wild Pokémon appeared within seconds, which suggests the program arrives and gives up before spawns load on Switch 1.
Bugs / reliability
-
tera-self-defeatdepends on one Kleavor spawn. The quest accepts any wild Pokémon, butquest_tera_self_defeat()does a long blind glide (Switch 1: 8000 ms + 13200 ms) to drop on Kleavor. On my Switch 1 it never succeeds. Suggest: battle the nearest wild Pokémon near the plaza (the code itself notes "plenty of Scyther in the area"). -
Retry limit resets every round.
quest_attemptsis local toprocess_and_do_quest(), andBBQSoloFarmer::program()re-reads the board each round, so a failing quest getsNUM_RETRIES + 1attempts per round, forever. Board order also puts it first each time. Suggest: track failures per quest across rounds; after the limit, apply a configurable fallback (Reroll or Skip). -
Unsupported quests block slots, and the reroll-all fallback never fires.
not_possible_quests(pickup_10,photo_flying,catch_flying,UnableToDetect) is checked before the exclusions table:pickup_10isn't in the dropdown at all.catch_flyingandphoto_flyingare in the dropdown, but any action set for them is ignored without warning.- "Reroll all when nothing is possible" only triggers when zero quests are doable, so a board with one doable quest keeps the dead slots forever.
Suggest: show these quests in the UI as unsupported, and let Reroll apply to them.
-
An unreadable slot is silently treated as impossible. The 4th slot OCRs as
no matches→UnableToDetect→ skipped. If this is the bonus (red) quest, bonus progress is blocked with no warning. Suggest: log a warning, and retry the OCR or reroll. -
Catch and photo routes have no spawn-loading wait and no search. Each quest type has one fixed location reached by fixed-timing glides; the program locks on and throws immediately on landing. Suggest: wait a few seconds after landing (configurable, longer on Switch 1), then rotate the camera and try lock-on a few times before declaring failure.
-
Radar ball detection fails after every landing.
Unable to locate the overworld radar ball, falling back on hard coded location.appears after every fly (Switch 1, Traditional Chinese). This may affect orientation for subsequent glides. -
Fly destinations aren't verified.
map_move_cursor_fly()moves the cursor by fixed joystick timing; the location name is only logged. "Fly successful" means the character landed, not that it landed at the intended spot. Suggest: OCR the selected fly point's name before confirming. -
Save/reset can repeat on rounds with no progress.
num_completed_quests % SAVE_NUM_QUESTS == 0is checked every round, so once the count hits a multiple of N, each round that completes nothing saves and resets again. Suggest: only save when the count has increased. -
Minor:
wild_battle_tera()runs even when no battle started (Did not enter battle→Turn 1: Tera.). Also, after a failed catch, the program heals at Central Plaza and then flies to Central Plaza again.
Feature: cost-aware quest selection
- Track per-quest-type attempt time
t_qand success ratep_q; expected completion time isT_q = t_q / p_q. - Run the fastest quests first.
- Reroll when
T_q − T̄ > C / λ, whereC= reroll cost (10 or 50 BP),λ= observed BP per minute, andT̄= average quest time. - Credit completions for progress toward the next bonus quest, since rerolls don't count toward it.
Items 2 + 3 alone would have restored about 2/3 of the lost throughput in my run.
Activity
dayfine commentedon Oct 20, 2026
Proposed incremental workplan
Overnight logs show approximately 401 net BP/hour before 05:05, followed by 3.2 hours without another completion on
photo-savanna / pickup-10 / sneak-up. Replacing those three blue quests costs 30 BP before menu time/replacement difficulty. This supports recovery fixes before sophisticated navigation. Earnings are inferred from board changes, not measured balance snapshots.Implement one milestone/behavior change per commit, validate it, then advance:
1. Prevent stalls
Gate: the observed stalled board recovers or stops clearly, with bounded spending. Keep navigation unchanged during this comparison.
2. Re-measure velocity and prioritize
The continuous pre-stall sample has TM 6/6 successful batches, 0.82 min/batch; in-flight photos 4/4, 1.14 min; Auto-10 9/9, 5.40 min; Sneak-up 4/26, 3.22 min. These include retries/failures, but exclude between-task overhead. Small samples and changing route conditions limit extrapolation. Blue completions also advance bonus quests, so direct reward alone is insufficient grounds to reroll Auto-10.
3. Reduce overhead through separate experiments
Radar/fly-destination verification gets its own follow-up if incorrect orientation/arrival is reproduced.
4. Improve target acquisition
Objective combinations and actual item collection follow as separate experiments. 400 BP/hour is a baseline, not a ceiling.
For every milestone, record revision/settings, focused checks, gameplay evidence, elapsed time and BP costs/results. Advance after validation; assess sustained net BP/hour and zero-return windows. No gameplay fixes are included in this planning update.
dayfine commentedon Oct 22, 2026
Status update (2026-10-21): PRs, sizes and review order
The work from this issue is now 16 PRs, each one change with native C++ unit tests. Only PRs with no unmerged parent are open upstream. The rest wait as PRs on my fork, stacked on their parents, and move upstream as their parents merge.
Size: all lines added or removed in
.cpp/.h, with tests counted separately.Most of the 354 lines removed in the upstream PRs are code that moved (for example, the quest list moving to its own module), not deleted behavior. PRs that move code have a "How to review" section saying what moved and what changed.
Open upstream: ready for review, independent of each other
BBQGameActions, so round logic is testable (prep)Waiting on the fork: moves upstream when its parent merges
The largest of these is +187 lines of production code, and most are under +100.
Suggested review order
Verification
Next, after M7: estimated sizes (renumbered from the plan above)
These are estimates, not measurements. They're based on the PRs so far: a quest area with no test seam yet needs a prep PR to add one first (+150 to +200 lines of code, +150 to +230 of tests, like #1632 and #1640), and a behavior change on an existing seam is +15 to +100 lines of code, with tests about the same size.
Total for M8 onward: about 15–20 PRs, +1,100 to +2,100 lines of production code and +1,200 to +1,900 lines of tests, about the same again as M1–M7. The first five rows are next in line and the most predictable: about 7–10 PRs and +500 to +900 lines of code. The rows marked "sized after investigation" will be re-estimated once their live diagnostics are in.
Each one is a single PR on the fork first, with a live run before it goes upstream.
[-][REQ] - BBQ Farmer: single-spawn targets, per-round retries, and silently dropped quests cut throughput to ~1/3 on Switch 1[/-][+][REQ] - BBQ Farmer: unsupported quests, single-spawn targets and per-round retries cut throughput (fixes now reach ~600 BP/h on Switch 1)[/+][-][REQ] - BBQ Farmer: unsupported quests, single-spawn targets and per-round retries cut throughput (fixes now reach ~600 BP/h on Switch 1)[/-][+][REQ] BBQ Farmer: run unattended for hours (status and PR plan)[/+][-][REQ] BBQ Farmer: run unattended for hours (status and PR plan)[/-][+]BBQ Farmer: run unattended for hours (status and PR plan)[/+]dayfine commentedon Oct 27, 2026
Update: the first two stages of the plan were checked on a Switch today, each with a build of
upstream
mainplus that stage's PRs.at the end of a run the program checks the balance change against the stats. 8 quests in 24
minutes, and the check matched exactly. An error report with no screenshot no longer crashes
the app.
without a completed quest. Every reroll hit the intended quest and was confirmed replaced;
quests that failed their retry and quests the farmer can't do were rerolled; saves happened
at each milestone. The BP check matched in every run.
These were 30-minute smoke tests, so they show the code works on the real game rather than a
BP/hour gain; that needs the 2-hour runs in the plan. Two setup problems turned up and will be
handled at program start: the hatch-egg quest with no egg left in the boxes leaves the game in
the box screen, and a Switch that has dimmed its screen after a few idle minutes isn't
recognised as the overworld.
Details: https://github.com/dayfine/Arduino-Source/blob/agents/pokemon_sv/STAGE_RUNS.md