Skip to content

BBQ Farmer: save local screenshots for failed quest attempts - #1629

Closed
dayfine wants to merge 3 commits into
PokemonAutomation:mainfrom
dayfine:bbq/failure-screenshots
Closed

dayfine wants to merge 3 commits into
PokemonAutomation:mainfrom
dayfine:bbq/failure-screenshots

Conversation

@dayfine

@dayfine dayfine commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Depends on: #1625, which depends on #1631. Merge those first. Until they merge, this PR also shows their commits; only the last commit is new here.

When a catch quest times out entering battle, or a quest is still on the panel after an attempt, the logs say what failed but not what the screen showed.

Changes

  • New Programs/Farming/PokemonSV_BBQSnapshot.{h,cpp}:
    • save_bbq_snapshot(logger, frame, directory, quest, reason) saves the frame as <timestamp>-<quest>-<reason>.png and logs BBQ event=snapshot saved=<0|1> path=.... It returns the path, or an empty string if nothing was written.
    • bbq_snapshot_directory() is DEBUG_PATH()/BBQ/.
    • Unlike dump_image(), this stays on the local machine and sends nothing to telemetry.
  • Called at two points: the catch battle-entry timeout (battle-entry-timeout) and failed quest verification (verification-failed). In both cases it saves the current frame.
  • Two PokemonSV::BBQSnapshot tests write to a temp folder:
    • saving into a folder that doesn't exist yet: checks the file exists, plus the path pattern and the log line
    • a save that can't be written (a file is in the folder's place): checks it returns no path and logs saved=0

Validation

Native arm64 macOS build of the full app passes. Both snapshot tests pass, along with the #1625 and #1631 tests. No new Switch run for this version. An earlier version of these capture points was checked on Switch 1.

Controller sequences, retry limits and reroll policy are unchanged.

🤖 Generated with Claude Code

dayfine and others added 3 commits October 20, 2026 20:24
The BBQuests enum lived in Options/PokemonSV_BBQOption.h, but its slug
map and string_to_enum lived in Programs/Farming/
PokemonSV_BlueberryQuests.{h,cpp}. Anything that needed a quest name
had to depend on the whole BBQ program module, and
BlueberryCatchPhoto.h included BlueberryQuests.h only for these types
while BlueberryQuests.cpp included BlueberryCatchPhoto.h.

Move the enum and slug mapping into Options/PokemonSV_BBQuests.{h,cpp},
next to BBQOption.h, which now includes it. Add
BBQuests_enum_to_string, backed by a reverse map built once from the
existing slug map.

Move CameraAngle into BlueberryCatchPhoto.h, its only user. The
catch/photo module no longer includes BlueberryQuests.h.

No behavior change. Add a unit test that every quest round-trips
through its slug.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
BBQ failures are hard to attribute to a specific quest and attempt from
the existing logs. Add one-line "BBQ ..." events:

- board: panel detected and quest slugs in board order, each time
  read_quests() reads the panel
- per attempt: start, route_return and result, with attempt/limit and
  route, verification and total durations
- catch battle-entry timeout, and retry exhaustion

BBQLogger depends only on Logger and the Options/PokemonSV_BBQuests
leaf, so the quest and catch/photo modules call into it without a
dependency back. Durations use explicit steady_clock timestamps so
tests can check them without depending on wall-clock time.

Add four PokemonSV::BBQDiagnosticLogs tests with a recording logger
covering board formatting, success, failure with retry exhaustion, and
long/zero durations. Controller sequences, retry limits and reroll
policy are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
When a catch quest times out entering battle, or a quest is still on
the panel after an attempt, the logs say what failed but not what the
screen showed.

Add save_bbq_snapshot(), which saves the current frame to
DEBUG_PATH()/BBQ/ as <timestamp>-<quest>-<reason>.png and logs a
"BBQ event=snapshot" line with the outcome. Unlike dump_image(), it
stays on the local machine and sends nothing to telemetry. Call it at
the battle-entry timeout and at failed quest verification.

Add PokemonSV::BBQSnapshot tests that save into a folder that does not
exist yet and check the file, path and log line, and that check a
save that cannot be written returns no path and logs saved=0.

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

dayfine commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing for now to keep the upstream queue to PRs that are ready: this one waits on unmerged parent PRs. It continues on my fork as dayfine#3, and I'll reopen it here once its parents merge.

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