Skip to content

[BBQ Tree 2] Auto Battle execution loop, bounds, heal threshold and quest-done check - #273

Draft
dayfine wants to merge 50 commits into
mainfrom
bbq/tree2-auto-battle
Draft

dayfine wants to merge 50 commits into
mainfrom
bbq/tree2-auto-battle

Conversation

dayfine and others added 30 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
run_auto_battle() passes the kill target to clear(), so the clear ends
as soon as the kills reach it, and on the pass that reaches it returns
to Central Plaza without healing or re-flying. In the tests' model this
saves 34 s per quest (the 6 s tail, the heal and the re-fly).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
run_auto_battle() had no bound: if kills stopped registering (wrong
lead, no spawns, no audio) it never returned, and the farmer's retry
handling could not step in. It now stops after 3 passes in a row with
no kill, or after the pass that ends past the time limit (35 minutes
for Auto Battle 10, 60 for Auto Battle 30, about 3x the slowest
attempts seen). It returns to Central Plaza without healing, logs which
limit ended it, and leaves the outcome to the board check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ange)

Every Auto Battle pass used to end with a nurse heal and a re-fly to the
Central Plaza fly point, about 28 s, even when the lead was barely hurt.

Skip the heal and re-fly when the lead's HP, which clear() already reads
at the end of each clear, is at or above the new "Auto Battle Quest -
Heal Below HP %" option (default 50, like the Material Farmer's
Auto-Heal %). Unknown HP still heals. Skipping the re-fly is safe:
return_to_plaza() lands on the Central Plaza fly point, the same place
the first pass and quest_tera_raid()'s retry fly out from.

The per-pass log now says why the pass heals or not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The kill sound is heard in every step, not only while clearing: the lead
can finish a kill after the clear ends, as the flight back starts. Each
pass counted kills from its own start, so such a kill went into the total
but into no pass ("pass 2: 1 kills, 4/10" after "2/10" in R3b). Each pass
now counts the kills since the previous pass's line, so the passes add up
to the total.

Behavior change: when kills heard on the way back reach the target, stop
without healing instead of healing and then stopping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…d (C10)

The heard kill count runs about one short of the game's: a kill whose
sound is missed still counts in game. In R3b, 9 kills were heard after
pass 4 but the game had completed the quest, so pass 5 and its heal
(~100 s) were wasted.

After a pass that ends within 2 kills of the target, read the quest panel
at Central Plaza (the reader the post-quest check uses, ~5 s) before
healing. If the quest is gone, stop. Far from the target nothing changes.

Behavior change: a board read after passes that end near the target; an
attempt can end before the heard kills reach the target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
PokemonSV_Tests.cpp registers every SV test, and each BBQ change adds
its tests there, so parallel BBQ changes all conflict in it. Move the
BBQ tests unchanged into Programs/Farming/PokemonSV_BBQTests.cpp,
registered through one add_tests_BBQ() call, following the
add_tests_<Module>() pattern the detectors use: the Tera encounter
tests, the quest slug round trip and the Blueberry Points reader tests.

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
Conflict in PokemonSV_Tests.cpp: upstream converted Test_BlueberryPoints
to ImageUnitTest (PokemonAutomation#1554) while this branch moved it out. Kept the move and
carried the ImageUnitTest change into Programs/Farming/PokemonSV_BBQTests.cpp.

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
dayfine and others added 13 commits November 4, 2026 07:01
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
dayfine and others added 7 commits November 9, 2026 07:00
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
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
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