Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 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
19dbf3a
Merge origin/bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Oct 30, 2026
27628cd
Merge origin/bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Oct 30, 2026
d9b46f8
Merge bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Nov 2, 2026
90d1109
Merge origin/bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Nov 3, 2026
29577ff
Merge origin/bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Nov 4, 2026
97e8770
Merge origin/bbq/replan-after-reroll into bbq/panel-read-reuse
dayfine Nov 6, 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 @@ -132,7 +132,7 @@

}

void run_bbq_rounds(Logger& logger, const BBQOption& options, BBQGameActions& game){

Check failure on line 135 in SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BBQSoloFarmer.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health

PokemonAutomation::NintendoSwitch::PokemonSV::run_bbq_rounds( Logger & logger , const BBQOption & options , BBQGameActions & game): function_lines=139, limit=50, allowed 129
if (!exclusions_leave_a_blue_quest(options)){
throw UserSetupError(logger, "The quest exclusions table skips or rerolls every blue quest the program can do.");
}
Expand Down Expand Up @@ -170,7 +170,6 @@
" quest panel reads. Check the game language and that you have BP to reroll."
);
}
const bool reused_panel = observed_panel.has_value();
if (observed_panel){
logger.log("Reusing verified quest panel for scheduling.");
quest_list = std::move(*observed_panel);
Expand All @@ -183,7 +182,9 @@
BBQuestBatch batch = game.process_quest_list(quest_list, eggs_hatched);
quests_to_do = std::move(batch.to_do);
observed_panel = std::move(batch.observed_panel);
if (reused_panel && !quests_to_do.empty() && !observed_panel){
//Work is only returned when nothing changed in game, so the panel
//it was chosen from is still current for the first dispatch.
if (!quests_to_do.empty() && !observed_panel){
dispatch_panel = quest_list;
}

Expand All @@ -202,10 +203,11 @@
quest_list.clear();
}

//Never carry an observation across quest actions or the round's date/reset work.
//Never carry an observation across quest actions or a save and reset.
observed_panel.reset();
const uint64_t completed_before_round = num_completed_quests;
bool replan_after_reroll = false;
std::optional<std::vector<BBQuests>> rerolled_panel;
for (auto current_quest : quests_to_do){
//Check if quest was already completed (ex. 500 meters completed while navigating to take a photo)
if (dispatch_panel){
Expand All @@ -231,7 +233,7 @@
break;
case BBQOption::OutOfRetries::Reroll:
logger.log("Reroll selected. Rerolling the failed quest.");
game.reroll_quest(current_quest);
rerolled_panel = game.reroll_quest(current_quest);
logger.log("Reroll finished. Discarding the remaining batch before scheduling.");
replan_after_reroll = true;
break;
Expand All @@ -258,7 +260,15 @@

uint64_t temp_save_num_option = options.SAVE_NUM_QUESTS;
// A round can cross a milestone without ending at an exact multiple.
game.end_round(bbq_save_due(completed_before_round, num_completed_quests, temp_save_num_option));
const bool save = bbq_save_due(completed_before_round, num_completed_quests, temp_save_num_option);
game.end_round(save);

//The reroll was the last game action of the round. Fixing the date
//does not change the quests, so its verified read can seed the next
//plan. A save resets the game, so the panel is read again after one.
if (rerolled_panel && !save){
observed_panel = std::move(rerolled_panel);
}
}
}

Expand Down Expand Up @@ -288,14 +298,14 @@
virtual bool do_quest(BBQuests quest, uint8_t& eggs_hatched) override{
return process_and_do_quest(m_env, m_env.console, m_context, m_options, quest, eggs_hatched);
}
virtual void reroll_quest(BBQuests quest) override{
virtual std::optional<std::vector<BBQuests>> reroll_quest(BBQuests quest) override{
std::vector<BBQuests> quests = PokemonSV::read_quests(m_env.program_info(), m_env.console, m_context, m_options);
auto iter = std::find(quests.begin(), quests.end(), quest);
if (iter == quests.end()){
m_env.log("Failed quest is no longer on the panel. Not rerolling.");
return;
return std::nullopt;
}
reroll_quest_slot(m_env.program_info(), m_env.console, m_context, m_options, quests, iter - quests.begin());
return reroll_quest_slot(m_env.program_info(), m_env.console, m_context, m_options, quests, iter - quests.begin());
}
virtual void quest_completed() override{
m_stats.questsCompleted++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define PokemonAutomation_PokemonSV_BBQSoloFarmer_H

#include <stdint.h>
#include <optional>
#include <vector>
#include "Common/Cpp/Logging/AbstractLogger.h"
#include "CommonFramework/Notifications/EventNotificationsTable.h"
Expand All @@ -34,6 +35,8 @@ class BBQGameActions{
// Decide which of the quests just read are worth attempting this round.
// May reroll quests in game, so the returned list can be empty even when
// `quests` is not; a complete post-reroll observation can seed selection.
// Only returns quests to attempt when it changed nothing in game, so
// `quests` still shows the panel.
virtual BBQuestBatch process_quest_list(
const std::vector<BBQuests>& quests, uint8_t eggs_hatched
) = 0;
Expand All @@ -44,8 +47,9 @@ class BBQGameActions{
virtual bool do_quest(BBQuests quest, uint8_t& eggs_hatched) = 0;

// Reroll a quest that failed all its attempts, if it is still on the
// panel. Spends BP.
virtual void reroll_quest(BBQuests quest) = 0;
// panel. Spends BP. Returns the panel read to verify the reroll when
// reroll_quest() found it reusable, so scheduling can skip a read.
virtual std::optional<std::vector<BBQuests>> reroll_quest(BBQuests quest) = 0;

// Progress reporting only: a quest was counted as completed. Lets stats
// update after every quest instead of once per round.
Expand Down
Loading
Loading