Skip to content

BBQ Farmer: show BP earned, spent, net and BP/hour in the stats - #16

Closed
dayfine wants to merge 9 commits into
bbq/reroll-impossible-questsfrom
bbq/bp-status
Closed

dayfine wants to merge 9 commits into
bbq/reroll-impossible-questsfrom
bbq/bp-status

Conversation

@dayfine

@dayfine dayfine commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Stage 0 ("measure it"), after stage 1. Based on bbq/reroll-impossible-quests (#25) with bbq/bp-reader-crop (PokemonAutomation#1628) merged in, so the diff also shows PokemonAutomation#1628's BP reader until it merges. Parents: #25 → … → #51 → main, and PokemonAutomation#1628.

Part of PokemonAutomation/ComputerControl#263.

The BBQ Farmer's stats count quests but not BP, so a change can't be judged by the BP it makes per hour. read_quests() already screenshots the quest panel, which shows the balance, so it now optionally reads the BP from that screenshot (no extra button presses), and every quest read in the farmer's game actions, including those inside a reroll, feeds a small BBQPointsLedger: a rise is earned, a drop is spent, an OCR failure is skipped; one read_BP() after the last batch picks up its reward. The stats show BP Earned and BP Spent (saved), plus Net BP and, for the current run, BP/hour (shown, not saved). read_quests() now opens the panel with the existing open_quest_panel() instead of its own copy of the same presses. New PokemonSV::BBQPointsLedger tests; 71 BBQ tests pass on macOS arm64, and the stats showed BP throughout three Switch runs (S0b, S1b, S1c in STAGE_RUNS.md).

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

@dayfine
dayfine force-pushed the bbq/bp-reader-crop branch 2 times, most recently from c2fde24 to 39ba660 Compare October 27, 2026 01:27
dayfine added a commit that referenced this pull request Oct 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine changed the base branch from bbq/bp-reader-crop to bbq/reroll-impossible-quests October 27, 2026 22:14
dayfine added a commit that referenced this pull request Oct 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine and others added 3 commits October 27, 2026 22:58
The Blueberry Points crop ended at x=0.957, which included the left
stroke of the "B" in the "BP" suffix. PaddleOCR read it as an extra
digit, so a balance of 6750 came back as 67501.

Narrow the crop to end at x=0.954 and move the reader into
Inference/PokemonSV_BlueberryPointsReader so it can be tested from a
captured frame without depending on the BBQ program code. read_BP()
still opens and closes the panel and delegates to the shared reader.

Register four PokemonSV::BlueberryPoints unit tests at 1920x1080 and
1280x720 on two full-frame reference screenshots (6750 and 6740 BP,
taken one reroll apart). The images go to the CommandLineTests repo
under PokemonSV/BlueberryPoints/. With the old crop restored, all four
fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The BBQ Farmer counts quests but not what they are worth, so a change to
the program can't be judged by the BP it makes per hour.

read_quests() already screenshots the quest panel, which shows the BP
balance in its corner. It now takes an optional out-parameter and reads
the balance from that same screenshot with the reader from
PokemonAutomation#1628, so no button presses are added.
BBQSoloFarmerGameActions passes it at every quest read, including the
reads inside a reroll, and feeds each balance into a small
BBQPointsLedger: a rise between two reads is earned, a drop (a reroll)
is spent, and OCR failures (-1) are skipped. The BP read that decides
whether a quest not possible can be rerolled is recorded too, and one
extra read_BP() after the last batch picks up its reward.

The stats show "BP Earned" and "BP Spent" as saved counters, plus a
derived "Net BP" and, for the current run, "BP/hour" over the span
between the first and latest reads. The derived values are not written
to the stats file.

read_quests() now opens the panel with open_quest_panel(), which presses
the same buttons and waits for the same watcher, instead of its own
copy, to stay under the function length limit.

Add data-driven PokemonSV::BBQPointsLedger unit tests, with the other BBQ
tests in PokemonSV_BBQTests.cpp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine force-pushed the bbq/reroll-impossible-quests branch from 74a0749 to a45c9de Compare October 28, 2026 08:14
# Conflicts:
#	SerialPrograms/Source/VideoGames/PokemonSV/PokemonSV_Tests.cpp
dayfine added a commit that referenced this pull request Oct 30, 2026
# Conflicts:
#	SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BBQSoloFarmer.cpp
@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/bp-status 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