From 34b83b649134e8c3368e56d8b1e0e0f72cb64e0c Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 00:08:30 -0800 Subject: [PATCH 1/4] BDSP AutoStory sim: sweep a slow fade-in after every warp A fault-class sweep for fixed waits after a fade: with SimWorldKnobs::slow_fade_in, a walk, tap or door run after a door's fade or a tap step's way through, with no settle() between, fails (lab-B 2026-11-10, 00.04b heal_sandgem). FaultClass::SLOW_FADE_IN runs it over every row. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- ...PokemonBDSP_AutoStory_FaultSweep_Tests.cpp | 22 ++++++++++++++++++ .../PokemonBDSP_AutoStory_StorySim.cpp | 23 ++++++++++++++++++- .../PokemonBDSP_AutoStory_StorySim.h | 12 ++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_FaultSweep_Tests.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_FaultSweep_Tests.cpp index 32db487129..936b0877df 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_FaultSweep_Tests.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_FaultSweep_Tests.cpp @@ -23,6 +23,10 @@ * (6, 9), lab-B 2026-11-09 17:29: the walk took it for a trainer and * pressed through it). A variant also fails when the walk fights it. * SimWorldKnobs::scene_at_walk_end. + * - SLOW_FADE_IN: every warp's fade-in runs long, so a move after a fade + * with no settle() between goes nowhere (lab-B 2026-11-10, 00.04b + * heal_sandgem: a fixed 1500 ms wait, then the walk to the nurse + * stopped on "transition"). SimWorldKnobs::slow_fade_in. * * Missed and short fades are swept by SimFailureCases_Tests (every single * missed fade, banner and fade hold). @@ -73,6 +77,7 @@ enum class FaultClass{ BATTLE_OPENING, GRASS_BATTLES, SCENE_EARLY, + SLOW_FADE_IN, // Not swept yet: the measured movement table's lost taps (#293). LOST_TAP, }; @@ -86,6 +91,8 @@ std::string_view fault_class_name(FaultClass fault){ return "wild battles on every grass pass"; case FaultClass::SCENE_EARLY: return "scene starts during the walk before it"; + case FaultClass::SLOW_FADE_IN: + return "slow fade-in after every warp"; case FaultClass::LOST_TAP: return "lost tap"; } @@ -317,6 +324,18 @@ UnitTestResult sweep_grass_battles(Logger& logger, const StoryCheckpoint& row){ return sweep_result(logger, FaultClass::GRASS_BATTLES, row.id, 1, failures); } +// Row `row` with every warp's fade-in slow, all through the row. +UnitTestResult sweep_slow_fade_in(Logger& logger, const StoryCheckpoint& row){ + SimWorldKnobs knobs; + knobs.slow_fade_in = true; + const std::string stopped = run_row(logger, row.id, std::move(knobs)); + std::vector failures; + if (!stopped.empty()){ + failures.push_back({"", "a slow fade-in after every warp", stopped}); + } + return sweep_result(logger, FaultClass::SLOW_FADE_IN, row.id, 1, failures); +} + // The route before scene step `c` of `steps`, right before it or before // the plain step onto its trigger; none if there is none. std::optional route_before_scene(const std::vector& steps, size_t c){ @@ -431,6 +450,8 @@ class Test_AutoStoryFaultSweep : public UnitTest{ return sweep_grass_battles(logger, m_row); case FaultClass::SCENE_EARLY: return sweep_scene_early(logger, m_row); + case FaultClass::SLOW_FADE_IN: + return sweep_slow_fade_in(logger, m_row); case FaultClass::LOST_TAP: break; } @@ -448,6 +469,7 @@ const FaultSweepCase FAULT_SWEEP_CASES[] = { {.input = {.fault = FaultClass::BATTLE_OPENING}, .expectation = {}}, {.input = {.fault = FaultClass::GRASS_BATTLES}, .expectation = {}}, {.input = {.fault = FaultClass::SCENE_EARLY}, .expectation = {}}, + {.input = {.fault = FaultClass::SLOW_FADE_IN}, .expectation = {}}, }; void add_tests_AutoStory_FaultSweep(UnitTestDatabase& database){ diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.cpp index c3b4a66d99..2f57600889 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.cpp @@ -182,6 +182,7 @@ WarpSeen SimStoryStepIO::door_fade(const std::string& banner){ // walk's watchers take uniform frames only, so a fade whose hold they // did not see is missed too. void SimStoryStepIO::walk_until_stopped(Direction direction, size_t tiles, const std::string& label){ + m_route.check_fade_in(label); m_sim.tap(direction, ROUTE_TURN_TAP, false); Milliseconds limit = ROUTE_START_DELAY + 800ms + route_ms_per_tile(direction) * (int64_t)(2 * tiles); SimMove move = m_sim.hold(direction, limit, SimPace::WALK); @@ -196,7 +197,8 @@ void SimStoryStepIO::walk_until_stopped(Direction direction, size_t tiles, const // The D-pad, a tile at a time, until `map`'s banner reads; through a door // the walk goes on beyond it (the fade eats no tiles of a hold). -bool SimStoryStepIO::run_until_map(Direction direction, Milliseconds limit, const std::string& map, const std::string&){ +bool SimStoryStepIO::run_until_map(Direction direction, Milliseconds limit, const std::string& map, const std::string& label){ + m_route.check_fade_in(label); const bool miss = banner_missed(); size_t on = 0; for (Milliseconds ran = 0ms; ran < limit; ran += ROUTE_RUN_MS_PER_TILE_ACROSS){ @@ -230,6 +232,12 @@ double SimStoryStepIO::floor_here() const{ // its hold seen or not; with the fade missed whole the look still sees the // banner. std::optional SimStoryStepIO::tap_to_banner(Direction direction, const std::string& map, size_t max_taps){ + const std::optional taps = taps_to_banner(direction, map, max_taps); + // Through: the far side fades in as the step ends. + m_misses.fading_in = taps.has_value(); + return taps; +} +std::optional SimStoryStepIO::taps_to_banner(Direction direction, const std::string& map, size_t max_taps){ if (m_misses.through == m_misses.tap_steps++){ m_misses.missed = true; if (m_far_side() && m_misses.through_banner){ @@ -239,6 +247,7 @@ std::optional SimStoryStepIO::tap_to_banner(Direction direction, const s if (std::exchange(m_misses.banner_up, "") == map){ return 0; } + m_route.check_fade_in(m_step + ": taps toward " + map); bool crossed = false; for (size_t tap = 1; tap <= max_taps; tap++){ const SimMove move = m_sim.tap(direction, 160ms, false); @@ -259,7 +268,19 @@ std::optional SimStoryStepIO::tap_to_banner(Direction direction, const s return std::nullopt; } +void SimKnobRouteIO::check_fade_in(const std::string& label){ + if (m_knobs.slow_fade_in && std::exchange(m_misses.fading_in, false)){ + note(label + ": moved while the last warp still faded in (no settle after it).", RouteNote::FAILURE); + } +} + +WalkResult SimKnobRouteIO::walk_to_wall(const RouteWallWalk& walk){ + check_fade_in(walk.label); + return GridSimRouteIO::walk_to_wall(walk); +} + WalkResult SimKnobRouteIO::walk_taps(Direction direction, size_t tiles, const std::string& label){ + check_fade_in(label); const WalkResult result = GridSimRouteIO::walk_taps(direction, tiles, label); if (result.stop != WalkStop::LIMIT || m_slid_steps.contains(m_step)){ return result; diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.h b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.h index d3b01e85de..82bc433aab 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.h +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.h @@ -177,6 +177,11 @@ struct SimWorldKnobs{ // walk's last tiles (its target): its trigger lies on the way, so the // walk runs into it (00.04's Mom's call on (6, 9), lab-B 2026-11-09 17:29). std::function scene_at_walk_end = nullptr; + // Every warp's fade-in runs long: a walk, a tap or a door run after a + // door's fade or a tap step's way through, with no settle() between, + // goes nowhere (lab-B 2026-11-10, 00.04b heal_sandgem walked to the + // nurse 1500 ms after the Center's fade and stopped on "transition"). + bool slow_fade_in = false; }; namespace detail{ @@ -198,8 +203,12 @@ class SimKnobRouteIO : public GridSimRouteIO{ , m_cross(std::move(cross)) {} + virtual WalkResult walk_to_wall(const RouteWallWalk& walk) override; virtual WalkResult walk_taps(Pokemon::Direction direction, size_t tiles, const std::string& label) override; virtual bool dialog_within(Milliseconds wait, Color color) override; + // With SimWorldKnobs::slow_fade_in, fails the move `label` if the last + // warp is still fading in (SimMisses::fading_in). + void check_fade_in(const std::string& label); private: WalkResult slide_on(const SimSlide& slide, WalkResult result); @@ -310,6 +319,7 @@ class SimStoryStepIO : public StoryStepIO{ // (story_arrival_banner(): the sim's maps have no banners of their own). virtual WarpSeen run_into_door(Pokemon::Direction direction, bool run, Milliseconds timeout = Milliseconds(12000), Milliseconds dark_from = Milliseconds(0), const std::string& banner = "") override{ + m_route.check_fade_in(m_step + ": run into the door"); const SimPace pace = run ? SimPace::RUN : SimPace::WALK; if (false_dark() && dark_from <= detail::SIM_FALSE_DARK && detail::SIM_FALSE_DARK < timeout){ m_sim.hold(direction, detail::SIM_FALSE_DARK, pace); @@ -331,6 +341,8 @@ class SimStoryStepIO : public StoryStepIO{ virtual std::optional tap_to_banner(Pokemon::Direction direction, const std::string& map, size_t max_taps) override; private: + // tap_to_banner()'s taps, before it marks the far side fading in. + std::optional taps_to_banner(Pokemon::Direction direction, const std::string& map, size_t max_taps); // How the run shows its next fade (SimMisses): whole, its hold unseen, // or not at all. enum class FadeShown{ From 7865d3f5acd023ce4eaf7c3c56d09a7cf5e87a9a Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 00:14:25 -0800 Subject: [PATCH 2/4] BDSP AutoStory: settle after every way through, not a fixed wait The fixed-wait audit (lab-B 2026-11-10, 00.04b heal_sandgem) found three more places that waited a fixed time after a fade and then moved: - A tap step's way through (to_banner) waited 1000 ms and the next step walked; the slow fade-in sweep failed 01.02 and 01.05 there. It now settles (talk_over()), on the "through already" path too. - run_into_center() settled only after a seen fade; the "inside" and lined-up ways in walked to the nurse at once (or after enter_lit_door()'s 1500 ms). Every way in settles now. - walk_out_of_center() (Oreburgh's whiteout) waited for daylight plus 1000 ms; it settles too. A sim case checks a Center's inside settles in bounded time: visitors walking past read still (under WALK_TAP_BLOCKED_CHANGE), so 5 s after the fade; a screen never still ends on the 15 s calm rule. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonBDSP_AutoStory_StoryStepIO.cpp | 2 +- .../PokemonBDSP_AutoStory_StoryWalkSteps.cpp | 22 ++++++++---- .../AutoStory/PokemonBDSP_AutoStory_Walks.cpp | 14 +++----- ...onBDSP_AutoStory_SimFailureCases_Tests.cpp | 36 +++++++++++++++++++ 4 files changed, 56 insertions(+), 18 deletions(-) diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryStepIO.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryStepIO.cpp index d5768918b6..44a9c7872b 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryStepIO.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryStepIO.cpp @@ -294,7 +294,7 @@ std::optional ConsoleStoryStepIO::tap_to_banner(Direction direction, con m_stream.log("[Banner] a fade, no \"" + banner + "\" banner after it: counting the fade.", COLOR_ORANGE); } if (look != TapLook::NOTHING){ - m_context.wait_for(1000ms); + // No fixed wait: the step settles after it (talk_over()). return tap; } } diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryWalkSteps.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryWalkSteps.cpp index 0aba1b091a..a39a8a9ce5 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryWalkSteps.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryWalkSteps.cpp @@ -129,15 +129,18 @@ CenterEntry run_into_center( const std::function& inside, const std::function& line_up, const std::string& label ){ + // Every way in settles before the walk to the nurse: the inside can + // still fade in whether or not the run saw the fade. + CenterEntry entry = CenterEntry::LINED_UP; if (io.run_into_door(Direction::NORTH, run).any()){ - io.settle(BUTTON_B, label + ": into the Center", false, ""); - return CenterEntry::FADED; - } - if (inside()){ - return CenterEntry::INSIDE; + entry = CenterEntry::FADED; + }else if (inside()){ + entry = CenterEntry::INSIDE; + }else{ + line_up(); } - line_up(); - return CenterEntry::LINED_UP; + io.settle(BUTTON_B, label + ": into the Center", false, ""); + return entry; } TappedEnd tapped_end(const StoryWorld& world, const std::string& map, const TilePos& pos, const Pokemon::StoryLeg& leg){ @@ -346,7 +349,11 @@ size_t taps_to_banner(const Pose& from, Direction direction){ Outcome StoryWalkSteps::tap_to_banner(const Pose& from, const StoryStep& step){ const Direction direction = story_arg(step.args, "direction"); const std::string map = step.pose_after ? step.pose_after->map : ""; + // After the way through, the far side may still fade in, and a walk + // then goes nowhere (lab-B 2026-11-10, 00.04b's Center): settle, as + // after a door. if (through_already(step)){ + m_io.settle(BUTTON_B, label_of(step), false, ""); return Pokemon::outcome_ok(); } const size_t limit = taps_to_banner(from, direction); @@ -360,6 +367,7 @@ Outcome StoryWalkSteps::tap_to_banner(const Pose& from, const StoryStep& step){ }else{ log(std::format("[{}] {}: through to {} after {} taps {}.", m_row, step.name, map, *taps, direction_name(direction))); } + m_io.settle(BUTTON_B, label_of(step), false, ""); return Pokemon::outcome_ok(); } diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Walks.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Walks.cpp index 389302230d..d99f078f1f 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Walks.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Walks.cpp @@ -13,6 +13,7 @@ #include "CommonTools/Async/InferenceRoutines.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.h" +#include "Actions/PokemonBDSP_AutoStory_TalkOver.h" #include "Actions/PokemonBDSP_AutoStory_Talks.h" #include "Actions/PokemonBDSP_AutoStory_WildBattle.h" #include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_WalkResult.h" @@ -229,16 +230,9 @@ void walk_out_of_center(VideoStream& stream, ProControllerContext& context, cons // "No floor" also reads true on the door's black fade, and the game // takes no input until it ends: the first D-pad taps after it were // lost and the gym's door ended a tile away (r215d, r216d; a shot - // per press by hand showed the black frame). Wait for daylight. - const auto start = current_time(); - while (current_time() - start < 6000ms){ - context.wait_for(100ms); - const VideoSnapshot frame = stream.video().snapshot(); - if (frame && mean_brightness(*frame.frame) > 40){ - break; - } - } - context.wait_for(1000ms); + // per press by hand showed the black frame). Settle: the fade + // back up and a quiet overworld, not a fixed wait. + talk_over(stream, context, label + ": out of the Center"); return; } } diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp index cc63f60ea5..cfbb01bafe 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp @@ -15,6 +15,7 @@ * */ +#include #include #include #include @@ -281,6 +282,40 @@ UnitTestResult roark_badge_speech(Logger& logger){ return passes(early); } +// How long talk_over() takes to settle inside a Pokemon Center after its +// fade (the heal's settle, lab-B 2026-11-10 00.04b), with the inside's +// visitors walking about the whole time. A visitor walking past changes +// the screen by 10 to 13.4 (WALK_TAP_BLOCKED_CHANGE's note, r244a), under +// its 16, so it reads still: settled TALK_OVER_QUIET after the fade. If the +// inside never read still (a screen moving more than that), the calm rule +// still ends it TALK_OVER_CALM after the fade. Either way it is bounded. +UnitTestResult center_inside_settles(Logger& logger){ + struct Inside{ + const char* what; + bool moving; + Milliseconds most; + }; + const Milliseconds fade = 1500ms; + const Milliseconds slack = 1000ms; + const Inside cases[] = { + {"visitors walking (reads still)", false, fade + Pokemon::TALK_OVER_QUIET + slack}, + {"a screen never still", true, fade + Pokemon::TALK_OVER_CALM + slack}, + }; + for (const Inside& inside : cases){ + const SimScene scene{ + sim_fade("the Center's door fade", fade), + sim_pause(inside.what, 60000ms, inside.moving), + }; + const std::string over = play_scene(scene, {}); + logger.log(std::format("Center inside, {}: {}", inside.what, over)); + long long ms = -1; + if (std::sscanf(over.c_str(), "judged over %lld ms in", &ms) != 1 || ms < fade.count() || ms > inside.most.count()){ + return std::format("Center inside, {}: not settled between {} and {} ms: {}", inside.what, fade.count(), inside.most.count(), over); + } + } + return true; +} + // 01.07: after the tag battle the screen fades back from the battle and // the grunts run off before anyone speaks: a scene that opens with no box, // 6 s of people moving (Rowan's cutscene shape), then Rowan's and Dawn's @@ -613,6 +648,7 @@ const FailureCase AUTO_STORY_FAILURE_CASES[] = { return wanderers_move(logger, "01.08"); }}, .expectation = {}}, {.input = {"01.04 Roark's badge speech: the fanfare's pause, then a scene", roark_badge_speech}, .expectation = {}}, + {.input = {"inside a Pokemon Center, the settle after the door's fade ends in bounded time with visitors walking", center_inside_settles}, .expectation = {}}, {.input = {"01.07 after the tag battle the grunts run off before anyone speaks", grunts_run_off_before_rowan}, .expectation = {}}, {.input = {"00.03 Rowan's scene opens with no box and fades home", rowans_scene_opens_with_no_box}, .expectation = {}}, {.input = {"00.03 Mom's scene ends with a closing fade: over once it is back up (lab-B 2026-11-09)", moms_scene_ends_with_a_fade}, .expectation = {}}, From fe6abcc57048ae6175baf0c8695c9fb27f317de1 Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 00:30:39 -0800 Subject: [PATCH 3/4] BDSP AutoStory: std::format and string_view in the fixed-wait changes Code health: no char* in the Center settle case; the new labels built with std::format. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../AutoStory/PokemonBDSP_AutoStory_StoryWalkSteps.cpp | 2 +- .../Programs/AutoStory/PokemonBDSP_AutoStory_Walks.cpp | 3 ++- .../PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp | 5 +++-- .../AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.cpp | 4 ++-- .../AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.h | 3 ++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryWalkSteps.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryWalkSteps.cpp index a39a8a9ce5..fab09874a7 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryWalkSteps.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryWalkSteps.cpp @@ -139,7 +139,7 @@ CenterEntry run_into_center( }else{ line_up(); } - io.settle(BUTTON_B, label + ": into the Center", false, ""); + io.settle(BUTTON_B, std::format("{}: into the Center", label), false, ""); return entry; } diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Walks.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Walks.cpp index d99f078f1f..967b628dcd 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Walks.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Walks.cpp @@ -9,6 +9,7 @@ */ #include +#include #include "CommonFramework/VideoPipeline/VideoFeed.h" #include "CommonTools/Async/InferenceRoutines.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" @@ -232,7 +233,7 @@ void walk_out_of_center(VideoStream& stream, ProControllerContext& context, cons // lost and the gym's door ended a tile away (r215d, r216d; a shot // per press by hand showed the black frame). Settle: the fade // back up and a quiet overworld, not a fixed wait. - talk_over(stream, context, label + ": out of the Center"); + talk_over(stream, context, std::format("{}: out of the Center", label)); return; } } diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp index cfbb01bafe..f753773c9b 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/TestRunners/UnitTestDatabase.h" @@ -291,7 +292,7 @@ UnitTestResult roark_badge_speech(Logger& logger){ // still ends it TALK_OVER_CALM after the fade. Either way it is bounded. UnitTestResult center_inside_settles(Logger& logger){ struct Inside{ - const char* what; + std::string_view what; bool moving; Milliseconds most; }; @@ -304,7 +305,7 @@ UnitTestResult center_inside_settles(Logger& logger){ for (const Inside& inside : cases){ const SimScene scene{ sim_fade("the Center's door fade", fade), - sim_pause(inside.what, 60000ms, inside.moving), + sim_pause(std::string(inside.what), 60000ms, inside.moving), }; const std::string over = play_scene(scene, {}); logger.log(std::format("Center inside, {}: {}", inside.what, over)); diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.cpp index 2f57600889..856635b284 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.cpp @@ -247,7 +247,7 @@ std::optional SimStoryStepIO::taps_to_banner(Direction direction, const if (std::exchange(m_misses.banner_up, "") == map){ return 0; } - m_route.check_fade_in(m_step + ": taps toward " + map); + m_route.check_fade_in(std::format("{}: taps toward {}", m_step, map)); bool crossed = false; for (size_t tap = 1; tap <= max_taps; tap++){ const SimMove move = m_sim.tap(direction, 160ms, false); @@ -270,7 +270,7 @@ std::optional SimStoryStepIO::taps_to_banner(Direction direction, const void SimKnobRouteIO::check_fade_in(const std::string& label){ if (m_knobs.slow_fade_in && std::exchange(m_misses.fading_in, false)){ - note(label + ": moved while the last warp still faded in (no settle after it).", RouteNote::FAILURE); + note(std::format("{}: moved while the last warp still faded in (no settle after it).", label), RouteNote::FAILURE); } } diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.h b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.h index 82bc433aab..3eed905a29 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.h +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim.h @@ -14,6 +14,7 @@ #ifndef PokemonAutomation_PokemonBDSP_AutoStory_StorySim_H #define PokemonAutomation_PokemonBDSP_AutoStory_StorySim_H +#include #include #include #include @@ -319,7 +320,7 @@ class SimStoryStepIO : public StoryStepIO{ // (story_arrival_banner(): the sim's maps have no banners of their own). virtual WarpSeen run_into_door(Pokemon::Direction direction, bool run, Milliseconds timeout = Milliseconds(12000), Milliseconds dark_from = Milliseconds(0), const std::string& banner = "") override{ - m_route.check_fade_in(m_step + ": run into the door"); + m_route.check_fade_in(std::format("{}: run into the door", m_step)); const SimPace pace = run ? SimPace::RUN : SimPace::WALK; if (false_dark() && dark_from <= detail::SIM_FALSE_DARK && detail::SIM_FALSE_DARK < timeout){ m_sim.hold(direction, detail::SIM_FALSE_DARK, pace); From 00d0d9be64a883010594602bbe690000d0758555 Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 00:57:05 -0800 Subject: [PATCH 4/4] BDSP AutoStory sim: a press's slack more for the Center settle bound The quiet is judged a look (a press) or two after it starts: the still case ends 7680 ms in, past the 7500 ms bound. 2000 ms of slack. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp index f753773c9b..f629d53a98 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimFailureCases_Tests.cpp @@ -297,7 +297,9 @@ UnitTestResult center_inside_settles(Logger& logger){ Milliseconds most; }; const Milliseconds fade = 1500ms; - const Milliseconds slack = 1000ms; + // A look per press: the quiet is seen a press or two after it begins + // (7680 ms for the still case). + const Milliseconds slack = 2000ms; const Inside cases[] = { {"visitors walking (reads still)", false, fade + Pokemon::TALK_OVER_QUIET + slack}, {"a screen never still", true, fade + Pokemon::TALK_OVER_CALM + slack},