diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp index 6401dd7cc9..0a4f626940 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp @@ -77,6 +77,7 @@ class PlaceNameMatcher : public OCR::SmallDictionaryMatcher{ {"lavender-town", "Lavender Town"}, {"vermilion-city", "Vermilion City"}, {"celadon-city", "Celadon City"}, + {"rocket-hideout", "Rocket Hideout"}, }){ JsonArray names; names.push_back(name); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp index eca8adf9da..8fc91a73c5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp @@ -17,7 +17,9 @@ #include "PokemonFRLG_BikeSpinPresses.h" #include "PokemonFRLG_BikeSpinMechanics.h" #include "PokemonFRLG_OverworldMaps.h" +#include "CommonFramework/ImageTypes/ImageRGB32.h" #include "PokemonFRLG_OverworldRecovery.h" +#include "PokemonFRLG_OverworldRecoveryWalk.h" #include "PokemonFRLG_OverworldRoute.h" #include "PokemonFRLG_OverworldSim.h" #include "PokemonFRLG_OverworldSimField.h" @@ -215,7 +217,47 @@ UnitTestResult test_speed_after_door(){ return true; } +// A floor that repeats every 16-pixel tile, with a pillar on the bottom +// row, seen from `scroll` pixels east. +ImageRGB32 periodic_floor(size_t scroll){ + ImageRGB32 image(160, 160); + for (size_t y = 0; y < 160; y++){ + for (size_t x = 0; x < 160; x++){ + const size_t floor_x = x + scroll; + uint32_t pixel = (floor_x % 16 < 8) ^ (y % 16 < 8) ? 0xff808040 : 0xffa0a060; + if (y >= 130 && floor_x >= 100 && floor_x < 120){ + pixel = 0xff000000; + } + image.pixel(x, y) = pixel; + } + } + return image; +} + +// Rocket Hideout B3F (00.32 run 1): a tap east over a floor that repeats +// every tile left the top band the same, so the tap read as a turn. +UnitTestResult test_scroll_over_periodic_floor(){ + const ImageFloatBox game(0, 0, 1, 1); + const ImageRGB32 before = periodic_floor(0); + const double stepped = tap_scroll_change(before, periodic_floor(16), game); + if (stepped <= WALL_TAP_MOVED_RMSD){ + return std::format("Expected a one-tile scroll to read as a step: change {}.", stepped); + } + ImageRGB32 turned = periodic_floor(0); + for (size_t y = 64; y < 96; y++){ + for (size_t x = 64; x < 96; x++){ + turned.pixel(x, y) = 0xffff0000; + } + } + const double bumped = tap_scroll_change(before, turned, game); + if (bumped > WALL_TAP_MOVED_RMSD){ + return std::format("Expected the player turning in the middle not to read as a step: change {}.", bumped); + } + return true; +} + const BikeCase OVERWORLD_BIKE_CASES[] = { + {.input = {"a tap over a floor that repeats every tile", test_scroll_over_periodic_floor}, .expectation = {"scroll seen at the bottom edge; a turn is not"}}, {.input = {"taps a tile each, one in 12 dropped 60ms apart", test_tap_chains}, .expectation = {"23 of 25 tiles at 60ms; 25 at 100 and 120ms"}}, {.input = {"an open leg of 11 from a start 2 off, counted in taps", test_counted_leg_off_start}, .expectation = {"found against the rock and walked back"}}, {.input = {"SELECT onto the registered Bicycle", test_select_onto_bike}, .expectation = {"one press registered; two and off unregistered"}}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp index d2d935c811..6a23506c8e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp @@ -4,6 +4,7 @@ * */ +#include #include #include #include @@ -61,21 +62,26 @@ struct StepWalk{ bool blocked = false; }; -// TODO(forest drift, 2026-11-01): the threshold is a diagnostic's guess. -// How much the game screen's top quarter, clear of the player in the -// middle, may change when a tap toward a wall only bumps the player (the -// player's own animation, an animated tile). A step scrolls the whole map -// by a tile. Not yet measured on the console: a guess on the safe side. -constexpr double WALL_TAP_MOVED_RMSD = 20.0; - -// How much the top quarter of the game screen changed from `before` to -// `after`: a step scrolls it by a tile. -double top_band_change(const ImageViewRGB32& before, const ImageViewRGB32& after){ - const ImageFloatBox game = GameSettings::instance().GAME_BOX; - const ImageFloatBox band(game.x, game.y, game.width, game.height * 0.25); - return ImageMatch::pixel_RMSD(extract_box_reference(before, band), extract_box_reference(after, band)); +} // namespace + +double tap_scroll_change(const ImageViewRGB32& before, const ImageViewRGB32& after, const ImageFloatBox& game){ + const double w = game.width * 0.25; + const double h = game.height * 0.25; + const ImageFloatBox bands[] = { + {game.x, game.y, game.width, h}, + {game.x, game.y + game.height - h, game.width, h}, + {game.x, game.y, w, game.height}, + {game.x + game.width - w, game.y, w, game.height}, + }; + double most = 0; + for (const ImageFloatBox& band : bands){ + most = std::max(most, ImageMatch::pixel_RMSD(extract_box_reference(before, band), extract_box_reference(after, band))); + } + return most; } +namespace{ + // A counted tap's press, its release and the wait after it for the // screen to show the step. struct TapTiming{ @@ -116,7 +122,7 @@ BikeTap console_bike_tap( return BikeTap{.moved = false, .interrupt = (size_t)ret}; } const VideoSnapshot after = console.video().snapshot(); - if (before && after && top_band_change(before, after) > WALL_TAP_MOVED_RMSD){ + if (before && after && tap_scroll_change(before, after, GameSettings::instance().GAME_BOX) > WALL_TAP_MOVED_RMSD){ return BikeTap{.moved = true}; } const bool late = Pokemon::clear_late_interrupts(console, context, interrupts, AFTER_LEG_WATCH, MAX_INTERRUPTIONS_PER_LEG) > 0; @@ -412,7 +418,7 @@ bool moved_past_wall(ConsoleHandle& console, ProControllerContext& context, cons if (!before || !after){ return false; } - const double change = top_band_change(before, after); + const double change = tap_scroll_change(before, after, GameSettings::instance().GAME_BOX); console.log(std::format("Position check: a tap toward the wall of {} changed the screen by {:.1f}.", to_string(step), change)); return change > WALL_TAP_MOVED_RMSD; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h index 51cd54ac1a..a65eca8c20 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h @@ -15,6 +15,8 @@ #include #include +#include "CommonFramework/ImageTools/ImageBoxes.h" +#include "CommonFramework/ImageTypes/ImageViewRGB32.h" #include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" #include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" #include "PokemonFRLG_OverworldRecovery.h" @@ -26,6 +28,21 @@ namespace NintendoSwitch{ namespace PokemonFRLG{ +// TODO(forest drift, 2026-11-01): the threshold is a diagnostic's guess. +// How much each edge quarter of the game screen, clear of the player in the +// middle, may change when a tap toward a wall only bumps the player (the +// player's own animation, an animated tile). A step scrolls the whole map +// by a tile. Not yet measured on the console: a guess on the safe side. +constexpr double WALL_TAP_MOVED_RMSD = 20.0; + +// How much a counted tap scrolled the map: the largest RMSD between `before` +// and `after` over the four edge quarters (top, bottom, left, right) of +// `game`, all clear of the player in the middle. One band alone misses a +// step over a floor that repeats every tile (Rocket Hideout B3F, 00.32): a +// one-tile scroll leaves the band nearly the same. +double tap_scroll_change(const ImageViewRGB32& before, const ImageViewRGB32& after, const ImageFloatBox& game); + + // Walks `route`, planned with `planning`, at `speed`, as // walk_overworld_route() does, from the same start: standing still on the // overworld, not on the bike, facing `facing` (read from the screen if not diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index cd3c1f38d4..6b354a5d94 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -326,7 +326,6 @@ std::optional OverworldSim::press(Direction direction) const return step; } - // A trainer on the player's map who sees them now walks up and speaks. bool OverworldSim::trainer_sees(Milliseconds pressed){ std::vector& objects = m_maps[m_map].objects; @@ -528,7 +527,6 @@ void OverworldSim::stuck_hold(Direction direction){ } } - std::optional OverworldSim::hold( Direction direction, Milliseconds duration, Milliseconds release, Milliseconds watch, const std::vector& watchers @@ -674,8 +672,6 @@ bool OverworldSim::close_message(){ return true; } - - // // OverworldSimWalker // @@ -698,7 +694,6 @@ Milliseconds delay_of(const OverworldInterrupts& interrupts, size_t index){ } // namespace - OverworldSimWalker::OverworldSimWalker(OverworldSim& sim, SimWalkerRules rules, const OverworldInterruptSet& walker) : m_sim(sim) , m_rules(rules) @@ -787,16 +782,22 @@ std::optional OverworldSimWalker::hold_watching(const RouteStep& step, // was a wild battle's, run from. wait_out_warp()'s watcher takes a wild // battle's wipe for the fade (run 7; console B, 2026-11-03, Mt. Moon 1F): // the battle screen stands in for the wipe. The fade is watched for from -// `watched_from`: a fade over by then is missed. +// `watched_from`: a fade over by then is missed. No warp: a step more, +// twice: a hold ends up to two tiles short, and an arrow warp (stairs) +// fires on the press made standing on it. bool OverworldSimWalker::after_warp(const RouteStep& step, int warps_before, Milliseconds watched_from){ if (black_without_warp(step, warps_before, watched_from)){ return true; } - if (m_sim.state().warps == warps_before){ - if (!m_sim.watch({SimWatcher::BATTLE_SCREEN}, WARP_TIMEOUT)){ - fail("walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + "."); + bool battle = false; + if (m_sim.state().warps == warps_before && !(battle = m_sim.watch({SimWatcher::BATTLE_SCREEN}, WARP_TIMEOUT).has_value())){ + for (int tap = 0; tap < 2 && m_sim.state().warps == warps_before; tap++){ + m_log.push_back("Route: no fade; one more step into the warp."); + watched_from = m_sim.state().time; + m_sim.tap(step.direction, STEP_TAP, STEP_TAP_RELEASE); } - }else if (!fade_over_since(watched_from) && !m_sim.watch({SimWatcher::FADE}, WARP_TIMEOUT)){ + } + if (!battle && (m_sim.state().warps == warps_before || (!fade_over_since(watched_from) && !m_sim.watch({SimWatcher::FADE}, WARP_TIMEOUT)))){ fail("walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + "."); } m_sim.watch({}, AFTER_WARP); @@ -988,8 +989,6 @@ std::string OverworldSimWalker::run(const std::vector& route, const R return ""; } - - } // namespace PokemonFRLG } // namespace NintendoSwitch } // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 54987045d8..24abe22202 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -360,13 +360,26 @@ void wait_out_fade(ConsoleHandle& console, ProControllerContext& context, const return; } context.wait_for_all_requests(); - if (wait_until(console, context, WARP_TIMEOUT, {fade.watcher()}) < 0){ - OperationFailedExceptionWithScreenshot::fire( - ErrorReportMode::SEND_ERROR_REPORT, - "walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + ".", - console - ); + if (wait_until(console, context, WARP_TIMEOUT, {fade.watcher()}) >= 0){ + return; + } + // A hold that ended short of a stairs or door warp, or on an arrow + // warp: a step more at a time, twice, takes it. A hold ends up to two + // tiles short, and an arrow warp fires on the press made standing on it. + for (int tap = 0; tap < 2; tap++){ + console.log("Route: no fade; one more step into the warp.", COLOR_ORANGE); + BlackScreenOverWatcher arrival(COLOR_RED); + Pokemon::WatchAlong retry_fade(arrival); + pbf_press_dpad(context, dpad(step.direction), STEP_TAP, STEP_TAP_RELEASE); + if (wait_until(console, context, WARP_TIMEOUT, {retry_fade.watcher()}) >= 0){ + return; + } } + OperationFailedExceptionWithScreenshot::fire( + ErrorReportMode::SEND_ERROR_REPORT, + "walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + ".", + console + ); } } // namespace diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index be8410780d..f24e642cf2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -368,6 +368,9 @@ const std::vector& story_maps(){ const std::vector all = overworld_maps(); std::set flags = map_flag_set(all, "after_hall_of_fame"); flags.merge(map_flag_set(all, "new_game")); + // The one ball the story picks up in its way: B2F's MOON STONE + // blocks column 2 of the arrow floor (00.32's moon_stone). + flags.insert("FLAG_HIDE_ROCKET_HIDEOUT_B2F_MOON_STONE"); return overworld_maps(flags); }(); return maps; @@ -402,6 +405,7 @@ std::string save_card_place(const std::string& map){ {"Route10", "route-10"}, {"LavenderTown", "lavender-town"}, {"CeladonCity", "celadon-city"}, + {"RocketHideout", "rocket-hideout"}, }; for (const auto& [prefix, place] : PLACES){ if (map == prefix || map.rfind(prefix + "_", 0) == 0){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 6e678803fa..80f4dd02a0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -320,6 +320,61 @@ UnitTestResult test_b3f_maze_taps(){ return true; } +// 00.32's taps (frlg-00.32.plan.json): B3F from below its Rare Candy up +// to the top corridor, and B2F's arrows to the MOON STONE's stop and on +// to the lift room's stop (13, 20), up to row 17 and on to below the +// lift, and B4F from the lift door to the guards, Giovanni and the +// SILPH SCOPE, with any one turn dropped; the stairs up from B3F, which +// end on their warp, with any hold short. +UnitTestResult test_b2f_maze_taps(){ + using Pokemon::StoryLeg; + const MapPosition b2f_stairs{"RocketHideout_B2F", {21, 2}}; + const MapPosition lift_stop{"RocketHideout_B2F", {13, 20}}; + const MapPosition left_guard{"RocketHideout_B4F", {16, 15}}; + const MapPosition right_guard{"RocketHideout_B4F", {19, 15}}; + const MapPosition below_giovanni{"RocketHideout_B4F", {19, 5}}; + const std::vector failures{ + tap_legs_on_sim({"RocketHideout_B3F", {12, 13}}, Direction::NORTH, { + {Direction::WEST, 4}, {Direction::NORTH, 2}, {Direction::EAST, 4}, {Direction::NORTH, 7}, + }, {"RocketHideout_B3F", {12, 2}}), + tap_legs_on_sim(b2f_stairs, Direction::EAST, { + {Direction::SOUTH, 1}, {Direction::WEST, 2}, {Direction::SOUTH, 2}, {Direction::WEST, 2}, {Direction::SOUTH, 1}, {Direction::WEST, 1}, + }, {"RocketHideout_B2F", {1, 4}}), + tap_legs_on_sim({"RocketHideout_B2F", {2, 4}}, Direction::SOUTH, { + {Direction::SOUTH, 4}, {Direction::EAST, 1}, {Direction::SOUTH, 1}, {Direction::EAST, 1}, {Direction::EAST, 2}, {Direction::WEST, 2}, + {Direction::EAST, 3}, {Direction::SOUTH, 2}, {Direction::WEST, 1}, {Direction::EAST, 1}, {Direction::SOUTH, 1}, + }, lift_stop), + short_holds_on_sim({"RocketHideout_B3F", {12, 2}}, Direction::NORTH, b2f_stairs), + tap_legs_on_sim(lift_stop, Direction::EAST, { + {Direction::EAST, 2}, {Direction::NORTH, 3}, + }, {"RocketHideout_B2F", {15, 17}}), + tap_legs_on_sim({"RocketHideout_B2F", {1, 4}}, Direction::WEST, { + {Direction::EAST, 1}, + }, {"RocketHideout_B2F", {2, 4}}), + tap_legs_on_sim({"RocketHideout_B2F", {15, 17}}, Direction::NORTH, { + {Direction::EAST, 12}, {Direction::SOUTH, 1}, {Direction::EAST, 1}, {Direction::NORTH, 1}, + }, {"RocketHideout_B2F", {28, 17}}), + tap_legs_on_sim({"RocketHideout_B4F", {20, 23}}, Direction::SOUTH, { + {Direction::SOUTH, 1}, {Direction::WEST, 4}, {Direction::NORTH, 9}, + }, left_guard), + tap_legs_on_sim(left_guard, Direction::NORTH, { + {Direction::SOUTH, 1}, {Direction::EAST, 3}, {Direction::NORTH, 1}, + }, right_guard), + tap_legs_on_sim(right_guard, Direction::NORTH, { + {Direction::WEST, 2}, {Direction::NORTH, 10}, {Direction::EAST, 2}, + }, below_giovanni), + tap_legs_on_sim(below_giovanni, Direction::NORTH, { + {Direction::WEST, 2}, {Direction::SOUTH, 2}, {Direction::EAST, 4}, {Direction::NORTH, 2}, + }, {"RocketHideout_B4F", {21, 5}}), + }; + for (const std::string& failure : failures){ + if (!failure.empty()){ + return failure; + } + } + return true; +} + struct AutoStoryHideoutBodyInput{ std::string name; UnitTestResult (*body)(); @@ -363,6 +418,10 @@ const AutoStoryHideoutBodyCase HIDEOUT_BODY_CASES[] = { .input = {.name = "B3F's arrow floor a tap at a time", .body = test_b3f_maze_taps}, .expectation = {.description = "below the stairs to B4F, with any one turn dropped"}, }, + { + .input = {.name = "B2F's arrow floor to the lift a tap at a time", .body = test_b2f_maze_taps}, + .expectation = {.description = "00.32's taps and the routes between them, any turn dropped or hold short"}, + }, }; const LiftCase LIFT_CASES[] = { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp index b90d21a91b..0909dd3e37 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp @@ -26,6 +26,7 @@ #include #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/TestRunners/UnitTest.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_HideoutLiftRoom.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" @@ -755,6 +756,52 @@ UnitTestResult test_hideout_row(Logger&){ } // namespace +// 00.32 on the sim: from below B3F's Rare Candy back up to B2F, through +// its arrows (the MOON STONE ball stands in the way and is picked up), +// the lift to B4F, the two door guards, Giovanni, and beside the SILPH +// SCOPE. The talk-started battles are the sim's to skip; the MOON +// STONE's pickup hides its ball, as the game does. +UnitTestResult test_hideout_giovanni_row(Logger&){ + const StoryCheckpoint& row = checkpoint("00.32"); + StoryPose at = *story_pose(*row.start); + std::vector maps = maps_after_route10(); + if (std::none_of(maps.begin(), maps.end(), [](const MapData& map){ return map.name == LIFT_MAP; })){ + maps.push_back(rocket_hideout_lift_room()); + } + SimScript script; + script.lift_floors[std::string(LIFT_MAP)] = rocket_hideout_lift_doors(); + auto sim = std::make_unique(maps, MapPosition{at.map, at.tile}, *at.facing, script); + for (const StoryStep& step : row.steps){ + if (step.name == "escape_rope_hideout"){ + break; + } + if (step.kind == StoryStepKind::BATTLE){ + at = *story_pose(*step.pose_after); + continue; + } + if (const std::string failure = row_step_on_sim(*sim, at, step, row.id); !failure.empty()){ + return "00.32: ended on " + to_string(sim->state().position) + "; " + failure; + } + if (step.name == "moon_stone"){ + for (MapData& map : maps){ + hide_objects(map, {"FLAG_HIDE_ROCKET_HIDEOUT_B2F_MOON_STONE"}); + } + sim = std::make_unique(maps, sim->state().position, sim->state().facing, script); + } + } + if (!sim->state().trainers_beaten.empty()){ + return std::format("00.32: walked into {} trainers' lines on the sim.", sim->state().trainers_beaten.size()); + } + if (!sim->state().violations.empty()){ + return "00.32: a violation on the way: " + sim->state().violations.back(); + } + const MapPosition end{"RocketHideout_B4F", {21, 5}}; + if (!(sim->state().position == end)){ + return "00.32: ended on " + to_string(sim->state().position) + ", not " + to_string(end) + "."; + } + return true; +} + const AutoStoryLavenderCase AUTO_STORY_LAVENDER_CASES[] = { {.input = {"00.28 the tree, Rock Tunnel's nine trainers, out of its south mouth", test_rock_tunnel_row}, .expectation = {}}, {.input = {"00.28 a wild battle mid-leg in the tunnel", test_rock_tunnel_wild_battles}, .expectation = {}}, @@ -775,6 +822,7 @@ const AutoStoryLavenderCase AUTO_STORY_LAVENDER_CASES[] = { {.input = {"00.30 Route 8 west from a start up to 3 tiles off", test_route8_west_off_start}, .expectation = {}}, {.input = {"00.30 saves in Celadon City's Pokemon Center", test_celadon_save_place}, .expectation = {}}, {.input = {"00.31 the Game Corner's poster, the Rocket Hideout to B4F's LIFT KEY and B3F's Rare Candy", test_hideout_row}, .expectation = {}}, + {.input = {"00.32 B2F's arrows, the lift, the door guards, Giovanni and the SILPH SCOPE", test_hideout_giovanni_row}, .expectation = {}}, }; void add_tests_AutoStoryLavender(UnitTestDatabase& database){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp index a5d02a435d..f02be1c314 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp @@ -138,7 +138,7 @@ class Test_RunPlan : public UnitTest{ const RunPlanScenario m_scenario; }; -const std::string TODAY = "00.01 00.02 00.03 00.04 00.05 00.06 00.07 00.08 00.09 00.10 00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"; +const std::string TODAY = "00.01 00.02 00.03 00.04 00.05 00.06 00.07 00.08 00.09 00.10 00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"; const RunPlanScenario RUN_PLAN_CASES[] = { { @@ -229,11 +229,11 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Gift RNG off: 00.12b is passed over", .first = "00.11"}, - .expectation = {.expected_ids = "00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"}, + .expectation = {.expected_ids = "00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, }, { .input = {.name = "Gift RNG off: 00.12b runs when started at", .first = "00.12b"}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"}, + .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, }, { .input = { .name = "Gift RNG: started at 00.12b, from the save beside the salesman", @@ -258,7 +258,7 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Starter RNG alone: 00.12b runs when started at", .first = "00.12b", .handoffs = {.starter_rng = true}}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"}, + .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, }, { .input = { .name = "Starter RNG first, with both on", 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 48a3e724dc..9cfe7926b6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -231,8 +231,8 @@ UnitTestResult check_checkpoint(const StoryCheckpoint& checkpoint, StoryPose& po UnitTestResult test_routes_and_chain(){ const std::vector& checkpoints = story_checkpoints(); - if (checkpoints.size() != 38 || checkpoints[0].start){ - return "Expected 38 checkpoints, the first from a new game."; + if (checkpoints.size() != 39 || checkpoints[0].start){ + return "Expected 39 checkpoints, the first from a new game."; } StoryPose pose; for (size_t c = 0; c < checkpoints.size(); c++){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index 77e203aee2..dd16d7f0e2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1,7 +1,7 @@ { "about": "story_sim_trace() of the FRLG story table (Data/AuthoredStory_Tests.h), taken from the C++ rows before they moved to StoryData; from 00.30 on, from their plans.", "trace": [ - "[Segment] 00: start, 35 checkpoints", + "[Segment] 00: start, 36 checkpoints", "begin 00.01", "[Checkpoint] 00.01: start, 2 events", "[Event] 00.01/1 intro: start", @@ -1346,9 +1346,88 @@ "save at RocketHideout_B3F (12, 13) facing north (tile)", "[Checkpoint] 00.31: done, 22 run, 0 skipped", "[Checkpoint] 00.31: passed on attempt 1 (one-shot)", - "[Segment] 00: 35 of 35 checkpoints one-shot", - "[Segment] 00: done, 35 checkpoints", + "begin 00.32", + "[Checkpoint] 00.32: start, 25 events", + "[Event] 00.32/1 from_save: start", + "[Event] 00.32/1 from_save: done", + "[Event] 00.32/2 b3f_to_top_corridor: start", + "00.32/b3f_to_top_corridor: ok at RocketHideout_B3F (12, 2) facing north (tile)", + "[Event] 00.32/2 b3f_to_top_corridor: done", + "[Event] 00.32/3 b2f_from_b3f: start", + "00.32/b2f_from_b3f: ok at RocketHideout_B2F (21, 2) facing east (tile)", + "[Event] 00.32/3 b2f_from_b3f: done", + "[Event] 00.32/4 b2f_arrows_to_moon_stone: start", + "00.32/b2f_arrows_to_moon_stone: ok at RocketHideout_B2F (1, 4) facing west (tile)", + "[Event] 00.32/4 b2f_arrows_to_moon_stone: done", + "[Event] 00.32/5 beside_moon_stone: start", + "00.32/beside_moon_stone: ok at RocketHideout_B2F (2, 4) facing east (tile)", + "[Event] 00.32/5 beside_moon_stone: done", + "[Event] 00.32/6 above_moon_stone: start", + "00.32/above_moon_stone: ok at RocketHideout_B2F (2, 4) facing south (tile)", + "[Event] 00.32/6 above_moon_stone: done", + "[Event] 00.32/7 moon_stone: start", + "00.32/moon_stone: ok at -", + "[Event] 00.32/7 moon_stone: done", + "[Event] 00.32/8 b2f_arrows_to_lift_room: start", + "00.32/b2f_arrows_to_lift_room: ok at RocketHideout_B2F (13, 20) facing east (tile)", + "[Event] 00.32/8 b2f_arrows_to_lift_room: done", + "[Event] 00.32/9 lift_room_to_row_17: start", + "00.32/lift_room_to_row_17: ok at RocketHideout_B2F (15, 17) facing north (tile)", + "[Event] 00.32/9 lift_room_to_row_17: done", + "[Event] 00.32/10 below_lift: start", + "00.32/below_lift: ok at RocketHideout_B2F (28, 17) facing north (tile)", + "[Event] 00.32/10 below_lift: done", + "[Event] 00.32/11 lift_to_b4f: start", + "00.32/lift_to_b4f: ok at RocketHideout_B2F (28, 17) facing north (tile)", + "[Event] 00.32/11 lift_to_b4f: done", + "[Event] 00.32/12 below_left_guard: start", + "00.32/below_left_guard: ok at RocketHideout_B4F (16, 15) facing north (tile)", + "[Event] 00.32/12 below_left_guard: done", + "[Event] 00.32/13 talk_left_guard: start", + "00.32/talk_left_guard: ok at -", + "[Event] 00.32/13 talk_left_guard: done", + "[Event] 00.32/14 left_guard: start", + "00.32/left_guard: ok at -", + "[Event] 00.32/14 left_guard: done", + "[Event] 00.32/15 below_right_guard: start", + "00.32/below_right_guard: ok at RocketHideout_B4F (19, 15) facing north (tile)", + "[Event] 00.32/15 below_right_guard: done", + "[Event] 00.32/16 talk_right_guard: start", + "00.32/talk_right_guard: ok at -", + "[Event] 00.32/16 talk_right_guard: done", + "[Event] 00.32/17 right_guard: start", + "00.32/right_guard: ok at -", + "[Event] 00.32/17 right_guard: done", + "[Event] 00.32/18 beside_giovanni: start", + "00.32/beside_giovanni: ok at RocketHideout_B4F (19, 5) facing east (tile)", + "[Event] 00.32/18 beside_giovanni: done", + "[Event] 00.32/19 below_giovanni: start", + "00.32/below_giovanni: ok at RocketHideout_B4F (19, 5) facing north (tile)", + "[Event] 00.32/19 below_giovanni: done", + "[Event] 00.32/20 talk_giovanni: start", + "00.32/talk_giovanni: ok at -", + "[Event] 00.32/20 talk_giovanni: done", + "[Event] 00.32/21 giovanni: start", + "00.32/giovanni: ok at -", + "[Event] 00.32/21 giovanni: done", + "[Event] 00.32/22 east_of_silph_scope: start", + "00.32/east_of_silph_scope: ok at RocketHideout_B4F (21, 5) facing north (tile)", + "[Event] 00.32/22 east_of_silph_scope: done", + "[Event] 00.32/23 beside_silph_scope: start", + "00.32/beside_silph_scope: ok at RocketHideout_B4F (21, 5) facing west (tile)", + "[Event] 00.32/23 beside_silph_scope: done", + "[Event] 00.32/24 silph_scope: start", + "00.32/silph_scope: ok at -", + "[Event] 00.32/24 silph_scope: done", + "[Event] 00.32/25 escape_rope_hideout: start", + "00.32/escape_rope_hideout: ok at RocketHideout_B4F (21, 5) facing west (tile)", + "[Event] 00.32/25 escape_rope_hideout: done", + "save at CeladonCity (34, 22) facing south (tile)", + "[Checkpoint] 00.32: done, 25 run, 0 skipped", + "[Checkpoint] 00.32: passed on attempt 1 (one-shot)", + "[Segment] 00: 36 of 36 checkpoints one-shot", + "[Segment] 00: done, 36 checkpoints", "completed", - "00.01: 2 stubbed: intro, options\n00.02: 0 stubbed\n00.03: 1 stubbed: to_the_lab\n00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n00.05: 1 stubbed: parcel_from_clerk\n00.06: 2 stubbed: give_parcel, pokedex_scene\n00.07: 2 stubbed: heal_viridian, old_man_tutorial\n00.08: 1 stubbed: heal_pewter\n00.09: 3 stubbed: camper_liam, challenge_brock, brock\n00.10: 1 stubbed: shoes_from_aide\n00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n00.12: 1 stubbed: heal_route4\n00.12c: 1 stubbed: magikarp_to_box\n00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n00.14: 2 stubbed: teach_mega_kick, heal_cerulean\n00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n00.15b: 2 stubbed: teach_water_pulse, rival_cerulean\n00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n00.19: 1 stubbed: heal_cerulean\n00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n00.29: 1 stubbed: heal_lavender\n00.30: 7 stubbed: register_bike, buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon\n00.31: 6 stubbed: talk_poster_guard, rocket_grunt, poster_switch, lift_key_grunt, lift_key, b3f_rare_candy\n" + "00.01: 2 stubbed: intro, options\n00.02: 0 stubbed\n00.03: 1 stubbed: to_the_lab\n00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n00.05: 1 stubbed: parcel_from_clerk\n00.06: 2 stubbed: give_parcel, pokedex_scene\n00.07: 2 stubbed: heal_viridian, old_man_tutorial\n00.08: 1 stubbed: heal_pewter\n00.09: 3 stubbed: camper_liam, challenge_brock, brock\n00.10: 1 stubbed: shoes_from_aide\n00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n00.12: 1 stubbed: heal_route4\n00.12c: 1 stubbed: magikarp_to_box\n00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n00.14: 2 stubbed: teach_mega_kick, heal_cerulean\n00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n00.15b: 2 stubbed: teach_water_pulse, rival_cerulean\n00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n00.19: 1 stubbed: heal_cerulean\n00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n00.29: 1 stubbed: heal_lavender\n00.30: 7 stubbed: register_bike, buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon\n00.31: 6 stubbed: talk_poster_guard, rocket_grunt, poster_switch, lift_key_grunt, lift_key, b3f_rare_candy\n00.32: 10 stubbed: moon_stone, lift_to_b4f, talk_left_guard, left_guard, talk_right_guard, right_guard, talk_giovanni, giovanni, silph_scope, escape_rope_hideout\n" ] } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json deleted file mode 100644 index fcb107b1f7..0000000000 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "format": "pokesim-authored-checkpoint/1", - "game": "frlg", - "checkpoint": { - "id": "00.32", - "title": "Rocket Hideout: the lift to B4F, the two door guards, two Rare Candies, Blastoise, Giovanni and the SILPH SCOPE", - "start": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "north", "kind": "tiles", "tiles": [[12, 13]]}}, - "events": [ - { - "id": "b2f_lift", - "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B2F", "where": {"facing": "north", "kind": "tiles", "tiles": [[28, 17]]}}, - "variant": "run", - "why": "up to B2F, along the arrow tiles to the lift (28..29, 16)" - }, - { - "id": "lift_to_b4f", - "kind": "game_action", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "south", "kind": "tiles", "tiles": [[20, 23]]}}, - "variant": "lift_floor", - "args": {"from": "B2F", "to": "B4F"}, - "why": "the lift script: in through the door (28, 16), to the panel, B4F with the LIFT KEY, out onto B4F's lift door; no map of the lift" - }, - { - "id": "b4f_below_guards", - "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, - "variant": "run", - "why": "from the lift door to below the two Grunts (16, 14) and (19, 14)" - }, - { - "id": "talk_left_guard", - "kind": "talk", - "why": "the left door guard" - }, - { - "id": "hideout-left-guard", - "kind": "battle", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, - "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_16): Sandshrew, Sandslash, Ekans Lv23" - }, - { - "id": "talk_right_guard", - "kind": "talk", - "why": "the right door guard" - }, - { - "id": "hideout-right-guard", - "kind": "battle", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, - "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_17): Ekans, Sandshrew, Arbok Lv23; the door opens" - }, - { - "id": "rare_candy_1", - "kind": "game_action", - "variant": "use_item", - "args": {"item": "rare-candy", "slot": 1}, - "why": "Rare Candy: Lv35 (pokeguy 1:00:25)" - }, - { - "id": "rare_candy_2", - "kind": "game_action", - "variant": "use_item", - "args": {"item": "rare-candy", "slot": 1}, - "why": "Rare Candy: Lv36, Wartortle evolves" - }, - { - "id": "evolve_blastoise", - "kind": "scene", - "why": "Wartortle evolves into Blastoise; do not press B" - }, - { - "id": "below_giovanni", - "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 5]]}}, - "why": "through the door to below Giovanni (19, 4)" - }, - { - "id": "talk_giovanni", - "kind": "talk", - "why": "Giovanni" - }, - { - "id": "hideout-giovanni", - "kind": "battle", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 5]]}}, - "why": "Giovanni (TRAINER_BOSS_GIOVANNI): Onix, Rhyhorn, Kangaskhan" - }, - { - "id": "beside_silph_scope", - "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[21, 5]]}}, - "why": "round to east of the SILPH SCOPE (20, 5)" - }, - { - "id": "silph_scope", - "kind": "talk", - "why": "pick up the SILPH SCOPE" - }, - { - "id": "escape_rope_hideout", - "kind": "game_action", - "declared_after": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[34, 22]]}}, - "variant": "use_item", - "args": {"item": "escape-rope"}, - "why": "out to the Game Corner's door (pokeguy 1:02:10)" - } - ] - }, - "execution": {"menu": "full"} -} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json new file mode 100644 index 0000000000..8b706af9b0 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json @@ -0,0 +1,480 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.32", + "title": "Rocket Hideout: B2F's arrows and the MOON STONE, the lift to B4F, the two door guards, Giovanni, the SILPH SCOPE and an Escape Rope out", + "start": { + "certainty": "tile", + "map": "RocketHideout_B3F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 12, + 13 + ] + ] + } + }, + "events": [ + { + "id": "b3f_to_top_corridor", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "west", + "tiles": 4 + }, + { + "direction": "north", + "tiles": 2 + }, + { + "direction": "east", + "tiles": 4 + }, + { + "direction": "north", + "tiles": 7 + } + ], + "why": "a tap a tile from below the Rare Candy (12, 12): west along row 13 to (8, 13), north onto the arrow (8, 11), which slides to the stop (8, 9), east to (12, 9) and up column 12 to the wall at (12, 2)" + }, + { + "id": "b2f_from_b3f", + "kind": "route", + "target": { + "certainty": "tile", + "map": "RocketHideout_B2F", + "where": { + "facing": "east", + "kind": "tiles", + "tiles": [ + [ + 21, + 2 + ] + ] + } + }, + "variant": "run", + "why": "east along row 2 onto the stairs (18, 2), up to B2F's (21, 2); no arrow on the way" + }, + { + "id": "b2f_arrows_to_moon_stone", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "west", + "tiles": 2 + }, + { + "direction": "south", + "tiles": 2 + }, + { + "direction": "west", + "tiles": 2 + }, + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "west", + "tiles": 1 + } + ], + "why": "a tap a tile, west of the turning Grunt (20, 6) and out of his lines (sight 2): down to (21, 3), west to (19, 3), down to (19, 5), west to (17, 5), down to (17, 6), west onto the arrow (16, 6), which slides west and, turned at (11, 6) and (11, 4), on to the stop (1, 4)" + }, + { + "id": "beside_moon_stone", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "east", + "tiles": 1 + } + ], + "why": "a tap east from the stop (1, 4) to above the MOON STONE (2, 5), which stands in the only way on (pokeguy 57:52)" + }, + { + "id": "above_moon_stone", + "kind": "route", + "target": { + "certainty": "tile", + "map": "RocketHideout_B2F", + "where": { + "facing": "south", + "kind": "tiles", + "tiles": [ + [ + 2, + 4 + ] + ] + } + }, + "variant": "run", + "why": "turn to face the MOON STONE (2, 5): no tile to walk" + }, + { + "id": "moon_stone", + "kind": "talk", + "why": "pick up the MOON STONE: the ball blocks column 2" + }, + { + "id": "b2f_arrows_to_lift_room", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "south", + "tiles": 4 + }, + { + "direction": "east", + "tiles": 1 + }, + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "east", + "tiles": 1 + }, + { + "direction": "east", + "tiles": 2 + }, + { + "direction": "west", + "tiles": 2 + }, + { + "direction": "east", + "tiles": 3 + }, + { + "direction": "south", + "tiles": 2 + }, + { + "direction": "west", + "tiles": 1 + }, + { + "direction": "east", + "tiles": 1 + }, + { + "direction": "south", + "tiles": 1 + } + ], + "why": "a tap a tile through B2F's arrows, each slide the end of a leg: down column 2 to (2, 8), east and down to (3, 9), east onto (4, 9), which slides to the stop (8, 11); east twice, the second onto a slide to the stop (14, 13); west twice onto a slide to the stop (10, 15); east to (13, 15), down to (13, 17), west onto a slide to the stop (8, 19), east to (9, 19) and down onto (9, 20), which slides east to the stop (13, 20)" + }, + { + "id": "lift_room_to_row_17", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "east", + "tiles": 2 + }, + { + "direction": "north", + "tiles": 3 + } + ], + "why": "a tap a tile from the stop (13, 20): east to the wall at (15, 20) and up column 15 to row 17; a hold up the open column that ended short sent the run east along row 18 into its wall at (17, 18)" + }, + { + "id": "below_lift", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "east", + "tiles": 12 + }, + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "east", + "tiles": 1 + }, + { + "direction": "north", + "tiles": 1 + } + ], + "why": "a tap a tile along row 17 to (27, 17), down to row 18 and east to (28, 18), and up to below the lift door (28, 16), facing it" + }, + { + "id": "lift_to_b4f", + "kind": "game_action", + "declared_after": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "south", + "kind": "tiles", + "tiles": [ + [ + 20, + 23 + ] + ] + } + }, + "variant": "lift_floor", + "args": { + "from": "B2F", + "to": "B4F" + }, + "why": "the lift script: in through the door (28, 16), to the panel, B4F with the LIFT KEY, out onto B4F's lift door; no map of the lift" + }, + { + "id": "below_left_guard", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "west", + "tiles": 4 + }, + { + "direction": "north", + "tiles": 9 + } + ], + "why": "a tap a tile off the lift door (20, 23): down to (20, 24), west to (16, 24) and up column 16 to below the left door Grunt (16, 14)" + }, + { + "id": "talk_left_guard", + "kind": "talk", + "why": "the left door guard" + }, + { + "id": "left_guard", + "kind": "battle", + "declared_after": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 16, + 15 + ] + ] + } + }, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_16): Sandshrew, Sandslash, Ekans Lv23" + }, + { + "id": "below_right_guard", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "east", + "tiles": 3 + }, + { + "direction": "north", + "tiles": 1 + } + ], + "why": "a tap a tile: down to (16, 16), east along row 16 to (19, 16) and up to below the right door Grunt (19, 14)" + }, + { + "id": "talk_right_guard", + "kind": "talk", + "why": "the right door guard" + }, + { + "id": "right_guard", + "kind": "battle", + "declared_after": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 19, + 15 + ] + ] + } + }, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_17): Ekans, Sandshrew, Arbok Lv23 (Arbok's Glare paralysed pokeguy's Wartortle, 59:44)" + }, + { + "id": "beside_giovanni", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "west", + "tiles": 2 + }, + { + "direction": "north", + "tiles": 10 + }, + { + "direction": "east", + "tiles": 2 + } + ], + "why": "a tap a tile: west to (17, 15), up column 17 between the guards (17..18, 12..13) to the wall at (17, 5), and east to below Giovanni (19, 4)" + }, + { + "id": "below_giovanni", + "kind": "route", + "target": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 19, + 5 + ] + ] + } + }, + "variant": "run", + "why": "turn to face Giovanni (19, 4): no tile to walk" + }, + { + "id": "talk_giovanni", + "kind": "talk", + "why": "Giovanni" + }, + { + "id": "giovanni", + "kind": "battle", + "declared_after": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 19, + 5 + ] + ] + } + }, + "why": "Giovanni (TRAINER_BOSS_GIOVANNI): Onix, Rhyhorn, Kangaskhan" + }, + { + "id": "east_of_silph_scope", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "west", + "tiles": 2 + }, + { + "direction": "south", + "tiles": 2 + }, + { + "direction": "east", + "tiles": 4 + }, + { + "direction": "north", + "tiles": 2 + } + ], + "why": "a tap a tile round by row 7: west to (17, 5), down to (17, 7), east to the wall at (21, 7) and up to the wall at (21, 5), east of the SILPH SCOPE (20, 5)" + }, + { + "id": "beside_silph_scope", + "kind": "route", + "target": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "west", + "kind": "tiles", + "tiles": [ + [ + 21, + 5 + ] + ] + } + }, + "variant": "run", + "why": "turn to face the SILPH SCOPE (20, 5): no tile to walk" + }, + { + "id": "silph_scope", + "kind": "talk", + "why": "pick up the SILPH SCOPE (pokeguy 1:02:10)" + }, + { + "id": "escape_rope_hideout", + "kind": "game_action", + "declared_after": { + "certainty": "tile", + "map": "CeladonCity", + "where": { + "facing": "south", + "kind": "tiles", + "tiles": [ + [ + 34, + 22 + ] + ] + } + }, + "variant": "use_item", + "args": { + "item": "escape-rope" + }, + "why": "out to the Game Corner's door (pokeguy 1:02:17)" + } + ] + }, + "execution": { + "menu": "full" + } +}