Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
ea359ba
Run the BBQ farmer's rounds against an injectable BBQGameActions
dayfine Oct 21, 2026
548ac95
Fix BBQ save/reset milestones across stalled and batched rounds
dayfine Oct 21, 2026
102957f
Separate the BBQ quest plan from the controller actions that carry it…
dayfine Oct 21, 2026
053e59b
Do not retry a failed BBQ quest every round while it stays on the panel
dayfine Oct 21, 2026
fe5055a
Break the BBQ quest planner and its controller steps into helpers
dayfine Oct 21, 2026
5b86bee
Check which quest a BBQ reroll pays for, and that it was replaced
dayfine Oct 21, 2026
f7e3ba6
Let the BBQ exclusions table reroll quests the farmer cannot do
dayfine Oct 21, 2026
54b72e2
Merge bbq/verified-reroll into bbq/exhausted-quest-actions
dayfine Oct 21, 2026
a1b685f
Let the BBQ farmer reroll or stop on a quest that fails all its retries
dayfine Oct 21, 2026
230c520
Merge commit 'f7e3ba6f0' into bbq/reuse-quest-board
dayfine Oct 22, 2026
3f1f79f
BBQ Farmer: reuse complete reroll observations before new game actions
dayfine Oct 22, 2026
463c692
Merge commit '548ac951c' into bbq/replan-after-reroll
dayfine Oct 22, 2026
0ec3325
lab: adapt save regression to persistent failed-quest handling
dayfine Oct 22, 2026
2ff0fdd
BBQ Farmer: replan after rerolling an exhausted quest
dayfine Oct 22, 2026
8dbace6
Preserve existing out-of-BP reroll fixtures during extraction
dayfine Oct 22, 2026
30e84ab
Merge branch 'bbq/reuse-quest-board' into bbq/replan-after-reroll
dayfine Oct 22, 2026
50a3704
BBQ tests: default-initialize scenario fields
dayfine Oct 23, 2026
84800b2
BBQ tests: default-initialize scenario fields
dayfine Oct 23, 2026
ce64cd4
Merge bbq/persistent-quest-retries into bbq/exhausted-quest-actions
dayfine Oct 23, 2026
b5a1aa4
Merge bbq/verified-reroll into bbq/exhausted-quest-actions
dayfine Oct 23, 2026
0c1e5cb
Merge bbq/exhausted-quest-actions into bbq/reuse-quest-board
dayfine Oct 23, 2026
bbc2318
BBQ tests: default-initialize scenario fields
dayfine Oct 23, 2026
d9641e5
Merge bbq/reuse-quest-board into bbq/replan-after-reroll
dayfine Oct 23, 2026
e4c5cc4
BBQ tests: default-initialize scenario fields
dayfine Oct 23, 2026
7dfc056
BBQ Farmer: reuse verified quest panel reads after a failed-quest reroll
dayfine Oct 22, 2026
f4d4c47
BBQ tests: default-initialize scenario fields
dayfine Oct 23, 2026
778fe05
BBQ Farmer: chain no-trip quests without round actions between
dayfine Oct 22, 2026
2aedcd0
Fix BP OCR crop including the "BP" suffix
dayfine Oct 21, 2026
2779423
PokemonSV: move the BBQ farmer's tests into their own file
dayfine Oct 27, 2026
272e7fe
Run the BBQ farmer's rounds against an injectable BBQGameActions
dayfine Oct 21, 2026
c976129
Separate the BBQ quest plan from the controller actions that carry it…
dayfine Oct 21, 2026
ab57d3e
Break the BBQ quest planner and its controller steps into helpers
dayfine Oct 21, 2026
037549e
Pin the ways the BBQ farmer's round loop gets stuck today
dayfine Oct 27, 2026
e6afd5e
Check which quest a BBQ reroll pays for, and that it was replaced
dayfine Oct 21, 2026
6e412fc
Do not retry a failed BBQ quest every round while it stays on the panel
dayfine Oct 21, 2026
e3ef02c
Stop the BBQ Farmer instead of rerolling the quest panel forever
dayfine Oct 21, 2026
30063b3
Fix BBQ save/reset milestones across stalled and batched rounds
dayfine Oct 21, 2026
01e5059
Let the BBQ farmer reroll or stop on a quest that fails all its retries
dayfine Oct 21, 2026
2548fd2
Let the BBQ exclusions table reroll quests the farmer cannot do
dayfine Oct 21, 2026
ba751e5
Reroll BBQ quests the farmer cannot do as soon as they appear
dayfine Oct 22, 2026
a45c9de
Reroll a BBQ quest not possible only when BP covers the reroll
dayfine Oct 23, 2026
1105281
Merge bbq/bp-reader-crop (PokemonAutomation/Arduino-Source#1628) into…
dayfine Oct 28, 2026
57c0153
BBQ Farmer: show BP earned, spent, net and BP/hour in the stats
dayfine Oct 27, 2026
8d5cb48
BBQ Farmer: check the BP stats against the rerolls at the end of a run
dayfine Oct 27, 2026
d887e93
Log one line naming the slot and quest for every BBQ reroll
dayfine Oct 23, 2026
7cf661b
Log BBQ boards and quest attempts through BBQLogger
dayfine Oct 21, 2026
cc69593
Save local screenshots for failed BBQ quest attempts
dayfine Oct 21, 2026
dcd1f2a
BBQ Farmer: reuse complete reroll observations before new game actions
dayfine Oct 22, 2026
09982bb
BBQ Farmer: replan after rerolling an exhausted quest
dayfine Oct 22, 2026
daa1de3
PokemonSV: move the BBQ farmer's tests into their own file
dayfine Oct 27, 2026
5ffc857
Merge bbq/tests-file into bbq/save-milestone-tracker
dayfine Oct 30, 2026
7af8daa
Merge upstream main into bbq/save-milestone-tracker
dayfine Oct 30, 2026
55b15c3
Merge bbq/save-milestone-tracker into bbq/quest-planner
dayfine Oct 30, 2026
28c507d
Merge bbq/pin-stuck-rounds into bbq/verified-reroll
dayfine Oct 30, 2026
0724327
Merge bbq/quest-planner into bbq/pin-stuck-rounds
dayfine Oct 30, 2026
cf9e021
Merge bbq/verified-reroll into bbq/persistent-quest-retries
dayfine Oct 30, 2026
17be76c
Merge bbq/persistent-quest-retries into bbq/endless-reroll-guard
dayfine Oct 30, 2026
4165625
Merge bbq/endless-reroll-guard into bbq/save-reset-milestones
dayfine Oct 30, 2026
ba0dc4f
Merge bbq/save-reset-milestones into bbq/exhausted-quest-actions
dayfine Oct 30, 2026
06b038e
Merge bbq/exhausted-quest-actions into bbq/reroll-impossible-quests
dayfine Oct 30, 2026
eb05450
Merge bbq/reroll-impossible-quests into bbq/bp-status
dayfine Oct 30, 2026
b38f774
Merge bbq/bp-status into bbq/bp-check
dayfine Oct 30, 2026
21ea2e2
BBQ Farmer: fail the egg quest when the box has no egg, and check for…
dayfine Oct 30, 2026
1b35931
BBQ tests: default-initialize the quest plan scenario fields again
dayfine Oct 30, 2026
6fbd5ab
Merge bbq/verified-reroll into bbq/persistent-quest-retries
dayfine Oct 30, 2026
5dac130
Merge bbq/persistent-quest-retries into bbq/endless-reroll-guard
dayfine Oct 30, 2026
0373660
Merge bbq/endless-reroll-guard into bbq/save-reset-milestones
dayfine Oct 30, 2026
76830c6
Merge bbq/save-reset-milestones into bbq/exhausted-quest-actions
dayfine Oct 30, 2026
99df317
Merge bbq/exhausted-quest-actions into bbq/reroll-impossible-quests
dayfine Oct 30, 2026
1a85444
Merge bbq/reroll-impossible-quests into bbq/bp-status
dayfine Oct 30, 2026
764e954
Merge bbq/bp-status into bbq/bp-check
dayfine Oct 30, 2026
6fe3341
Merge bbq/reroll-impossible-quests into bbq/egg-preflight
dayfine Oct 30, 2026
bc5f592
Merge origin/bbq/verified-reroll into bbq/reroll-log-line
dayfine Oct 30, 2026
e240be7
Merge origin/bbq/exhausted-quest-actions into bbq/reuse-quest-board
dayfine Oct 30, 2026
73ac821
Merge origin/bbq/reuse-quest-board into bbq/replan-after-reroll
dayfine Oct 30, 2026
89327ce
Merge origin/bbq/tests-file into bbq/diagnostics-and-baseline
dayfine Oct 30, 2026
19dbf3a
Merge origin/bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Oct 30, 2026
d460079
Merge origin/bbq/diagnostics-and-baseline into bbq/failure-screenshots
dayfine Oct 30, 2026
bcad34a
Merge origin/bbq/panel-read-reuse into bbq/batch-quests
dayfine Oct 30, 2026
ea7728a
BBQ Farmer: throw after the reroll result switch in reroll_quest_slot()
dayfine Oct 30, 2026
d2a6e25
Merge origin/bbq/reuse-quest-board into bbq/replan-after-reroll
dayfine Oct 30, 2026
27628cd
Merge origin/bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Oct 30, 2026
bde6ba6
Merge origin/bbq/panel-read-reuse into bbq/batch-quests
dayfine Oct 30, 2026
9e681ce
Merge upstream/main into bbq/tests-file
dayfine Nov 2, 2026
5b267ff
Merge bbq/tests-file into bbq/diagnostics-and-baseline
dayfine Nov 2, 2026
b309eff
Merge bbq/tests-file into bbq/save-milestone-tracker
dayfine Nov 2, 2026
8374f25
Merge bbq/diagnostics-and-baseline into bbq/failure-screenshots
dayfine Nov 2, 2026
ffeabc9
Merge bbq/save-milestone-tracker into bbq/quest-planner
dayfine Nov 2, 2026
2a761d1
Merge bbq/quest-planner into bbq/pin-stuck-rounds
dayfine Nov 2, 2026
64bd8a2
Merge bbq/pin-stuck-rounds into bbq/verified-reroll
dayfine Nov 2, 2026
c35afb5
Merge bbq/verified-reroll into bbq/persistent-quest-retries
dayfine Nov 2, 2026
c7fef9a
Merge bbq/verified-reroll into bbq/reroll-log-line
dayfine Nov 2, 2026
e436f71
Merge bbq/persistent-quest-retries into bbq/endless-reroll-guard
dayfine Nov 2, 2026
3c81a59
Merge bbq/endless-reroll-guard into bbq/save-reset-milestones
dayfine Nov 2, 2026
94778b7
Merge bbq/save-reset-milestones into bbq/exhausted-quest-actions
dayfine Nov 2, 2026
43b51e6
Merge bbq/exhausted-quest-actions into bbq/reuse-quest-board
dayfine Nov 2, 2026
8d50500
Merge bbq/reuse-quest-board into bbq/replan-after-reroll
dayfine Nov 2, 2026
d9b46f8
Merge bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Nov 2, 2026
ecb1021
Merge bbq/panel-read-reuse into bbq/batch-quests
dayfine Nov 2, 2026
d17b369
Merge bbq/exhausted-quest-actions into bbq/reroll-impossible-quests
dayfine Nov 2, 2026
fe6023a
Merge bbq/reroll-impossible-quests into bbq/bp-status
dayfine Nov 2, 2026
2aaefaf
Merge bbq/bp-status into bbq/bp-check
dayfine Nov 2, 2026
fe53639
Merge bbq/reroll-impossible-quests into bbq/egg-preflight
dayfine Nov 2, 2026
01ed372
Merge origin/main into bbq/tests-file
dayfine Nov 3, 2026
2a220ac
Merge origin/bbq/tests-file into bbq/save-milestone-tracker
dayfine Nov 3, 2026
4d21f8f
Merge origin/bbq/save-milestone-tracker into bbq/quest-planner
dayfine Nov 3, 2026
de7b2a6
Merge origin/bbq/quest-planner into bbq/pin-stuck-rounds
dayfine Nov 3, 2026
6761211
Merge origin/bbq/pin-stuck-rounds into bbq/verified-reroll
dayfine Nov 3, 2026
1fc1cdb
Merge origin/bbq/verified-reroll into bbq/persistent-quest-retries
dayfine Nov 3, 2026
cebea1a
Merge origin/bbq/persistent-quest-retries into bbq/endless-reroll-guard
dayfine Nov 3, 2026
0a49487
Merge origin/bbq/endless-reroll-guard into bbq/save-reset-milestones
dayfine Nov 3, 2026
e8daa60
Merge origin/bbq/save-reset-milestones into bbq/exhausted-quest-actions
dayfine Nov 3, 2026
11b60ec
Merge origin/bbq/exhausted-quest-actions into bbq/reroll-impossible-q…
dayfine Nov 3, 2026
fc4e342
Merge origin/bbq/reroll-impossible-quests into bbq/egg-preflight
dayfine Nov 3, 2026
9104806
Merge origin/bbq/reroll-impossible-quests into bbq/bp-status
dayfine Nov 3, 2026
07527c6
Merge origin/bbq/bp-status into bbq/bp-check
dayfine Nov 3, 2026
556186c
Merge origin/bbq/verified-reroll into bbq/reroll-log-line
dayfine Nov 3, 2026
5a64f12
Merge origin/bbq/exhausted-quest-actions into bbq/reuse-quest-board
dayfine Nov 3, 2026
9e838f4
Merge origin/bbq/reuse-quest-board into bbq/replan-after-reroll
dayfine Nov 3, 2026
90d1109
Merge origin/bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Nov 3, 2026
eb4ab12
Merge origin/bbq/panel-read-reuse into bbq/batch-quests
dayfine Nov 3, 2026
18ac703
Merge origin/bbq/tests-file into bbq/diagnostics-and-baseline
dayfine Nov 3, 2026
e4212e3
Merge origin/bbq/diagnostics-and-baseline into bbq/failure-screenshots
dayfine Nov 3, 2026
bc8cbfb
Merge origin/main into bbq/tests-file
dayfine Nov 4, 2026
667f82c
Merge origin/bbq/tests-file into bbq/save-milestone-tracker
dayfine Nov 4, 2026
e175391
Merge origin/bbq/save-milestone-tracker into bbq/quest-planner
dayfine Nov 4, 2026
2837ef3
Merge origin/bbq/quest-planner into bbq/pin-stuck-rounds
dayfine Nov 4, 2026
c18f0fd
Merge origin/bbq/pin-stuck-rounds into bbq/verified-reroll
dayfine Nov 4, 2026
09bca55
Merge origin/bbq/verified-reroll into bbq/persistent-quest-retries
dayfine Nov 4, 2026
bf0c7da
Merge origin/bbq/persistent-quest-retries into bbq/endless-reroll-guard
dayfine Nov 4, 2026
f315f67
Merge origin/bbq/endless-reroll-guard into bbq/save-reset-milestones
dayfine Nov 4, 2026
2819fa4
Merge origin/bbq/save-reset-milestones into bbq/exhausted-quest-actions
dayfine Nov 4, 2026
c02f9d7
Merge origin/bbq/exhausted-quest-actions into bbq/reroll-impossible-q…
dayfine Nov 4, 2026
2ed94e3
Merge origin/bbq/reroll-impossible-quests into bbq/egg-preflight
dayfine Nov 4, 2026
ba38a38
Merge origin/bbq/reroll-impossible-quests into bbq/bp-status
dayfine Nov 4, 2026
0c894e2
Merge origin/bbq/bp-status into bbq/bp-check
dayfine Nov 4, 2026
06da8c6
Merge origin/bbq/verified-reroll into bbq/reroll-log-line
dayfine Nov 4, 2026
20d89db
Merge origin/bbq/exhausted-quest-actions into bbq/reuse-quest-board
dayfine Nov 4, 2026
62720ba
Merge origin/bbq/reuse-quest-board into bbq/replan-after-reroll
dayfine Nov 4, 2026
29577ff
Merge origin/bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Nov 4, 2026
353a5e1
Merge origin/bbq/panel-read-reuse into bbq/batch-quests
dayfine Nov 4, 2026
2f60462
Merge origin/bbq/tests-file into bbq/diagnostics-and-baseline
dayfine Nov 4, 2026
71b556e
Merge origin/bbq/diagnostics-and-baseline into bbq/failure-screenshots
dayfine Nov 4, 2026
6259f0d
Merge origin/main into bbq/tests-file
dayfine Nov 6, 2026
e1e6e9e
Merge origin/bbq/tests-file into bbq/save-milestone-tracker
dayfine Nov 6, 2026
d7b4d51
Merge origin/bbq/save-milestone-tracker into bbq/quest-planner
dayfine Nov 6, 2026
d4717be
Merge origin/bbq/quest-planner into bbq/pin-stuck-rounds
dayfine Nov 6, 2026
33bc445
Merge origin/bbq/pin-stuck-rounds into bbq/verified-reroll
dayfine Nov 6, 2026
f0fb8bc
Merge origin/bbq/verified-reroll into bbq/persistent-quest-retries
dayfine Nov 6, 2026
75578be
Merge origin/bbq/persistent-quest-retries into bbq/endless-reroll-guard
dayfine Nov 6, 2026
084a1af
Merge origin/bbq/endless-reroll-guard into bbq/save-reset-milestones
dayfine Nov 6, 2026
a025c84
Merge origin/bbq/save-reset-milestones into bbq/exhausted-quest-actions
dayfine Nov 6, 2026
249e101
Merge origin/bbq/exhausted-quest-actions into bbq/reroll-impossible-q…
dayfine Nov 6, 2026
ab9d53c
Merge origin/bbq/reroll-impossible-quests into bbq/egg-preflight
dayfine Nov 6, 2026
c56f401
Merge origin/bbq/reroll-impossible-quests into bbq/bp-status
dayfine Nov 6, 2026
a55e4d7
Merge origin/bbq/bp-status into bbq/bp-check
dayfine Nov 6, 2026
6e9871d
Merge origin/bbq/verified-reroll into bbq/reroll-log-line
dayfine Nov 6, 2026
368d1db
Merge origin/bbq/exhausted-quest-actions into bbq/reuse-quest-board
dayfine Nov 6, 2026
ac56bca
Merge origin/bbq/reuse-quest-board into bbq/replan-after-reroll
dayfine Nov 6, 2026
97e8770
Merge origin/bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Nov 6, 2026
9c622a6
Merge origin/bbq/panel-read-reuse into bbq/batch-quests
dayfine Nov 6, 2026
bba2924
Merge origin/bbq/tests-file into bbq/diagnostics-and-baseline
dayfine Nov 6, 2026
6d483c6
Merge origin/bbq/diagnostics-and-baseline into bbq/failure-screenshots
dayfine Nov 6, 2026
1411932
Consolidate reroll diagnostics into the canonical BBQ logger
dayfine Nov 6, 2026
6ac6f9f
Merge consolidated BBQ diagnostics and preserve local failure snapshots
dayfine Nov 6, 2026
57002fb
Initialize the default expected log color for Windows Clang
dayfine Nov 6, 2026
5db585b
Merge remote-tracking branch 'origin/bbq/diagnostics-and-baseline' in…
dayfine Nov 6, 2026
dbc3c74
Separate BBQ quest dispatch and retry execution from quest implementa…
dayfine Nov 6, 2026
be6feea
Include the environment definition used by the extracted dispatcher
dayfine Nov 6, 2026
12e2180
Clarify BBQ diagnostic arguments and register logger cases through th…
dayfine Nov 6, 2026
084c571
Propagate BBQ review fixes and register snapshot cases through the BB…
dayfine Nov 6, 2026
490c83c
Place the panel-result explanation beside the quest reader
dayfine Nov 6, 2026
d29f79b
Merge remote-tracking branch 'origin/bbq/diagnostics-and-baseline' in…
dayfine Nov 6, 2026
722af5a
Undo linter-driven quest execution split and retain the existing disp…
dayfine Nov 7, 2026
2f6af0a
Keep failure evidence on the existing unsplit quest dispatcher
dayfine Nov 7, 2026
3e744be
Merge origin/bbq/bp-check into bbq/tree1-core-planner
dayfine Nov 9, 2026
24a9390
Merge origin/bbq/egg-preflight into bbq/tree1-core-planner
dayfine Nov 9, 2026
18f7ce5
Merge origin/bbq/failure-screenshots into bbq/tree1-core-planner
dayfine Nov 9, 2026
61c86cc
Merge remote-tracking branch 'origin/main' into bbq/tree1-core-planner
dayfine Nov 9, 2026
61c6aae
PokemonSV: fix batch conversion and panel_detected identifier in BBQ …
dayfine Nov 9, 2026
62127ed
Merge origin/main into bbq/tree1-core-planner
dayfine Nov 9, 2026
34d7b7d
Merge origin/main into bbq/tree1-core-planner
dayfine Nov 10, 2026
e9c42c4
Merge origin/main into bbq/tree1-core-planner
dayfine Nov 11, 2026
a1f0654
Merge origin/main into bbq/tree1-core-planner
dayfine Nov 12, 2026
6e722f0
Merge origin/main into bbq/tree1-core-planner
dayfine Nov 13, 2026
ac5569c
Merge origin/main into bbq/tree1-core-planner
dayfine Nov 14, 2026
03db993
Merge origin/main into bbq/tree1-core-planner
dayfine Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
static EnumDropdownDatabase<BBQuests> database{
{BBQuests::auto_10, "auto-10", "Defeat 10 wild Pokemon using Auto Battle!"},
{BBQuests::make_tm, "make-tm", "Make yourself a TM!"},
//{BBQuests::pickup_10, "pickup-10", "Pick up items on the ground 10 times!"},
{BBQuests::pickup_10, "pickup-10", "Pick up items on the ground 10 times!"},
{BBQuests::sneak_up, "sneak-up", "Successfully sneak up on 1 Pokemon and surprise them with a battle!"},
{BBQuests::photo_fly, "photo-fly", "Take a photo of a wild Pokemon in flight!"},
{BBQuests::photo_swim, "photo-swim", "Take a photo of a wild Pokemon that is swimming!"},
Expand Down Expand Up @@ -108,8 +108,9 @@
"Exclude the quests in the table. If you want to skip a quest, select it below. "
"(Quests can be explicitly included, but this is not necessary.) "
"Do not exclude too many quests, as rerolling costs BP. "
"The program will automatically reroll all quests if none are possible, but will not handle being out of BP. "
"Does not include egg hatching or pickup quests, as eggs are handled in other options and pickup is not possible. ",
"If no quest is possible, the program rerolls one quest it cannot do, or all quests if there is none. "
"Quests the program cannot do, such as pickup, are never run, but can be rerolled or skipped here. "
"Does not include egg hatching, as eggs are handled in other options. ",
//"Duplicates of the same quest",
//duplicates will work in table order. might lead to weird behavior like rerolling and then marking a quest as complete.
//won't break the program though.
Expand All @@ -131,7 +132,7 @@
}


BBQOption::BBQOption(OCR::LanguageOCROption* language_option)

Check failure on line 135 in SerialPrograms/Source/VideoGames/PokemonSV/Options/PokemonSV_BBQOption.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health

PokemonAutomation::NintendoSwitch::PokemonSV::BBQOption::BBQOption( OCR :: LanguageOCROption * language_option): function_lines=92, limit=50, allowed 81
: GroupOption("Blueberry Quests", LockMode::UNLOCK_WHILE_RUNNING)
, m_language_owner(language_option == nullptr
? new OCR::LanguageOCROption(
Expand All @@ -149,7 +150,7 @@
1000
)
, SAVE_NUM_QUESTS(
"<b>Save and reset the game after attempting this many quests:</b><br>This preserves progress and prevents potential game lags from long runs.<br>0 disables this option.",
"<b>Save and reset the game after completing this many quests:</b><br>This preserves progress and prevents potential game lags from long runs.<br>0 disables this option.",
LockMode::UNLOCK_WHILE_RUNNING, 50
)
, INVERTED_FLIGHT(
Expand Down Expand Up @@ -190,6 +191,16 @@
"<b>Number of Retries:</b><br>Reattempt a quest this many times if it fails.",
LockMode::UNLOCK_WHILE_RUNNING, 1, 0, 5
)
, OUT_OF_RETRIES(
"<b>Out of Retries:</b><br>When a quest fails all its retries, do the selected option.",
{
{OutOfRetries::Skip, "skip", "Skip Quest - Not attempted again while it stays on the panel"},
{OutOfRetries::Reroll, "reroll", "Reroll Quest - Costs BP"},
{OutOfRetries::Stop, "stop", "Stop Program"},
},
LockMode::UNLOCK_WHILE_RUNNING,
OutOfRetries::Skip
)
, FIX_TIME_WHEN_DONE(
"<b>Fix Time when Done:</b><br>Fix the time after the program finishes.",
LockMode::UNLOCK_WHILE_RUNNING, false
Expand All @@ -210,6 +221,7 @@
PA_ADD_OPTION(BATTLE_AI);
PA_ADD_OPTION(CATCH_ON_WIN);
PA_ADD_OPTION(NUM_RETRIES);
PA_ADD_OPTION(OUT_OF_RETRIES);
PA_ADD_OPTION(FIX_TIME_WHEN_DONE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ class BBQOption : public GroupOption{
KeepGoing,
};

enum class OutOfRetries{
Skip,
Reroll,
Stop,
};

OCR::LanguageOCROption& LANGUAGE;

SimpleIntegerOption<uint64_t> NUM_QUESTS;
Expand All @@ -98,6 +104,7 @@ class BBQOption : public GroupOption{
TeraFarmerCatchOnWin CATCH_ON_WIN;

SimpleIntegerOption<uint8_t> NUM_RETRIES;
EnumDropdownOption<OutOfRetries> OUT_OF_RETRIES;

BooleanCheckBoxOption FIX_TIME_WHEN_DONE;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/* BBQ Diagnostic Logger
*
* From: https://github.com/PokemonAutomation/
*
*/

#include <sstream>
#include <string_view>
#include "Common/Cpp/PrettyPrint.h"
#include "PokemonSV_BBQLogger.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonSV{


namespace{

constexpr std::string_view UNKNOWN = "unknown";

std::string_view quest_label(BBQuests quest){
const std::string& slug = BBQuests_enum_to_string(quest);
return slug.empty() ? UNKNOWN : std::string_view(slug);
}

void append_elapsed(std::ostream& out, std::string_view field, BBQAttemptLog::Clock::duration elapsed){
const auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(elapsed);
out << ' ' << field << "_ms=" << milliseconds.count()
<< ' ' << field << "=\"" << duration_to_string(milliseconds) << '\"';
}

} // namespace


void BBQLogger::board(bool panel_detected, const std::vector<BBQuests>& quests){
std::ostringstream out;
out << "BBQ event=board panel_detected=" << panel_detected << " quests=";
bool first = true;
for (BBQuests quest : quests){
if (!first){
out << ',';
}
first = false;
out << quest_label(quest);
}
m_logger.log(out.str());
}

void BBQLogger::reroll_attempt(size_t slot, BBQuests quest){
m_logger.log(
"Rerolling quest " + std::to_string(slot + 1) + " (" + std::string(quest_label(quest)) + ")."

Check warning on line 51 in SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BBQLogger.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
);
}

void BBQLogger::battle_entry_timeout(BBQuests quest){
std::ostringstream out;
out << "BBQ quest=" << quest_label(quest) << " event=battle_entry outcome=timeout";
m_logger.log(out.str());
}

void BBQLogger::retry_exhausted(BBQuests quest){
std::ostringstream out;
out << "BBQ quest=" << quest_label(quest) << " event=retry_exhausted recovery=skip_current_batch";
m_logger.log(out.str(), COLOR_RED);
}


BBQAttemptLog::BBQAttemptLog(
Logger& logger, BBQuests quest,
unsigned attempt, unsigned limit,
Clock::time_point start
)
: m_logger(logger), m_start(start), m_route_end(start)
{
std::ostringstream out;
out << "BBQ quest=" << quest_label(quest) << " attempt=" << attempt << " limit=" << limit;
m_attempt_description = out.str();
out << " event=start";
m_logger.log(out.str());
}

void BBQAttemptLog::route_return(Clock::time_point end){
m_route_end = end;
std::ostringstream out;
out << m_attempt_description << " event=route_return";
append_elapsed(out, "elapsed", end - m_start);
m_logger.log(out.str());
}

void BBQAttemptLog::result(bool completed, Clock::time_point end){
std::ostringstream out;
out << m_attempt_description << " event=result outcome="
<< (completed ? "absent_from_board" : "still_on_board");
append_elapsed(out, "verification", end - m_route_end);
append_elapsed(out, "total", end - m_start);
m_logger.log(out.str());
}


} // namespace PokemonSV
} // namespace NintendoSwitch
} // namespace PokemonAutomation
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/* BBQ Diagnostic Logger
*
* From: https://github.com/PokemonAutomation/
*
*/

#ifndef PokemonAutomation_PokemonSV_BBQLogger_H
#define PokemonAutomation_PokemonSV_BBQLogger_H

#include <chrono>
#include <string>
#include <vector>
#include "Common/Cpp/Logging/AbstractLogger.h"
#include "VideoGames/PokemonSV/Options/PokemonSV_BBQuests.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonSV{


// Formats one-line "BBQ ..." diagnostic events through an existing Logger.
// Does no image I/O and no controller input.
class BBQLogger{
public:
explicit BBQLogger(Logger& logger) : m_logger(logger) {}

// The quest board as read from one panel snapshot: whether the panel was
// detected, and the quests in board order.
void board(bool panel_detected, const std::vector<BBQuests>& quests);

// Logs a zero-based board slot before attempting its reroll, including failures.
void reroll_attempt(size_t slot, BBQuests quest);

// A catch quest gave up waiting for the battle menu after navigating to its target.
void battle_entry_timeout(BBQuests quest);

// A quest used all of its attempts and the rest of the batch will be skipped.
void retry_exhausted(BBQuests quest);

private:
Logger& m_logger;
};


// The event sequence and monotonic timing of one quest attempt.
// Timestamps default to now; tests pass fixed values.
class BBQAttemptLog{
public:
using Clock = std::chrono::steady_clock;

// Logs the start of attempt number `attempt` out of `limit`.
BBQAttemptLog(
Logger& logger, BBQuests quest,
unsigned attempt, unsigned limit,
Clock::time_point start = Clock::now()
);

// The quest routine returned; logs the time since start.
void route_return(Clock::time_point end = Clock::now());

// The board was re-read. `completed` means the quest is no longer on it.
// Logs the verification time since route_return() and the total time.
void result(bool completed, Clock::time_point end = Clock::now());

private:
Logger& m_logger;
const Clock::time_point m_start;
Clock::time_point m_route_end;
std::string m_attempt_description;
};


} // namespace PokemonSV
} // namespace NintendoSwitch
} // namespace PokemonAutomation
#endif
Loading
Loading