From 59a86b6ab05e02bbb760661b2e333d89aca81b7a Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 19:38:34 -0800 Subject: [PATCH] PokemonFRLG: read walking, running and Bicycle times from the shared table The walker's tile_time(), the sim's timing and the named tap and tile constants now come from Pokemon::FRLG_MOVE_MECHANICS; values unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h | 3 ++- .../PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h | 5 +++-- .../Overworld/PokemonFRLG_MovementStepPresses.h | 5 +++-- .../Overworld/PokemonFRLG_MovementTurnPresses.h | 3 ++- .../Overworld/PokemonFRLG_OverworldSimScreens.h | 5 +++-- .../PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp | 8 +++++--- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h index b610810a8c..e1c3fa1864 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h @@ -12,6 +12,7 @@ #define PokemonAutomation_PokemonFRLG_BikeSpinMechanics_H #include "Common/Cpp/Time.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -28,7 +29,7 @@ namespace MovementMechanics{ // of the motion on screen) held "west 16 (open)" for 17 or 18 tiles on // Route 8 (08.03 run 2). Not the decompilation's 4 frames a tile (67ms): // the bike speeds up from rest. -inline constexpr Milliseconds BIKE_TILE_TIME(100); +inline constexpr Milliseconds BIKE_TILE_TIME = Pokemon::FRLG_MOVE_MECHANICS.bike->tile.across; // On the Bicycle a tap never only turns the player: from rest, a 40ms tap // moved a tile facing either way, and holds of 112, 150, 200, 250, 300, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index a89674104d..8ae47a106a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -32,6 +32,7 @@ #include #include "Common/Cpp/Time.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" #include "PokemonFRLG_MovementStepPresses.h" #include "PokemonFRLG_MovementTurnPresses.h" @@ -44,10 +45,10 @@ namespace MovementMechanics{ // The game. // Walking: a tile per 16 frames at 60 fps (console B, 2026-11-09). -inline constexpr Milliseconds TILE_TIME(267); +inline constexpr Milliseconds TILE_TIME = Pokemon::FRLG_MOVE_MECHANICS.walk.tile.across; // Running with B held: a tile per 8 frames (console B, 2026-11-02, video // of run 04.01). -inline constexpr Milliseconds RUN_TILE_TIME(133); +inline constexpr Milliseconds RUN_TILE_TIME = Pokemon::FRLG_MOVE_MECHANICS.run.tile.across; // Surfing: a tile per 8 frames. inline constexpr Milliseconds SURF_TILE_TIME(133); // The longest tap measured to only turn a player facing another way, and diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementStepPresses.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementStepPresses.h index 8f53190054..a39f3cc576 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementStepPresses.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementStepPresses.h @@ -11,6 +11,7 @@ #include #include "Common/Cpp/Time.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -21,10 +22,10 @@ namespace MovementMechanics{ // The release between a leg's hold and what comes next. inline constexpr Milliseconds STEP_RELEASE(100); // A one-step tap (step_once()). -inline constexpr Milliseconds STEP_TAP(66); +inline constexpr Milliseconds STEP_TAP = Pokemon::FRLG_MOVE_MECHANICS.step_tap; // The release after a step tap: the next one starts STEP_TAP + // STEP_TAP_RELEASE after it, past the lockout. -inline constexpr Milliseconds STEP_TAP_RELEASE(700); +inline constexpr Milliseconds STEP_TAP_RELEASE = Pokemon::FRLG_MOVE_MECHANICS.step_tap_release; // How long the overworld must show nothing (no box, fade or battle) after diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementTurnPresses.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementTurnPresses.h index 453aa45bb6..07441d4127 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementTurnPresses.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementTurnPresses.h @@ -11,6 +11,7 @@ #include #include "Common/Cpp/Time.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -19,7 +20,7 @@ namespace MovementMechanics{ // Turns a player facing another way, without a step. -inline constexpr Milliseconds TURN_TAP(40); +inline constexpr Milliseconds TURN_TAP = Pokemon::FRLG_MOVE_MECHANICS.turn_tap; // How long to wait after a turn tap for the turn to show. inline constexpr Milliseconds TURN_SETTLE(300); // How many taps turn_to() tries before it takes the player as turned. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimScreens.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimScreens.h index b2407335b8..1c6cbf6014 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimScreens.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimScreens.h @@ -15,6 +15,7 @@ #include #include "Common/Cpp/Time.h" #include "PokemonFRLG_MovementMechanics.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" #include "PokemonFRLG_OverworldRoute.h" namespace PokemonAutomation{ @@ -59,9 +60,9 @@ struct SimEncounter{ // detection delays (OverworldInterrupt::detection_delay()) are its guesses // at these. struct SimTiming{ - Milliseconds tile = MovementMechanics::TILE_TIME; + Milliseconds tile = Pokemon::FRLG_MOVE_MECHANICS.walk.tile.across; // A tile on the Bicycle. - Milliseconds bike_tile = MovementMechanics::BIKE_TILE_TIME; + Milliseconds bike_tile = Pokemon::FRLG_MOVE_MECHANICS.bike->tile.across; Milliseconds flash{300}; Milliseconds battle_screen{3700}; // A wild battle's text box, before the HP boxes (battle_screen). Not diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 6705c7b961..ae29c82011 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -28,6 +28,7 @@ #include "PokemonFRLG_OverworldBike.h" #include "PokemonFRLG_BikeSpinMechanics.h" #include "PokemonFRLG_BikeSpinPresses.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -196,15 +197,16 @@ Milliseconds tile_time(const RouteStep& step, MoveSpeed speed){ if (step.surfing){ return SURF_TILE_TIME; } + const Pokemon::MoveMechanics& game = Pokemon::FRLG_MOVE_MECHANICS; switch (step_speed(step, speed)){ case MoveSpeed::RUN: - return RUN_TILE_TIME; + return game.run.tile.along(step.direction); case MoveSpeed::BIKE: - return BIKE_TILE_TIME; + return game.bike->tile.along(step.direction); case MoveSpeed::WALK: break; } - return TILE_TIME; + return game.walk.tile.along(step.direction); } bool turns_first(const RouteStep& step, MoveSpeed speed, std::optional facing){