From 0a83df6e09640d412a98284274f302c89cd839e8 Mon Sep 17 00:00:00 2001 From: jw098 Date: Mon, 13 Oct 2025 14:17:32 -0700 Subject: [PATCH 1/4] setup for segment 30. move_from_glaseado_gym_to_north_province_area_one() to segment 30 --- .../AutoStory/PokemonSV_AutoStory.cpp | 8 +- .../AutoStory/PokemonSV_AutoStoryTools.cpp | 113 ------------ .../AutoStory/PokemonSV_AutoStoryTools.h | 3 - .../PokemonSV_AutoStory_Segment_29.cpp | 6 - .../PokemonSV_AutoStory_Segment_29.h | 8 - .../PokemonSV_AutoStory_Segment_30.cpp | 161 +++++++++++++++++- .../PokemonSV_AutoStory_Segment_30.h | 22 +++ .../PokemonSV_AutoStory_Segment_31.cpp | 9 + .../PokemonSV_AutoStory_Segment_31.h | 9 + 9 files changed, 203 insertions(+), 136 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp index 60ffdea221..f26f0344bf 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp @@ -105,8 +105,8 @@ std::vector> make_autoStory_segment_list(){ segment_list.emplace_back(std::make_unique()); segment_list.emplace_back(std::make_unique()); segment_list.emplace_back(std::make_unique()); - // segment_list.emplace_back(std::make_unique()); - // segment_list.emplace_back(std::make_unique()); + segment_list.emplace_back(std::make_unique()); + segment_list.emplace_back(std::make_unique()); // segment_list.emplace_back(std::make_unique()); // segment_list.emplace_back(std::make_unique()); // segment_list.emplace_back(std::make_unique()); @@ -720,6 +720,10 @@ void AutoStory::test_checkpoints( checkpoint_list.push_back([&](){checkpoint_74(env, context, notif_status_update, stats);}); checkpoint_list.push_back([&](){checkpoint_75(env, context, notif_status_update, stats);}); checkpoint_list.push_back([&](){checkpoint_76(env, context, notif_status_update, stats);}); + checkpoint_list.push_back([&](){checkpoint_77(env, context, notif_status_update, stats);}); + checkpoint_list.push_back([&](){checkpoint_78(env, context, notif_status_update, stats);}); + checkpoint_list.push_back([&](){checkpoint_79(env, context, notif_status_update, stats);}); + checkpoint_list.push_back([&](){checkpoint_80(env, context, notif_status_update, stats);}); if (end == 0){ diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.cpp index e161527023..6283d52726 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.cpp @@ -1203,119 +1203,6 @@ void checkpoint_reattempt_loop_tutorial( -void move_from_glaseado_gym_to_north_province_area_one(SingleSwitchProgramEnvironment& env, ProControllerContext& context){ - context.wait_for_all_requests(); - - DirectionDetector direction; - do_action_and_monitor_for_battles(env.program_info(), env.console, context, - [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ - - direction.change_direction(env.program_info(), env.console, context, 3.855289); - pbf_move_left_joystick(context, 128, 0, 200, 50); - - direction.change_direction(env.program_info(), env.console, context, 3.056395); - pbf_move_left_joystick(context, 128, 0, 300, 50); - - direction.change_direction(env.program_info(), env.console, context, 3.805047); - pbf_move_left_joystick(context, 128, 0, 700, 50); - - direction.change_direction(env.program_info(), env.console, context, 1.589021); - pbf_move_left_joystick(context, 128, 0, 600, 50); - - direction.change_direction(env.program_info(), env.console, context, 2.741829); - pbf_move_left_joystick(context, 128, 0, 300, 50); - }); - - // marker 1 {0.33125, 0.314815} {0.297396, 0.322222} {0.313021, 0.322222} - place_marker_offset_from_flypoint(env.program_info(), env.console, context, - {ZoomChange::ZOOM_IN, 0, 0, 0}, - FlyPoint::POKECENTER, - {0.313021, 0.322222} - ); - handle_when_stationary_in_overworld(env.program_info(), env.console, context, - [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ - overworld_navigation(env.program_info(), env.console, context, - NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY, - 128, 0, 20, 10, false); - }, - [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ - pbf_move_left_joystick(context, 255, 255, 40, 50); - realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); - } - ); - - // marker 2 {0.222396, 0.413889} {0.253646, 0.386111} - place_marker_offset_from_flypoint(env.program_info(), env.console, context, - {ZoomChange::ZOOM_IN, 0, 0, 0}, - FlyPoint::POKECENTER, - {0.253646, 0.386111} - ); - handle_when_stationary_in_overworld(env.program_info(), env.console, context, - [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ - overworld_navigation(env.program_info(), env.console, context, - NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY, - 128, 0, 20, 10, false); - }, - [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ - pbf_move_left_joystick(context, 0, 255, 40, 50); - realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); - } - ); - - - - // marker 3 {0.80625, 0.574074} {0.803125, 0.615741} {0.794792, 0.614815} (0.794792, 0.609259). - place_marker_offset_from_flypoint(env.program_info(), env.console, context, - {ZoomChange::KEEP_ZOOM, 255, 0, 50}, - FlyPoint::POKECENTER, - {0.794792, 0.609259} - ); - handle_when_stationary_in_overworld(env.program_info(), env.console, context, - [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ - overworld_navigation(env.program_info(), env.console, context, - NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY, - 128, 0, 50, 10, false); - }, - [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ - pbf_move_left_joystick(context, 255, 255, 40, 50); - realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); - } - ); - - // marker 4. set marker to pokecenter - realign_player_from_landmark( - env.program_info(), env.console, context, - {ZoomChange::KEEP_ZOOM, 255, 128, 80}, - {ZoomChange::KEEP_ZOOM, 0, 0, 0} - ); - handle_when_stationary_in_overworld(env.program_info(), env.console, context, - [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ - overworld_navigation(env.program_info(), env.console, context, - NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY, - 128, 0, 110, 10, false); - }, - [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ - pbf_move_left_joystick(context, 0, 255, 40, 50); - realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); - } - ); - - // marker 5. set marker past pokecenter - handle_unexpected_battles(env.program_info(), env.console, context, - [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ - realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_NEW_MARKER, 255, 255, 50); - }); - overworld_navigation(env.program_info(), env.console, context, - NavigationStopCondition::STOP_TIME, NavigationMovementMode::DIRECTIONAL_ONLY, - 128, 15, 12, 12, false); // can't wrap in handle_when_stationary_in_overworld(), since we expect to be stationary when walking into the pokecenter - - - fly_to_overlapping_flypoint(env.program_info(), env.console, context); - - -} - - void move_from_north_province_area_one_to_fighting_base(SingleSwitchProgramEnvironment& env, ProControllerContext& context){ DirectionDetector direction; do_action_and_monitor_for_battles(env.program_info(), env.console, context, diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.h index 8e36f96bb0..7578fec1b2 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.h @@ -326,9 +326,6 @@ void checkpoint_reattempt_loop_tutorial( -// moves player from Glaseado Gym Pokecenter to North Province Area One -void move_from_glaseado_gym_to_north_province_area_one(SingleSwitchProgramEnvironment& env, ProControllerContext& context); - // moves player from North Province Area One to Team Star Fighting base void move_from_north_province_area_one_to_fighting_base(SingleSwitchProgramEnvironment& env, ProControllerContext& context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_29.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_29.cpp index 08b0428f5f..c398e1d21c 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_29.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_29.cpp @@ -399,12 +399,6 @@ void move_from_montenevera_to_glaseado_gym(SingleSwitchProgramEnvironment& env, -void checkpoint_75(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ -} - -void checkpoint_76(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ -} - } } diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_29.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_29.h index 1c54aa5398..6b69f89fc3 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_29.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_29.h @@ -47,14 +47,6 @@ void move_from_montenevera_to_glaseado_gym(SingleSwitchProgramEnvironment& env, -// start: -// end: -void checkpoint_75(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); - -// start: -// end: -void checkpoint_76(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); - } } diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp index d7bbe4559b..ab601e1938 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp @@ -4,6 +4,8 @@ * */ +#include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h" + #include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonTools/Async/InferenceRoutines.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" @@ -28,15 +30,15 @@ namespace PokemonSV{ std::string AutoStory_Segment_30::name() const{ - return ""; + return "30: Glaseado Gym (Ice)"; } std::string AutoStory_Segment_30::start_text() const{ - return "Start: "; + return "Start: Beat Montenevera Gym (Ghost). At Glaseado gym Pokecenter."; } std::string AutoStory_Segment_30::end_text() const{ - return "End: "; + return "End: Beat Glaseado Gym (Ice). At North Province Area One Pokecenter."; } void AutoStory_Segment_30::run_segment( @@ -52,7 +54,10 @@ void AutoStory_Segment_30::run_segment( context.wait_for_all_requests(); env.console.log("Start Segment " + name(), COLOR_ORANGE); - // checkpoint_(env, context, options.notif_status_update, stats); + checkpoint_75(env, context, options.notif_status_update, stats); + checkpoint_76(env, context, options.notif_status_update, stats); + checkpoint_77(env, context, options.notif_status_update, stats); + checkpoint_78(env, context, options.notif_status_update, stats); context.wait_for_all_requests(); env.console.log("End Segment " + name(), COLOR_GREEN); @@ -61,6 +66,154 @@ void AutoStory_Segment_30::run_segment( +void checkpoint_75(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ + + + }); +} + +void checkpoint_76(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ + + + }); +} + +void checkpoint_77(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ + + + }); +} + +void checkpoint_78(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ + + + }); +} + + + +void move_from_glaseado_gym_to_north_province_area_one(SingleSwitchProgramEnvironment& env, ProControllerContext& context){ + context.wait_for_all_requests(); + + DirectionDetector direction; + do_action_and_monitor_for_battles(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + + direction.change_direction(env.program_info(), env.console, context, 3.855289); + pbf_move_left_joystick(context, 128, 0, 200, 50); + + direction.change_direction(env.program_info(), env.console, context, 3.056395); + pbf_move_left_joystick(context, 128, 0, 300, 50); + + direction.change_direction(env.program_info(), env.console, context, 3.805047); + pbf_move_left_joystick(context, 128, 0, 700, 50); + + direction.change_direction(env.program_info(), env.console, context, 1.589021); + pbf_move_left_joystick(context, 128, 0, 600, 50); + + direction.change_direction(env.program_info(), env.console, context, 2.741829); + pbf_move_left_joystick(context, 128, 0, 300, 50); + }); + + // marker 1 {0.33125, 0.314815} {0.297396, 0.322222} {0.313021, 0.322222} + place_marker_offset_from_flypoint(env.program_info(), env.console, context, + {ZoomChange::ZOOM_IN, 0, 0, 0}, + FlyPoint::POKECENTER, + {0.313021, 0.322222} + ); + handle_when_stationary_in_overworld(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + overworld_navigation(env.program_info(), env.console, context, + NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY, + 128, 0, 20, 10, false); + }, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + pbf_move_left_joystick(context, 255, 255, 40, 50); + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); + } + ); + + // marker 2 {0.222396, 0.413889} {0.253646, 0.386111} + place_marker_offset_from_flypoint(env.program_info(), env.console, context, + {ZoomChange::ZOOM_IN, 0, 0, 0}, + FlyPoint::POKECENTER, + {0.253646, 0.386111} + ); + handle_when_stationary_in_overworld(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + overworld_navigation(env.program_info(), env.console, context, + NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY, + 128, 0, 20, 10, false); + }, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + pbf_move_left_joystick(context, 0, 255, 40, 50); + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); + } + ); + + + + // marker 3 {0.80625, 0.574074} {0.803125, 0.615741} {0.794792, 0.614815} (0.794792, 0.609259). + place_marker_offset_from_flypoint(env.program_info(), env.console, context, + {ZoomChange::KEEP_ZOOM, 255, 0, 50}, + FlyPoint::POKECENTER, + {0.794792, 0.609259} + ); + handle_when_stationary_in_overworld(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + overworld_navigation(env.program_info(), env.console, context, + NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY, + 128, 0, 50, 10, false); + }, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + pbf_move_left_joystick(context, 255, 255, 40, 50); + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); + } + ); + + // marker 4. set marker to pokecenter + realign_player_from_landmark( + env.program_info(), env.console, context, + {ZoomChange::KEEP_ZOOM, 255, 128, 80}, + {ZoomChange::KEEP_ZOOM, 0, 0, 0} + ); + handle_when_stationary_in_overworld(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + overworld_navigation(env.program_info(), env.console, context, + NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY, + 128, 0, 110, 10, false); + }, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + pbf_move_left_joystick(context, 0, 255, 40, 50); + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); + } + ); + + // marker 5. set marker past pokecenter + handle_unexpected_battles(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_NEW_MARKER, 255, 255, 50); + }); + overworld_navigation(env.program_info(), env.console, context, + NavigationStopCondition::STOP_TIME, NavigationMovementMode::DIRECTIONAL_ONLY, + 128, 15, 12, 12, false); // can't wrap in handle_when_stationary_in_overworld(), since we expect to be stationary when walking into the pokecenter + + + fly_to_overlapping_flypoint(env.program_info(), env.console, context); + + +} + + + } } } diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h index 72ebdd9353..007ba5c8a3 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h @@ -28,6 +28,28 @@ class AutoStory_Segment_30 : public AutoStory_Segment{ +// start: At Glaseado Gym Pokecenter +// end: Spoke to Glaseado Gym receptionist +void checkpoint_75(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); + +// start: Spoke to Glaseado Gym receptionist +// end: Beat Glaseado Gym Challenge +void checkpoint_76(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); + +// start: Beat Glaseado Gym Challenge +// end: Beat Glaseado Gym (Ice). +void checkpoint_77(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); + +// start: Beat Glaseado Gym (Ice). +// end: At North Province Area One Pokecenter +void checkpoint_78(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); + + +// moves player from Glaseado Gym Pokecenter to North Province Area One +void move_from_glaseado_gym_to_north_province_area_one(SingleSwitchProgramEnvironment& env, ProControllerContext& context); + + + } } diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.cpp index e437991179..bb41ce286f 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.cpp @@ -61,6 +61,15 @@ void AutoStory_Segment_31::run_segment( +void checkpoint_79(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ +} + +void checkpoint_80(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ +} + + + + } } } diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.h index 7ad0fb4995..6d3b3be795 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.h @@ -26,6 +26,15 @@ class AutoStory_Segment_31 : public AutoStory_Segment{ ) const override; }; +// start: +// end: +void checkpoint_79(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); + + +// start: +// end: +void checkpoint_80(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); + From 0a442fe705301e7f9ed45b30c376c6bb7425b57c Mon Sep 17 00:00:00 2001 From: jw098 Date: Mon, 13 Oct 2025 15:12:56 -0700 Subject: [PATCH 2/4] checkpoint 75 --- .../PokemonSV_AutoStory_Segment_30.cpp | 43 +++++++++++++++++++ .../PokemonSV_AutoStory_Segment_30.h | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp index ab601e1938..749d56f17c 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp @@ -70,6 +70,49 @@ void checkpoint_75(SingleSwitchProgramEnvironment& env, ProControllerContext& co checkpoint_reattempt_loop(env, context, notif_status_update, stats, [&](size_t attempt_number){ + DirectionDetector direction; + do_action_and_monitor_for_battles(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + // move marker away so it doesn't block the North symbol + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_NEW_MARKER, 128, 255, 50); + + direction.change_direction(env.program_info(), env.console, context, 3.855289); + pbf_move_left_joystick(context, 128, 0, 200, 50); + + direction.change_direction(env.program_info(), env.console, context, 3.056395); + pbf_move_left_joystick(context, 128, 0, 250, 50); + + direction.change_direction(env.program_info(), env.console, context, 3.749788); + pbf_move_left_joystick(context, 128, 0, 680, 50); + + direction.change_direction(env.program_info(), env.console, context, 1.589021); + pbf_move_left_joystick(context, 128, 0, 600, 50); + + direction.change_direction(env.program_info(), env.console, context, 1.343606); //1.327724 + + handle_when_stationary_in_overworld(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + walk_forward_until_dialog(env.program_info(), env.console, context, NavigationMovementMode::DIRECTIONAL_ONLY, 30); + }, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + pbf_move_left_joystick(context, 0, 0, 150, 50); // move left + pbf_move_left_joystick(context, 255, 0, 150, 50); // move right + } + ); + }); + + // speak to Nemona, inside the gym + clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::PROMPT_DIALOG, CallbackEnum::BATTLE, CallbackEnum:: DIALOG_ARROW}); + + env.console.log("Battle Nemona."); + run_trainer_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG); + mash_button_till_overworld(env.console, context, BUTTON_A); + + // speak to gym receptionist + walk_forward_until_dialog(env.program_info(), env.console, context, NavigationMovementMode::DIRECTIONAL_SPAM_A, 20); + clear_dialog(env.console, context, ClearDialogMode::STOP_OVERWORLD, 60, {CallbackEnum::OVERWORLD}); + + }); } diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h index 007ba5c8a3..e0f081f69b 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h @@ -29,7 +29,7 @@ class AutoStory_Segment_30 : public AutoStory_Segment{ // start: At Glaseado Gym Pokecenter -// end: Spoke to Glaseado Gym receptionist +// end: Battled Nemona. Spoke to Glaseado Gym receptionist void checkpoint_75(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); // start: Spoke to Glaseado Gym receptionist From 9e6101452f8fe7b4cf8fa9a847a1c1c223135462 Mon Sep 17 00:00:00 2001 From: jw098 Date: Mon, 13 Oct 2025 16:58:24 -0700 Subject: [PATCH 3/4] checkpoint 76 --- .../PokemonSV_AutoStory_Segment_30.cpp | 107 +++++++++++++++++- .../PokemonSV_AutoStory_Segment_30.h | 12 +- 2 files changed, 112 insertions(+), 7 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp index 749d56f17c..707d012b46 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp @@ -5,6 +5,7 @@ */ #include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h" +#include "PokemonSV/Inference/Overworld/PokemonSV_NoMinimapDetector.h" #include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonTools/Async/InferenceRoutines.h" @@ -57,7 +58,6 @@ void AutoStory_Segment_30::run_segment( checkpoint_75(env, context, options.notif_status_update, stats); checkpoint_76(env, context, options.notif_status_update, stats); checkpoint_77(env, context, options.notif_status_update, stats); - checkpoint_78(env, context, options.notif_status_update, stats); context.wait_for_all_requests(); env.console.log("End Segment " + name(), COLOR_GREEN); @@ -121,6 +121,111 @@ void checkpoint_76(SingleSwitchProgramEnvironment& env, ProControllerContext& co checkpoint_reattempt_loop(env, context, notif_status_update, stats, [&](size_t attempt_number){ + pbf_move_left_joystick(context, 128, 255, 500, 100); + pbf_wait(context, 3 * TICKS_PER_SECOND); + // wait for overworld after leaving gym + wait_for_overworld(env.program_info(), env.console, context, 30); + + // place down marker as a workaround with an issue with fly_to_overworld_from_map + // fly_to_overworld_from_map() will fail since the snowy background on the map will false positive the destinationMenuItemWatcher, which causes the fly to fail + place_marker_offset_from_flypoint(env.program_info(), env.console, context, + {ZoomChange::ZOOM_IN, 0, 0, 0}, + FlyPoint::POKECENTER, + {0.404687, 0.261111} + ); + + // fly back to Glaseado Gym Pokecenter + move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::ZOOM_IN, 255, 0, 40}, FlyPoint::POKECENTER); + + DirectionDetector direction; + do_action_and_monitor_for_battles(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + + direction.change_direction(env.program_info(), env.console, context, 0.943392); + pbf_move_left_joystick(context, 128, 0, 200, 50); + + direction.change_direction(env.program_info(), env.console, context, 2.513925); + + // talk to + walk_forward_until_dialog(env.program_info(), env.console, context, NavigationMovementMode::DIRECTIONAL_SPAM_A, 30); + + }); + + mash_button_till_overworld(env.console, context, BUTTON_A); + + // start the Snow Slope Run + NoMinimapWatcher no_minimap(env.console, COLOR_RED, Milliseconds(5000)); + int ret = run_until( + env.console, context, + [&](ProControllerContext& context){ + pbf_move_left_joystick(context, 128, 0, 2412ms, 0ms); + pbf_wait(context, 3612ms); + pbf_move_left_joystick(context, 128, 0, 16ms, 0ms); + pbf_move_left_joystick(context, 0, 0, 2861ms, 0ms); + pbf_move_left_joystick(context, 128, 0, 309ms, 0ms); + pbf_wait(context, 6431ms); + pbf_move_left_joystick(context, 0, 128, 5081ms, 0ms); + pbf_wait(context, 239ms); + pbf_move_left_joystick(context, 128, 255, 961ms, 0ms); + pbf_wait(context, 1615ms); + pbf_move_left_joystick(context, 128, 0, 753ms, 0ms); + pbf_wait(context, 79ms); + pbf_move_left_joystick(context, 128, 0, 75ms, 0ms); + pbf_wait(context, 10485ms); + pbf_move_left_joystick(context, 128, 0, 7930ms, 0ms); + pbf_wait(context, 12000ms); + }, + {no_minimap} + ); + if (ret < 0){ + OperationFailedException::fire( + ErrorReport::SEND_ERROR_REPORT, + "checkpoint_76(): Failed to Snow Slope Run.", + env.console + ); + } + env.log("No minimap seen. Likely finished the Snow Slope Run. But no guarantee we did it within time."); + + clear_dialog(env.console, context, ClearDialogMode::STOP_OVERWORLD, 60, {CallbackEnum::OVERWORLD}); + + // fly back to Glaseado Gym Pokecenter + move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::ZOOM_IN, 0, 0, 0}, FlyPoint::POKECENTER); + + + // walk back to gym building + do_action_and_monitor_for_battles(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + + direction.change_direction(env.program_info(), env.console, context, 3.855289); + pbf_move_left_joystick(context, 128, 0, 200, 50); + + direction.change_direction(env.program_info(), env.console, context, 3.056395); + pbf_move_left_joystick(context, 128, 0, 250, 50); + + direction.change_direction(env.program_info(), env.console, context, 3.749788); + pbf_move_left_joystick(context, 128, 0, 680, 50); + + direction.change_direction(env.program_info(), env.console, context, 1.589021); + pbf_move_left_joystick(context, 128, 0, 600, 50); + + direction.change_direction(env.program_info(), env.console, context, 1.343606); //1.327724 + + handle_when_stationary_in_overworld(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + walk_forward_until_dialog(env.program_info(), env.console, context, NavigationMovementMode::DIRECTIONAL_SPAM_A, 30); + }, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + pbf_move_left_joystick(context, 0, 0, 150, 50); // move left + pbf_move_left_joystick(context, 255, 0, 150, 50); // move right + } + ); + }); + + // speak to receptionist. if we fail to detect a battle, then we know we failed the Gym test. we then reset. + clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::PROMPT_DIALOG, CallbackEnum::BATTLE, CallbackEnum:: DIALOG_ARROW}); + env.console.log("Battle Ice Gym leader."); + run_trainer_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG); + mash_button_till_overworld(env.console, context, BUTTON_A); }); } diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h index e0f081f69b..07154cd6f9 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h @@ -32,16 +32,16 @@ class AutoStory_Segment_30 : public AutoStory_Segment{ // end: Battled Nemona. Spoke to Glaseado Gym receptionist void checkpoint_75(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); -// start: Spoke to Glaseado Gym receptionist -// end: Beat Glaseado Gym Challenge +// start: Spoke to Glaseado Gym receptionist. Beat Glaseado Gym Challenge +// end: Beat Glaseado Gym (Ice). void checkpoint_76(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); -// start: Beat Glaseado Gym Challenge -// end: Beat Glaseado Gym (Ice). +// start: Spoke to Glaseado Gym receptionist. Beat Glaseado Gym Challenge +// end: Beat Glaseado Gym (Ice). At North Province Area One Pokecenter void checkpoint_77(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); -// start: Beat Glaseado Gym (Ice). -// end: At North Province Area One Pokecenter +// start: +// end: void checkpoint_78(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); From d582535dab0f1b342ccfaf8f6ad7266e5f35f1e6 Mon Sep 17 00:00:00 2001 From: jw098 Date: Mon, 13 Oct 2025 22:53:01 -0700 Subject: [PATCH 4/4] checkpoint 77 --- .../PokemonSV_AutoStory_Segment_30.cpp | 48 +++++++++---------- .../PokemonSV_AutoStory_Segment_30.h | 3 -- .../PokemonSV_AutoStory_Segment_31.cpp | 7 +++ .../PokemonSV_AutoStory_Segment_31.h | 4 ++ 4 files changed, 34 insertions(+), 28 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp index 707d012b46..f6edb71d38 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.cpp @@ -234,42 +234,40 @@ void checkpoint_77(SingleSwitchProgramEnvironment& env, ProControllerContext& co checkpoint_reattempt_loop(env, context, notif_status_update, stats, [&](size_t attempt_number){ + pbf_move_left_joystick(context, 128, 255, 500, 100); + pbf_wait(context, 3 * TICKS_PER_SECOND); + // wait for overworld after leaving gym + wait_for_overworld(env.program_info(), env.console, context, 30); - }); -} - -void checkpoint_78(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ - checkpoint_reattempt_loop(env, context, notif_status_update, stats, - [&](size_t attempt_number){ - + move_from_glaseado_gym_to_north_province_area_one(env, context); }); } + void move_from_glaseado_gym_to_north_province_area_one(SingleSwitchProgramEnvironment& env, ProControllerContext& context){ context.wait_for_all_requests(); - DirectionDetector direction; - do_action_and_monitor_for_battles(env.program_info(), env.console, context, - [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ - - direction.change_direction(env.program_info(), env.console, context, 3.855289); - pbf_move_left_joystick(context, 128, 0, 200, 50); - - direction.change_direction(env.program_info(), env.console, context, 3.056395); - pbf_move_left_joystick(context, 128, 0, 300, 50); - - direction.change_direction(env.program_info(), env.console, context, 3.805047); - pbf_move_left_joystick(context, 128, 0, 700, 50); + // marker 0 {0.460938, 0.310185} + place_marker_offset_from_flypoint(env.program_info(), env.console, context, + {ZoomChange::ZOOM_IN, 0, 0, 0}, + FlyPoint::POKECENTER, + {0.460938, 0.310185} + ); + handle_when_stationary_in_overworld(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + overworld_navigation(env.program_info(), env.console, context, + NavigationStopCondition::STOP_MARKER, NavigationMovementMode::DIRECTIONAL_ONLY, + 128, 0, 20, 10, false); + }, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + pbf_move_left_joystick(context, 255, 255, 40, 50); + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); + } + ); - direction.change_direction(env.program_info(), env.console, context, 1.589021); - pbf_move_left_joystick(context, 128, 0, 600, 50); - - direction.change_direction(env.program_info(), env.console, context, 2.741829); - pbf_move_left_joystick(context, 128, 0, 300, 50); - }); // marker 1 {0.33125, 0.314815} {0.297396, 0.322222} {0.313021, 0.322222} place_marker_offset_from_flypoint(env.program_info(), env.console, context, diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h index 07154cd6f9..c4dc56ca3f 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_30.h @@ -40,9 +40,6 @@ void checkpoint_76(SingleSwitchProgramEnvironment& env, ProControllerContext& co // end: Beat Glaseado Gym (Ice). At North Province Area One Pokecenter void checkpoint_77(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); -// start: -// end: -void checkpoint_78(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); // moves player from Glaseado Gym Pokecenter to North Province Area One diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.cpp index bb41ce286f..018f4bc11c 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.cpp @@ -59,6 +59,13 @@ void AutoStory_Segment_31::run_segment( } +void checkpoint_78(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ + + + }); +} void checkpoint_79(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.h index 6d3b3be795..3ba4c9022b 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_31.h @@ -26,6 +26,10 @@ class AutoStory_Segment_31 : public AutoStory_Segment{ ) const override; }; +// start: +// end: +void checkpoint_78(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); + // start: // end: void checkpoint_79(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats);