From 0361fc678de7b37bc6d98f90693c97a767a67093 Mon Sep 17 00:00:00 2001 From: dayfine Date: Sat, 14 Nov 2026 20:49:20 -0800 Subject: [PATCH 1/2] FRLG 15.01: Route 7's gate by legs to walls; a still screen is no warp; ledge hop 32 frames Console B failed 15.01 twice at the same tile (2026-11-14 20:23, 20:27). The dead-reckoned "east 19" ran a column long because the Celadon -> Route 7 crossing did not hold the player up, "south 8" down column 8 hopped the row-8 ledge and ended a row short, and "east 9 (warp)" held into the gate wall; the no-fade warp acceptance then took the still outdoor screen as the gate. - 15.01 plan: a to_gate_wall step (south to a wall on row 11, east to the gate wall at (15, 11)), then north 1 onto the door tile and east 1 (warp). - arrived_without_fade(): the later screen must show a building's or gate's map with the black below it; a still outdoor screen is not a warp. - Sim: a ledge hop costs LEDGE_HOP_TIME (32 frames) regardless of pace, so a running hold timed by its tiles ends short of its tile after a hop. - Tests: warp-fade case for a wall stop outdoors; Saffron sim case running 15.01 to the gate at run pace with no connection stall (red on the old plan). --- .../Overworld/PokemonFRLG_MovementMechanics.h | 6 +++ .../PokemonFRLG_OverworldSimTaps.cpp | 2 +- .../Overworld/PokemonFRLG_OverworldWalk.cpp | 10 +++-- .../PokemonFRLG_OverworldWarpFade_Tests.cpp | 33 ++++++++++++++ .../PokemonFRLG_AutoStoryPlanGolden15.h | 10 +++-- .../PokemonFRLG_AutoStorySaffron_Tests.cpp | 45 +++++++++++++++++++ .../AutoStory/StoryData/frlg-15.01.plan.json | 11 ++++- 7 files changed, 109 insertions(+), 8 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index a89674104d..6d83a36f4c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -50,6 +50,12 @@ inline constexpr Milliseconds TILE_TIME(267); inline constexpr Milliseconds RUN_TILE_TIME(133); // Surfing: a tile per 8 frames. inline constexpr Milliseconds SURF_TILE_TIME(133); +// Hopping a ledge: 32 frames for the two tiles, walking or running +// (pokefirered DoJumpSpriteMovement(), JUMP_DISTANCE_FAR). Running, a hold +// timed by its tiles spends two of them on the hop and ends a tile short +// (console B, 2026-11-14 20:23 and 20:27, 15.01: "south 8" down Route 7's +// column 8 ended on row 9). +inline constexpr Milliseconds LEDGE_HOP_TIME(533); // The longest tap measured to only turn a player facing another way, and // to take exactly one step for one facing its way. inline constexpr Milliseconds LONGEST_TAP(133); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp index 2a9a891098..84681172b9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp @@ -70,7 +70,7 @@ void OverworldSim::take_steps(Direction direction, Milliseconds pressed, Millise return; } tile = tile_time(); - pressed += step->ledge ? tile * 2 : tile; + pressed += step->ledge ? LEDGE_HOP_TIME : tile; } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index addd2ff8f3..0f396fff3a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -381,9 +381,13 @@ bool arrived_without_fade( if (scrolled_rmsd(now_box, later_box, 0, 0) >= SAME_SCENE_RMSD){ return false; } - // Water's waves make any scene after it look like another one: a door - // north has to show the building it leads into. - if (step.direction == Direction::NORTH && !black_below(later_box)){ + // A still screen is no proof of a warp: a wall stops the player as + // still, and water's waves make any scene after it look like another + // one. The screen has to show a building's or a gate's map, with the + // black below it (console B, 2026-11-14 20:27, 15.01: "east 9 (warp)" + // held into Route 7's gate wall a row above its door was taken as the + // warp). + if (!black_below(later_box)){ return false; } return warp_left_scene(before, later, game, step.direction, step.tiles + step.warp_slack + 2); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp index aba711b34b..141e58060a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp @@ -213,6 +213,38 @@ UnitTestResult test_water_is_not_the_center(){ return true; } +// A field of grass: a pattern that repeats every 16-pixel tile, another +// scene than the store floor's. +ImageRGB32 grass_field(){ + ImageRGB32 image(240, 160); + for (size_t y = 0; y < 160; y++){ + for (size_t x = 0; x < 240; x++){ + image.pixel(x, y) = (x % 16 < 8) ^ (y % 16 < 8) ? 0xff78c850 : 0xff50a040; + } + } + return image; +} + +// 15.01 west_of_tea_guard: "east 9 (warp)" to Route 7's gate, held from a +// row above the door into the gate's wall (console B, 2026-11-14 20:23 +// and 20:27). The scene after the hold is another than before it, and +// still, as a wall stop is; it is outdoors, with no black below, so it is +// not the gate. +UnitTestResult test_wall_stop_is_not_the_gate(){ + const ImageFloatBox game(0, 0, 1, 1); + RouteStep step; + step.direction = Direction::EAST; + step.tiles = 9; + step.warps = true; + step.end.map = "Route7_EastEntrance"; + const ImageRGB32 before = store_floor(); + const ImageRGB32 after = grass_field(); + if (OverworldWalkSteps::arrived_without_fade(before, after, after, game, step)){ + return "Expected a still scene with no black below not to be taken as the gate."; + } + return true; +} + struct ArrivalScreenInput{ std::string name; std::function body; @@ -243,6 +275,7 @@ class Test_ArrivalScreen : public UnitTest{ const ArrivalScreenCase ARRIVAL_SCREEN_CASES[] = { {.input = {"the lift room after a missed fade, by its screen", test_lift_room_arrival}, .expectation = {}}, {.input = {"water after a missed fade is not the Center", test_water_is_not_the_center}, .expectation = {}}, + {.input = {"a wall stop outdoors after a missed fade is not the gate", test_wall_stop_is_not_the_gate}, .expectation = {}}, }; } // namespace diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h index 5ab7394f5d..75eee8589c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h @@ -19,11 +19,15 @@ namespace PokemonFRLG{ // The stored plan lines from segment 15 on, after FRLG_PLAN_GOLDEN_14's. inline constexpr std::string_view FRLG_PLAN_GOLDEN_15[] = { - "15.01 west_of_tea_guard from CeladonCity_PokemonCenter_1F (7, 4) facing north to Route7_EastEntrance (5, 4) facing east", + "15.01 to_gate_wall from CeladonCity_PokemonCenter_1F (7, 4) facing north to Route7 (15, 11) facing north", "15.01 walk south 5 (warp) -> CeladonCity (48, 12) [walk only]", "15.01 walk east 19 -> Route7 (7, 2) [connection 12]", - "15.01 walk south 8 -> Route7 (7, 10)", - "15.01 walk east 9 (warp) -> Route7_EastEntrance (1, 5)", + "15.01 walk south 9 (to wall) -> Route7 (7, 11)", + "15.01 walk east 8 (to wall) -> Route7 (15, 11)", + "15.01 face north -> Route7 (15, 11)", + "15.01 west_of_tea_guard from Route7 (15, 11) facing north to Route7_EastEntrance (5, 4) facing east", + "15.01 walk north 1 -> Route7 (15, 10)", + "15.01 walk east 1 (warp) -> Route7_EastEntrance (1, 5)", "15.01 walk east 4 -> Route7_EastEntrance (5, 5)", "15.01 walk north 1 (to wall) -> Route7_EastEntrance (5, 4)", "15.01 face east -> Route7_EastEntrance (5, 4)", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySaffron_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySaffron_Tests.cpp index f390852c98..63f9ee7f47 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySaffron_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySaffron_Tests.cpp @@ -21,6 +21,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" #include "PokemonFRLG_AutoStoryEvents.h" +#include "PokemonFRLG_AutoStoryPacedRoute.h" #include "PokemonFRLG_AutoStoryRooms.h" #include "PokemonFRLG_AutoStoryRowSim.h" #include "PokemonFRLG_AutoStoryRows_Tests.h" @@ -107,11 +108,55 @@ UnitTestResult test_route7_to_saffron(){ return true; } +// 15.01's walk to the gate as console B ran it (2026-11-14 20:23 and +// 20:27, twice alike): running, and the game not holding the player up on +// the crossing east onto Route 7, so the open leg east ran a column long, +// onto column 8. Dead-reckoned, "south 8" down that column hopped the +// ledge on row 8, which took two of its tiles, and ended on row 9; "east 9 +// (warp)" then held into the gate's wall a row above its door. Held to +// walls, the walk ends at the door from column 7 or 8 alike. +UnitTestResult test_route7_gate_running_crossing_not_held_up(){ + const StoryCheckpoint& row = checkpoint("15.01"); + StoryPose at = *story_pose(Pokemon::pose_of(*row.start)); + SimScript script; + script.timing.tile = MovementMechanics::RUN_TILE_TIME; + script.connections_stall = false; + OverworldSim sim(story_maps(), MapPosition{at.map, at.tile}, *at.facing, script); + SimWalkerRules rules; + rules.speed = MoveSpeed::RUN; + for (const StoryStep& step : row.steps){ + if (step.name == "tea_trigger"){ + break; + } + const std::optional> route = walked_route(at, step, story_maps(), sim.state().gates); + if (!route || route->empty()){ + return std::format("15.01 {}: no route from {}.", step.name, to_string(MapPosition{at.map, at.tile})); + } + const RoutePlanning planning{ + .maps = &story_maps(), .gates = sim.state().gates, .costs = story_route_costs(), + .start = MapPosition{at.map, at.tile}, .label = step.name + }; + if (const std::string failure = OverworldSimWalker(sim, rules).run(*route, planning); !failure.empty()){ + return std::format("15.01 {}: ended on {}; {}", step.name, to_string(sim.state().position), failure); + } + at = StoryPose{route->back().end.map, route->back().end.point, route->back().facing_after}; + } + const MapPosition west_of_trigger{"Route7_EastEntrance", {5, 4}}; + if (!(sim.state().position == west_of_trigger)){ + return std::format("15.01: ended on {}, not west of the guard's trigger, {}.", to_string(sim.state().position), to_string(west_of_trigger)); + } + return true; +} + const AutoStorySaffronCase AUTO_STORY_SAFFRON_CASES[] = { { .input = {.name = "15.01 Route 7's gate with the TEA to Saffron's Center", .body = test_route7_to_saffron}, .expectation = {.description = "onto the guard's trigger, below Saffron's Center door, nobody met"}, }, + { + .input = {.name = "15.01 running, the crossing onto Route 7 not held up", .body = test_route7_gate_running_crossing_not_held_up}, + .expectation = {.description = "a column long after the crossing, the walk still ends at the gate's guard"}, + }, }; } // namespace diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-15.01.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-15.01.plan.json index 00aca0fa5c..1ccf50304d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-15.01.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-15.01.plan.json @@ -6,6 +6,15 @@ "title": "Celadon to Saffron: the TEA to Route 7's gate guard, heal at Saffron's Center", "start": {"map": "CeladonCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ + { + "id": "to_gate_wall", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "Route7", "tiles": [[15, 11]], "facing": "north"} + }, + "why": "out of Celadon's Center (its ground floor coded), east through the city onto Route 7 and, in two legs that end at walls, to the gate's west wall a row below its door (15, 10): south down column 7 to the row behind the underground path house's roof, where row 12 stops the player, then east to the gate. Dead-reckoned, the walk ran a column long on the crossing east (the game didn't hold the player up there) and the hold south down column 8 hopped its ledge, which took two of its tiles, and ended a row short, against the gate's wall (console B, 2026-11-14 20:23 and 20:27); held to walls, column 7 or 8 ends on row 11 alike" + }, { "id": "west_of_tea_guard", "kind": "route", @@ -13,7 +22,7 @@ "args": { "target": {"map": "Route7_EastEntrance", "tiles": [[5, 4]], "facing": "east"} }, - "why": "out of Celadon's Center (its ground floor coded), east through the city and along Route 7 into its east gate (pokeguy bikes, 1:27:07 to 1:27:30), to (5, 4), a tile west of the guard's top trigger (6, 4)" + "why": "a step north onto the door's tile (15, 10), east through the gate's west door (pokeguy bikes, 1:27:07 to 1:27:30), to (5, 4), a tile west of the guard's top trigger (6, 4)" }, { "id": "tea_trigger", From 162f08743c8a9071627e22e5db0ed8198df03673 Mon Sep 17 00:00:00 2001 From: dayfine Date: Sat, 14 Nov 2026 21:33:19 -0800 Subject: [PATCH 2/2] FRLG 15.01 CI: ledge hop as two walk tiles; golden, trainer count, 18.01 sweep - LEDGE_HOP_TIME is TILE_TIME * 2: 533 ms, a millisecond under two rounded walk tiles, let the walking hold of "no hold over a ledge" take a step past the ledge to (26, 32), where the console stopped on (26, 31). - Golden 15.01: "walk north 1" onto the gate's door tile is a tap, as the test output prints it. - Route 3 trainer lines: 44, with 16.02's planned fight with Silph Co. 5F's corridor Rocket (7c95b4d15, red on the base too). - Fault sweep 18.01 late fade passes: off KNOWN_FAILING (red on the base too). --- .../PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h | 5 +++-- .../AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp | 2 -- .../Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h | 2 +- .../Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index 6d83a36f4c..9e6618e2eb 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -54,8 +54,9 @@ inline constexpr Milliseconds SURF_TILE_TIME(133); // (pokefirered DoJumpSpriteMovement(), JUMP_DISTANCE_FAR). Running, a hold // timed by its tiles spends two of them on the hop and ends a tile short // (console B, 2026-11-14 20:23 and 20:27, 15.01: "south 8" down Route 7's -// column 8 ended on row 9). -inline constexpr Milliseconds LEDGE_HOP_TIME(533); +// column 8 ended on row 9). Two walking tiles' time to the millisecond: +// a walking hold over a ledge ends where the game's does (cp0007-r..t). +inline constexpr Milliseconds LEDGE_HOP_TIME = TILE_TIME * 2; // The longest tap measured to only turn a player facing another way, and // to take exactly one step for one facing its way. inline constexpr Milliseconds LONGEST_TAP(133); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp index aca88d1029..182536d005 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp @@ -99,8 +99,6 @@ const std::map KNOWN_FAILING{ "below_oak on Route 1 gives up after 9 stops part-way (seeds 16, 30): count stops that make no progress, not every battle"}, {"PokemonFRLG::AutoStory - Fault sweep: 10.06, scene end pose", "below_fuji_house plans from (4, 7), where Mr. Fuji's script warps the player (warp 4, 7, exact); from a tile off, no wall in his house funnels the walk onto (3, 4): legs that re-anchor, if the console shows the warp can land elsewhere"}, - {"PokemonFRLG::AutoStory - Fault sweep: 18.01, late fade", - "pad_to_top_right: a pad hop stays on SaffronCity_Gym, so a fade seen late (or a slow fade-in) leaves no scene change to confirm the warp and the step finds no fade: a scene check for a warp within one map (the player's tile moved from the pad), as the walker's scene_confirms_missed_fade does for a leg"}, {"PokemonFRLG::AutoStory - Fault sweep: 09.01, unseen step", "Rocket Hideout's arrow maze: an unseen tap leaves the player on the leg's start or its end, and from what the screen shows the two look alike: a test tap toward a tile blocked from one but not the other tells them apart"}, {"PokemonFRLG::AutoStory - Fault sweep: 04.05, clean run", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h index 75eee8589c..e52c74bd74 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h @@ -26,7 +26,7 @@ inline constexpr std::string_view FRLG_PLAN_GOLDEN_15[] = { "15.01 walk east 8 (to wall) -> Route7 (15, 11)", "15.01 face north -> Route7 (15, 11)", "15.01 west_of_tea_guard from Route7 (15, 11) facing north to Route7_EastEntrance (5, 4) facing east", - "15.01 walk north 1 -> Route7 (15, 10)", + "15.01 walk north 1 -> Route7 (15, 10) [tapped]", "15.01 walk east 1 (warp) -> Route7_EastEntrance (1, 5)", "15.01 walk east 4 -> Route7_EastEntrance (5, 5)", "15.01 walk north 1 (to wall) -> Route7_EastEntrance (5, 4)", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index e7da4dffed..2026b65c8e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -858,7 +858,7 @@ UnitTestResult check_lines(const StoryCheckpoint& checkpoint, std::set