Skip to content

BBQ Farmer: run the Auto Battle loop against injectable game steps, with a per-pass log - #15

Closed
dayfine wants to merge 7 commits into
bbq/tests-filefrom
bbq/auto-battle-seam
Closed

dayfine wants to merge 7 commits into
bbq/tests-filefrom
bbq/auto-battle-seam

Conversation

@dayfine

@dayfine dayfine commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Depends on #51 (PokemonAutomation#1754, the BBQ tests file). Base: bbq/tests-file; the diff shows only this change. Children (fork): #17 → #18 → #21 → #31 → #32.

Part of PokemonAutomation/ComputerControl#263.

An Auto Battle quest spends most of its time outside battle, and its loop can't be changed safely (stop at the target, bound the attempt, heal less) until its decisions run without a Switch. This moves the loop of quest_auto_battle() into run_auto_battle(), with the game steps behind BBQAutoBattleActions, and logs one line per pass (kills, total, the lead's HP, time, next step); the console implementation makes today's calls with today's buttons and timings, so behavior is unchanged. The interface is already the one the follow-ups need, so they change only the loop: clear(stop_at_kills) returns the lead's last known HP, backed by a new opt-in stop_early predicate on use_lets_go_to_clear_in_front() (default none, so its other callers are unchanged), and run_auto_battle() returns a BBQAutoBattleResult; for now the loop never stops a clear early and only logs the HP. ConsoleBBQAutoBattleActions holds the old loop body moved with renames (context to m_context, etc.), so compare it by eye with git diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change bbq/tests-file...bbq/auto-battle-seam. The PokemonSV::BBQAutoBattle tests in PokemonSV_BBQTests.cpp pin today's behavior with a scripted fake timed from one live pass; with the full app built on macOS arm64, the native BBQ runner passes 15 of 15.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

dayfine and others added 2 commits October 27, 2026 22:59
PokemonSV_Tests.cpp registers every SV test, and each BBQ change adds
its controller tests there, so parallel BBQ changes all conflict in it.
Move the Tera encounter tests unchanged into
Programs/Farming/PokemonSV_BBQTests.cpp, registered through one
add_tests_BBQ() call, following the add_tests_<Module>() pattern the
detectors use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Move the decisions of quest_auto_battle() into run_auto_battle(), with
the game steps (fly to Chargestone, clear, return to Central Plaza,
heal) behind BBQAutoBattleActions. The console version makes today's
calls with today's buttons and timings, so behavior is unchanged.

The interface is the one the follow-up policies need, so they change
only the loop: clear() takes a kill count to stop at and returns the
lead's last known HP, and run_auto_battle() returns why it stopped.
For the stop count, use_lets_go_to_clear_in_front() takes an optional
stop_early predicate; its default is none, so its other callers are
unchanged. The loop passes no stop count yet, so every clear still runs
until no kill has been heard for 6 seconds.

Log one line per pass: its kills, the running total, the lead's HP, the
time spent and what happens next. Native tests in
PokemonSV_BBQTests.cpp use a scripted fake that charges each step the
seconds measured on one live pass, and pin today's behavior: the final
pass still heals, and with no kills the loop never ends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine force-pushed the bbq/auto-battle-seam branch from da1ffc8 to 0181f81 Compare October 28, 2026 08:07
@dayfine
dayfine changed the base branch from main to bbq/tests-file October 28, 2026 08:09
@dayfine
dayfine force-pushed the bbq/tests-file branch 2 times, most recently from bf82b48 to daa1de3 Compare October 28, 2026 20:37
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 2 PR #273.

@dayfine dayfine closed this Nov 9, 2026
@dayfine
dayfine deleted the bbq/auto-battle-seam 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 refactor No behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant