From c7da2a9de6b94e73e602d72acb67e69c1b98cdb8 Mon Sep 17 00:00:00 2001 From: dayfine Date: Fri, 13 Nov 2026 17:01:22 -0800 Subject: [PATCH] AutoStory: a door's settle waits on the player, not the whole screen TalkOverRule::door ends the settle after a door or warp on a still box around the player (the new PLAYER_STILL event) for 1 s, or on the overworld being back for 2.5 s, so people walking about a Center neither hold the settle up nor end it early. As bdsp/rebuild-base carries it, without its stray blank lines. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Pokemon/AutoStory/Pokemon_SceneJudges.cpp | 8 +++++--- .../Pokemon/AutoStory/Pokemon_SceneJudges.h | 16 +++++++++++++++- .../Pokemon/AutoStory/Pokemon_ScreenEventTypes.h | 4 +++- .../Pokemon/AutoStory/Pokemon_ScreenEvents.cpp | 1 + 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_SceneJudges.cpp b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_SceneJudges.cpp index 4ded229245..f2a3e90f9f 100644 --- a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_SceneJudges.cpp +++ b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_SceneJudges.cpp @@ -50,7 +50,7 @@ SceneMove TalkOver::look(const ScreenEvents& look, WallClock now){ // ended Mom's scene as it went down (lab-B 2026-11-09 14:33). const bool calm = !box && m_fade_showing == WarpFade::NONE && look.has(ScreenEvent::PLAYER_CAN_MOVE) && warped(); - const bool quiet = calm && look.has(ScreenEvent::SCREEN_STILL); + const bool quiet = calm && look.has(m_rule.door ? ScreenEvent::PLAYER_STILL : ScreenEvent::SCREEN_STILL); if (!calm){ m_calm_since = WallClock::max(); }else if (m_calm_since == WallClock::max()){ @@ -61,9 +61,11 @@ SceneMove TalkOver::look(const ScreenEvents& look, WallClock now){ }else if (m_quiet_since == WallClock::max()){ m_quiet_since = now; } + const Milliseconds quiet_for = m_rule.door ? TalkOverRule::DOOR_QUIET : TALK_OVER_QUIET; + const Milliseconds calm_for = m_rule.door ? TalkOverRule::DOOR_CALM : TALK_OVER_CALM; const bool over = - (quiet && now - m_quiet_since >= TALK_OVER_QUIET) || - (calm && now - m_calm_since >= TALK_OVER_CALM); + (quiet && now - m_quiet_since >= quiet_for) || + (calm && now - m_calm_since >= calm_for); if (over && m_rule.end_on_quiet){ return SceneMove::DONE; } diff --git a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_SceneJudges.h b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_SceneJudges.h index 908dcaa39c..23f63af37a 100644 --- a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_SceneJudges.h +++ b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_SceneJudges.h @@ -56,6 +56,19 @@ struct TalkOverRule{ // False when a battle is to follow (a trainer's lines pause for more // than 4 s before it, r210d): no quiet ends the talk then. bool end_on_quiet = true; + // The settle after a door or a warp, with no text to come: only the + // fade back up and a short still spell around the player count, so + // people walking about (a Center's visitors) neither hold it up nor + // end it early. DOOR_QUIET and DOOR_CALM, not the talk's 5 s and 15 s. + bool door = false; + + // The box around the player still this long after the fade is back + // up ends a door's settle; a walk any earlier could still go nowhere + // in the fade-in (lab-B 2026-11-10, 00.04b's nurse). + static constexpr Milliseconds DOOR_QUIET = Milliseconds(1000); + // The overworld back up this long ends it, still or not (someone + // walking past the player the whole time). + static constexpr Milliseconds DOOR_CALM = Milliseconds(2500); }; // The overworld with no box and a still screen this long ends it: a scene @@ -69,7 +82,8 @@ constexpr Milliseconds TALK_OVER_QUIET = Milliseconds(5000); constexpr Milliseconds TALK_OVER_CALM = Milliseconds(15000); // When a talk or a scene is over, from looks alone. A look is a frame's -// events: DIALOG_BOX, PLAYER_CAN_MOVE, SCREEN_STILL, a fade, +// events: DIALOG_BOX, PLAYER_CAN_MOVE, SCREEN_STILL (PLAYER_STILL for a +// door's settle), a fade, // LOCATION_BANNER (the expected map's) and BATTLE_STARTED are read. // It is over only once every fade has come back up, no box shows, and // the overworld has been quiet (or calm) since: a look that shows a fade diff --git a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_ScreenEventTypes.h b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_ScreenEventTypes.h index 45988abc4e..798b82124a 100644 --- a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_ScreenEventTypes.h +++ b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_ScreenEventTypes.h @@ -42,9 +42,11 @@ enum class ScreenEvent : uint8_t{ PLAYER_CAN_MOVE, // The overworld with the player in control. SCREEN_STILL, // The screen barely changed since the frame before. SWITCH_HOME_MENU, // The Switch's HOME menu: the game is not on the screen. + PLAYER_STILL, // A box around the player barely changed since the + // frame before: people walking elsewhere do not count. }; // How many ScreenEvent values there are. -constexpr size_t SCREEN_EVENT_COUNT = 11; +constexpr size_t SCREEN_EVENT_COUNT = 12; // "dialog box", for the log. std::string screen_event_name(ScreenEvent event); diff --git a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_ScreenEvents.cpp b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_ScreenEvents.cpp index db2e5fbfa7..acc81bf34c 100644 --- a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_ScreenEvents.cpp +++ b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_ScreenEvents.cpp @@ -26,6 +26,7 @@ std::string screen_event_name(ScreenEvent event){ case ScreenEvent::PLAYER_CAN_MOVE: return "player can move"; case ScreenEvent::SCREEN_STILL: return "screen still"; case ScreenEvent::SWITCH_HOME_MENU: return "Switch HOME menu"; + case ScreenEvent::PLAYER_STILL: return "player still"; } return "?"; }