From b391160b20fb310b3e86604f8236b8e228fcc030 Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 20:36:05 -0800 Subject: [PATCH 01/11] PokemonFRLG: S14a, Cinnabar Gym quiz and Blaine (14.01, 14.02) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldMaps.cpp | 3 + .../PokemonFRLG/PokemonFRLG_Tests.cpp | 1 + ...PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp | 262 ++++++++++++ .../PokemonFRLG_AutoStoryRows_Tests.h | 12 + .../PokemonFRLG_AutoStoryRunPlan_Tests.cpp | 8 +- .../PokemonFRLG_AutoStorySimulation_Tests.cpp | 7 +- .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 12 +- .../AutoStory/StoryData/frlg-14.01.plan.json | 390 ++++++++++++++++++ .../AutoStory/StoryData/frlg-14.02.plan.json | 249 +++++++++++ SerialPrograms/cmake/SourceFiles.cmake | 1 + 10 files changed, 936 insertions(+), 9 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.01.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp index f6d168d32a..8908939e71 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp @@ -99,6 +99,9 @@ constexpr std::string_view MAP_NAMES[] = { "RocketHideout_B2F", "RocketHideout_B3F", "RocketHideout_B4F", + // Cinnabar Island's Center and Blaine's gym, through its quiz doors. + "CinnabarIsland", + "CinnabarIsland_Gym", "CeruleanCave_1F", "CeruleanCave_2F", "CeruleanCave_B1F", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp index a3511b6d22..504affd84f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp @@ -326,6 +326,7 @@ static void add_tests_AutoStoryRows(UnitTestDatabase& database){ add_tests_AutoStoryVermilion(database); add_tests_AutoStoryVermilionGym(database); add_tests_AutoStoryCeladon(database); + add_tests_AutoStoryCinnabarGym(database); } void add_tests(UnitTestDatabase& database){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp new file mode 100644 index 0000000000..447b38459c --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp @@ -0,0 +1,262 @@ +/* AutoStory Cinnabar Gym Tests + * + * From: https://github.com/PokemonAutomation/ + * + * Rows 14.01 and 14.02 (StoryData/frlg-14.01.plan.json, 14.02) on the + * overworld sim: from outside the Pokemon Mansion to Cinnabar's nurse, + * into the gym and through its six quiz doors to below Blaine; and from + * Blaine back out through the doors, past Bill, to the nurse. And the + * lead's attacks against Blaine's party. + * + */ + +#include +#include +#include +#include +#include +#include +#include "Common/Cpp/Exceptions.h" +#include "Common/Cpp/TestRunners/UnitTest.h" +#include "Pokemon/AutoStory/Pokemon_BuiltinStoryActions.h" +#include "Pokemon/AutoStory/Pokemon_StoryStepExecutor.h" +#include "Pokemon/Navigation/Pokemon_MapData.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" +#include "PokemonFRLG_AutoStoryEvents.h" +#include "PokemonFRLG_AutoStoryParty.h" +#include "PokemonFRLG_AutoStoryRooms.h" +#include "PokemonFRLG_AutoStoryRowSim.h" +#include "PokemonFRLG_AutoStoryRows_Tests.h" +#include "PokemonFRLG_AutoStoryTable.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +const std::string GYM = "CinnabarIsland_Gym"; +const std::string CINNABAR = "CinnabarIsland"; + +struct AutoStoryCinnabarGymInput{ + std::string name; + std::function body; +}; + +struct AutoStoryCinnabarGymExpectation{ + std::string_view description; +}; + +struct AutoStoryCinnabarGymCase{ + AutoStoryCinnabarGymInput input; + AutoStoryCinnabarGymExpectation expectation; +}; + +class Test_AutoStoryCinnabarGym : public UnitTest{ +public: + explicit Test_AutoStoryCinnabarGym(AutoStoryCinnabarGymCase test_case) + : UnitTest(std::format("PokemonFRLG::AutoStory - Simulation: {}", test_case.input.name)) + , m_case(std::move(test_case)) + {} + virtual UnitTestResult run(Logger&, CancellableScope&) const override{ + try{ + return m_case.input.body(); + }catch (Exception& e){ + return std::format("{}: {}", e.name(), e.message()); + } + } + +private: + AutoStoryCinnabarGymCase m_case; +}; + +const StoryCheckpoint& checkpoint(std::string_view id){ + for (const StoryCheckpoint& row : story_checkpoints()){ + if (row.id == id){ + return row; + } + } + throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, std::format("No checkpoint {}.", id)); +} + +// The rows on the sim, which can't open the quiz doors (the scripts swap +// their metatiles) or walk into a Center with no map. Kept across sims: +// the trainers fought. +struct GymWalk{ + StoryPose at; + std::optional sim; + std::vector fought; + + explicit GymWalk(StoryPose start) + : at(std::move(start)) + { + place(); + } + // A fresh sim on `at`, after a step it can't walk. + void place(){ + if (sim){ + const std::vector& beaten = sim->state().trainers_beaten; + fought.insert(fought.end(), beaten.begin(), beaten.end()); + } + sim.emplace(story_maps(), MapPosition{at.map, at.tile}, *at.facing); + } + std::vector all_fought() const{ + std::vector all = fought; + const std::vector& beaten = sim->state().trainers_beaten; + all.insert(all.end(), beaten.begin(), beaten.end()); + return all; + } +}; + +// A step of a row on the sim: row_step_on_sim(), but a step through a +// quiz door, the way into the Center and Blaine's battle, which a talk +// starts, leave the player where the table says. +std::string gym_step_on_sim(const StoryStep& step, const std::string& id, GymWalk& walk){ + const bool door = step.kind == StoryStepKind::STEP && (step.name.starts_with("into_door_") || step.name.starts_with("through_door_")); + const bool center = step.action == CENTER_ENTER_VARIANT; + if (door || center || (step.kind == StoryStepKind::BATTLE && step.name == "blaine")){ + walk.at = *story_pose(Pokemon::pose_of(*step.pose_after)); + if (door || center){ + walk.place(); + } + return ""; + } + return row_step_on_sim(*walk.sim, walk.at, step, id); +} + +// Row `id`'s steps on the sim from `walk.at`: the failure, or empty. +std::string row_on_sim(std::string_view id, GymWalk& walk){ + const StoryCheckpoint& row = checkpoint(id); + for (const StoryStep& step : row.steps){ + if (const std::string failure = gym_step_on_sim(step, row.id, walk); !failure.empty()){ + return std::format("{}: ended on {}; {}", id, to_string(walk.sim->state().position), failure); + } + if (!walk.sim->state().violations.empty()){ + return std::format("{}/{}: a violation on the way: {}", id, step.name, walk.sim->state().violations.back()); + } + } + return ""; +} + +// Whether `tile` of the gym is a wall on the map. +bool gym_wall(const TilePos& tile){ + for (const MapData& map : story_maps()){ + if (map.name == GYM){ + return map.tiles.at(tile) == TileKind::WALL; + } + } + throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "No map " + GYM + "."); +} + +Direction behind(Direction direction){ + switch (direction){ + case Direction::NORTH: + return Direction::SOUTH; + case Direction::SOUTH: + return Direction::NORTH; + case Direction::EAST: + return Direction::WEST; + default: + return Direction::EAST; + } +} + +// Each quiz door is shut on the map, one barrier tile, with floor on both +// sides: the tiles 14.01 steps over. +UnitTestResult test_quiz_doors_on_map(){ + const StoryCheckpoint& row = checkpoint("14.01"); + int doors = 0; + for (const StoryStep& step : row.steps){ + if (!step.name.starts_with("into_door_")){ + continue; + } + const StoryPose door = *story_pose(Pokemon::pose_of(*step.pose_after)); + const TilePos before = door.tile.next(behind(*door.facing)); + const TilePos after = door.tile.next(*door.facing); + if (!gym_wall(door.tile) || gym_wall(before) || gym_wall(after)){ + return std::format("{}: expected a barrier on {} between floor tiles.", step.name, to_string(MapPosition{GYM, door.tile})); + } + doors++; + } + return doors == 6 ? UnitTestResult(true) : UnitTestResult(std::format("Expected 6 quiz doors, found {}.", doors)); +} + +// 14.01 from outside the Mansion: the nurse, the gym and its six quiz +// doors, nobody fought, to below Blaine, where 14.02 starts; then 14.02 +// from there out of the gym to the nurse. +UnitTestResult test_gym_rows(){ + GymWalk walk(*story_pose(Pokemon::pose_of(*checkpoint("14.01").start))); + if (const std::string failure = row_on_sim("14.01", walk); !failure.empty()){ + return failure; + } + const MapPosition below_blaine{GYM, {5, 5}}; + if (!(walk.sim->state().position == below_blaine) || walk.sim->state().facing != Direction::NORTH){ + return std::format("14.01: ended on {}, not below Blaine {} facing north.", to_string(walk.sim->state().position), to_string(below_blaine)); + } + if (!walk.all_fought().empty()){ + return "14.01: fought a gym trainer; the quiz is answered instead."; + } + const StoryPose next = *story_pose(Pokemon::pose_of(*checkpoint("14.02").start)); + if (next.map != GYM || !(next.tile == below_blaine.point)){ + return "14.02 doesn't start where 14.01 ends."; + } + if (const std::string failure = row_on_sim("14.02", walk); !failure.empty()){ + return failure; + } + if (!walk.all_fought().empty()){ + return "14.02: fought a gym trainer on the way out."; + } + if (walk.at.map != "CinnabarIsland_PokemonCenter_1F"){ + return std::format("14.02: ended on {}, not at Cinnabar's nurse.", walk.at.map); + } + return true; +} + +// The lead as pokeguy brings it to Blaine: Surf (12.01, over Water Gun), +// Water Pulse, Bite, Mega Kick. It picks Surf against all four of +// Blaine's Fire types. +UnitTestResult test_lead_moves_against_blaine(){ + PartyMember lead; + lead.species = "blastoise"; + lead.moves_read = true; + lead.level = 40; + lead.moves = {{"surf", 15}, {"water-pulse", 20}, {"bite", 25}, {"mega-kick", 5}}; + for (std::string_view foe : {"growlithe", "ponyta", "rapidash", "arcanine"}){ + if (attack_slot_against(lead, {std::string(foe)}) != 0){ + return std::format("Against {}: expected Surf.", foe); + } + } + return true; +} + +const AutoStoryCinnabarGymCase AUTO_STORY_CINNABAR_GYM_CASES[] = { + { + .input = {.name = "Cinnabar Gym's quiz doors are shut on the map", .body = test_quiz_doors_on_map}, + .expectation = {.description = "each of 14.01's door steps crosses one barrier tile between floor"}, + }, + { + .input = {.name = "14.01 through the quiz to below Blaine and 14.02 back to the nurse", .body = test_gym_rows}, + .expectation = {.description = "no gym trainer fought; ends at Cinnabar's nurse"}, + }, + { + .input = {.name = "the lead's attacks against Blaine", .body = test_lead_moves_against_blaine}, + .expectation = {.description = "Surf against each Fire type"}, + }, +}; + +} // namespace + + +void add_tests_AutoStoryCinnabarGym(UnitTestDatabase& database){ + for (const auto& item : AUTO_STORY_CINNABAR_GYM_CASES){ + database.add(item); + } +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h index 6b15acaab2..702d6ba2f0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h @@ -10,6 +10,7 @@ #ifndef PokemonAutomation_PokemonFRLG_AutoStoryRows_Tests_H #define PokemonAutomation_PokemonFRLG_AutoStoryRows_Tests_H +#include #include "Common/Cpp/TestRunners/UnitTestDatabase.h" namespace PokemonAutomation{ @@ -26,6 +27,17 @@ void add_tests_AutoStoryVermilionGym(UnitTestDatabase& database); void add_tests_AutoStoryCeladon(UnitTestDatabase& database); // Rows from 08.01 on on the overworld sim (PokemonFRLG_AutoStoryLavender_Tests.cpp). void add_tests_AutoStoryLavender(UnitTestDatabase& database); +// Rows 14.01 and 14.02, Cinnabar Gym, on the overworld sim (PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp). +void add_tests_AutoStoryCinnabarGym(UnitTestDatabase& database); + +// Whether checkpoint `id` was authored before the rows that lead up to it: +// it starts from its own declared pose, not where the row before it in +// the table ends. 14.01 starts outside the Pokemon Mansion, after its Escape Rope +// (13.04); segments 10 to 13 are authored separately. An id leaves +// this list once the rows before it are in. +inline bool starts_after_unauthored_rows(std::string_view id){ + return id == "14.01"; +} } // namespace PokemonFRLG 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 1bfb846f94..a09d3c3d10 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp @@ -139,7 +139,7 @@ class Test_RunPlan : public UnitTest{ const RunPlanScenario m_scenario; }; -const std::string TODAY = "01.01 01.03 01.04 01.05 02.01 02.02 02.03 03.01 03.02 03.03 04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"; +const std::string TODAY = "01.01 01.03 01.04 01.05 02.01 02.02 02.03 03.01 03.02 03.03 04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 14.01 14.02"; const RunPlanScenario RUN_PLAN_CASES[] = { { @@ -230,11 +230,11 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Gift RNG off: 04.03 is passed over", .first = "04.01"}, - .expectation = {.expected_ids = "04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"}, + .expectation = {.expected_ids = "04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 14.01 14.02"}, }, { .input = {.name = "Gift RNG off: 04.03 runs when started at", .first = "04.03"}, - .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"}, + .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 14.01 14.02"}, }, { .input = { .name = "Gift RNG: started at 04.03, from the save beside the salesman", @@ -259,7 +259,7 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Starter RNG alone: 04.03 runs when started at", .first = "04.03", .handoffs = {.starter_rng = true}}, - .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"}, + .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 14.01 14.02"}, }, { .input = { .name = "Starter RNG first, with both on", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp index 6a3d5e0278..dc4c899f6c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp @@ -36,6 +36,7 @@ #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryPaceSim.h" #include "PokemonFRLG_AutoStoryRowSim.h" +#include "PokemonFRLG_AutoStoryRows_Tests.h" #include "PokemonFRLG_AutoStoryStepTable.h" #include "PokemonFRLG_AutoStoryTable.h" @@ -224,9 +225,13 @@ UnitTestResult test_whole_story(){ if (sim.begun() != ids || sim.saves.size() != ids.size()){ return "Expected each checkpoint once, in order, each saving at its end:" + joined(sim.game.trace); } - // Each checkpoint starts where the save before it stands. + // Each checkpoint starts where the save before it stands, but one + // authored before the rows that lead up to it. for (size_t c = 1; c < sim.rows.size(); c++){ const StoryCheckpoint& data = sim.rows[c]; + if (starts_after_unauthored_rows(data.id)){ + continue; + } const std::optional start = story_pose(*start_pose(data)); const std::optional saved = story_pose(sim.saves[c - 1].second); const bool same = start && saved && start->map == saved->map && start->tile == saved->tile 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 0a5f768539..0878014331 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -32,6 +32,7 @@ #include "PokemonFRLG_AutoStoryGrind.h" #include "PokemonFRLG_AutoStoryPcStorage.h" #include "PokemonFRLG_AutoStoryPlanGolden.h" +#include "PokemonFRLG_AutoStoryRows_Tests.h" #include "PokemonFRLG_AutoStoryMoveData.h" #include "PokemonFRLG_AutoStoryStepTable.h" #include "PokemonFRLG_AutoStoryTable.h" @@ -275,16 +276,19 @@ UnitTestResult check_checkpoint(const StoryCheckpoint& checkpoint, StoryPose& po } // Plans every route of the story, each checkpoint from where the one -// before leaves the player, and adds the plans to `golden`. +// before leaves the player (or, past rows not authored yet, from its own +// start: starts_after_unauthored_rows()), and adds the plans to `golden`. UnitTestResult chain_story_routes(std::vector& golden){ const std::vector& checkpoints = story_checkpoints(); - if (checkpoints.size() != 39 || checkpoints[0].start){ - return "Expected 39 checkpoints, the first from a new game."; + if (checkpoints.size() != 41 || checkpoints[0].start){ + return "Expected 41 checkpoints, the first from a new game."; } StoryPose pose; for (size_t c = 0; c < checkpoints.size(); c++){ const StoryCheckpoint& checkpoint = checkpoints[c]; - if (c > 0){ + if (c > 0 && starts_after_unauthored_rows(checkpoint.id)){ + pose = one_tile(Pokemon::grid_pose_of(*checkpoint.start)); + }else if (c > 0){ const StoryPose start = one_tile(Pokemon::grid_pose_of(*checkpoint.start)); const bool same_facing = !start.facing || start.facing == pose.facing; if (start.map != pose.map || !(start.tile == pose.tile) || !same_facing){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.01.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.01.plan.json new file mode 100644 index 0000000000..c9073529c0 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.01.plan.json @@ -0,0 +1,390 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "14.01", + "title": "Cinnabar: heal, the gym's six quiz machines (YES, NO, NO, NO, YES, NO) to below Blaine", + "start": {"map": "CinnabarIsland", "tiles": [[8, 4]], "facing": "south"}, + "events": [ + { + "id": "below_center_door", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland", "tiles": [[14, 12]], "facing": "north"} + }, + "why": "from outside the Mansion's door (8, 3), where the Escape Rope out of the Mansion leaves the player, east and down to below the Center's door (14, 11)" + }, + { + "id": "cinnabar_nurse", + "kind": "game_action", + "action": "center_enter", + "declared_after": {"map": "CinnabarIsland_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, + "why": "the Center script in: through the door and up to the nurse; no map of the Center" + }, + { + "id": "heal_cinnabar", + "kind": "heal", + "why": "full HP and PP before the gym (pokeguy skips the Center; healing is the safe side)" + }, + { + "id": "below_quiz_1", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[23, 11]], "facing": "north"} + }, + "why": "out of the Center, up to the gym's door (20, 4), unlocked by the SECRET KEY (CinnabarIsland_EventScript_CheckUnlockGym), and in the gym (no running) from the mat (25, 23) up the east rooms to below quiz machine 1 (22..23, 10), west of Burglar Quinn (25, 11)" + }, + { + "id": "quiz_1", + "kind": "talk", + "why": "quiz machine 1 (23, 10) and its neighbour, read facing north (CinnabarIsland_Gym_EventScript_Quiz1Left/Right)" + }, + { + "id": "answer_quiz_1", + "kind": "answer", + "args": { + "yes": true + }, + "why": "\"CATERPIE evolves into METAPOD?\" YES (pokeguy 1:20:37; Quiz1Correct on YES)" + }, + { + "id": "door_1_opens", + "kind": "scene", + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[23, 11]], "facing": "north"}, + "why": "\"Correct! Go on through!\"; door 1 opens (CinnabarIsland_Gym_EventScript_OpenDoor1); the player doesn't move" + }, + { + "id": "below_door_1", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[26, 10]], "facing": "north"} + }, + "why": "east along row 10 to below door 1 (26..27, 8..9)" + }, + { + "id": "into_door_1", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[26, 9]], "facing": "north"}, + "why": "a step onto door 1's floor (26, 9): the map still has the barrier there, so no planned route over it" + }, + { + "id": "through_door_1", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[26, 8]], "facing": "north"}, + "why": "a step through door 1 onto (26, 8)" + }, + { + "id": "below_quiz_2", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[16, 3]], "facing": "north"} + }, + "why": "west through the top room, above Super Nerd Erik (25, 4) and Avery (17, 5), to below quiz machine 2 (15..16, 2)" + }, + { + "id": "quiz_2", + "kind": "talk", + "why": "quiz machine 2 (16, 2) and its neighbour, read facing north (CinnabarIsland_Gym_EventScript_Quiz2Left/Right)" + }, + { + "id": "answer_quiz_2", + "kind": "answer", + "args": { + "yes": false + }, + "why": "\"There are nine certified POKeMON LEAGUE BADGES?\" NO (Quiz2Correct on NO)" + }, + { + "id": "door_2_opens", + "kind": "scene", + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[16, 3]], "facing": "north"}, + "why": "\"Correct! Go on through!\"; door 2 opens (CinnabarIsland_Gym_EventScript_OpenDoor2); the player doesn't move" + }, + { + "id": "above_door_2", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[17, 8]], "facing": "south"} + }, + "why": "down to above door 2 (17..18, 8..9), west of Avery" + }, + { + "id": "into_door_2", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 9]], "facing": "south"}, + "why": "a step onto door 2's floor (17, 9), a barrier on the map" + }, + { + "id": "through_door_2", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 10]], "facing": "south"}, + "why": "a step through door 2 onto (17, 10)" + }, + { + "id": "below_quiz_3", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[14, 11]], "facing": "north"} + }, + "why": "west along row 11 past Burglar Ramon (16, 11) to below quiz machine 3 (13..14, 10)" + }, + { + "id": "quiz_3", + "kind": "talk", + "why": "quiz machine 3 (14, 10) and its neighbour, read facing north (CinnabarIsland_Gym_EventScript_Quiz3Left/Right)" + }, + { + "id": "answer_quiz_3", + "kind": "answer", + "args": { + "yes": false + }, + "why": "\"POLIWAG evolves 3 times?\" NO (Quiz3Correct on NO)" + }, + { + "id": "door_3_opens", + "kind": "scene", + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[14, 11]], "facing": "north"}, + "why": "\"Correct! Go on through!\"; door 3 opens (CinnabarIsland_Gym_EventScript_OpenDoor3); the player doesn't move" + }, + { + "id": "above_door_3", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[17, 15]], "facing": "south"} + }, + "why": "east and down to above door 3 (17..18, 15..16)" + }, + { + "id": "into_door_3", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 16]], "facing": "south"}, + "why": "a step onto door 3's floor (17, 16), a barrier on the map" + }, + { + "id": "through_door_3", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 17]], "facing": "south"}, + "why": "a step through door 3 onto (17, 17)" + }, + { + "id": "below_quiz_4", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[14, 18]], "facing": "north"} + }, + "why": "west along row 18, past Super Nerd Derek (16, 18), to below quiz machine 4 (13..14, 17)" + }, + { + "id": "quiz_4", + "kind": "talk", + "why": "quiz machine 4 (14, 17) and its neighbour, read facing north (CinnabarIsland_Gym_EventScript_Quiz4Left/Right)" + }, + { + "id": "answer_quiz_4", + "kind": "answer", + "args": { + "yes": false + }, + "why": "\"Are thunder moves effective against ground element-type POKeMON?\" NO (Quiz4Correct on NO)" + }, + { + "id": "door_4_opens", + "kind": "scene", + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[14, 18]], "facing": "north"}, + "why": "\"Correct! Go on through!\"; door 4 opens (CinnabarIsland_Gym_EventScript_OpenDoor4); the player doesn't move" + }, + { + "id": "east_of_door_4", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[12, 22]], "facing": "west"} + }, + "why": "down column 12 to east of door 4 (11, 21..23)" + }, + { + "id": "into_door_4", + "kind": "step", + "args": { + "direction": "west" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[11, 22]], "facing": "west"}, + "why": "a step onto door 4's floor (11, 22), a barrier on the map" + }, + { + "id": "through_door_4", + "kind": "step", + "args": { + "direction": "west" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[10, 22]], "facing": "west"}, + "why": "a step through door 4 onto (10, 22)" + }, + { + "id": "below_quiz_5", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[2, 19]], "facing": "north"} + }, + "why": "west through the bottom-left room, past Burglar Dusty (4, 19), to below quiz machine 5 (1..2, 18)" + }, + { + "id": "quiz_5", + "kind": "talk", + "why": "quiz machine 5 (2, 18) and its neighbour, read facing north (CinnabarIsland_Gym_EventScript_Quiz5Left/Right)" + }, + { + "id": "answer_quiz_5", + "kind": "answer", + "args": { + "yes": true + }, + "why": "\"POKeMON of the same kind and level are not identical?\" YES (Quiz5Correct on YES)" + }, + { + "id": "door_5_opens", + "kind": "scene", + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[2, 19]], "facing": "north"}, + "why": "\"Correct! Go on through!\"; door 5 opens (CinnabarIsland_Gym_EventScript_OpenDoor5); the player doesn't move" + }, + { + "id": "below_door_5", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[5, 18]], "facing": "north"} + }, + "why": "east along row 18 to below door 5 (5..6, 16..17)" + }, + { + "id": "into_door_5", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 17]], "facing": "north"}, + "why": "a step onto door 5's floor (5, 17), a barrier on the map" + }, + { + "id": "through_door_5", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 16]], "facing": "north"}, + "why": "a step through door 5 onto (5, 16)" + }, + { + "id": "below_quiz_6", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[2, 11]], "facing": "north"} + }, + "why": "up and west to below quiz machine 6 (1..2, 10), west of Super Nerd Zac (4, 11)" + }, + { + "id": "quiz_6", + "kind": "talk", + "why": "quiz machine 6 (2, 10) and its neighbour, read facing north (CinnabarIsland_Gym_EventScript_Quiz6Left/Right)" + }, + { + "id": "answer_quiz_6", + "kind": "answer", + "args": { + "yes": false + }, + "why": "\"TM28 contains TOMBSTONY?\" NO (Quiz6Correct on NO)" + }, + { + "id": "door_6_opens", + "kind": "scene", + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[2, 11]], "facing": "north"}, + "why": "\"Correct! Go on through!\"; door 6 opens (CinnabarIsland_Gym_EventScript_OpenDoor6); the player doesn't move" + }, + { + "id": "below_door_6", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[5, 10]], "facing": "north"} + }, + "why": "east to below door 6 (5..6, 8..9)" + }, + { + "id": "into_door_6", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 9]], "facing": "north"}, + "why": "a step onto door 6's floor (5, 9), a barrier on the map" + }, + { + "id": "through_door_6", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 8]], "facing": "north"}, + "why": "a step through door 6 onto (5, 8)" + }, + { + "id": "below_blaine", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[5, 5]], "facing": "north"} + }, + "why": "up to below Blaine (5, 4), facing him" + } + ] + }, + "execution": { + "menu": "full", + "notes": { + "checkpoint": [ + "Starts outside the Pokemon Mansion's door (8, 3) on (8, 4) facing south, where the Escape Rope out of the Mansion (13.04, pokeguy 1:20:24) leaves the player. 13.04 is authored separately; until it is in, this row's start is its own (starts_after_unauthored_rows()).", + "PokeGuy's way (1:20:37 to 1:21:43): all six quiz machines answered right, each opening the next door, so none of the gym's eight trainers is fought. Answers (pokefirered CinnabarIsland_Gym scripts.inc): 1 YES, 2 NO, 3 NO, 4 NO, 5 YES, 6 NO. A wrong answer starts the room's trainer instead; the table has no branch for that.", + "Every gym trainer has sight 0 (map.json trainer_sight_or_berry_tree_id): they fight only after a wrong answer or a talk, so no trainer lines here.", + "The doors are metatiles the quiz scripts swap (setmetatile in OpenDoorN); the map has them shut, one barrier tile each. Each is crossed by two plain steps with their ends declared, not a planned route. On the sim they need the door opened (no sim support yet: the test moves the player over them).", + "We heal at Cinnabar's Center first; pokeguy doesn't (he fights Blaine at 24/126 HP with one Surf each).", + "Ends in front of Blaine and saves there: his own pre-battle checkpoint (battle-checkpoint-retry), 14.02." + ] + } + }, + "metadata": { + "phase": "testing", + "postconditions": { + "position": {"map": "CinnabarIsland_Gym", "tiles": [[5, 5]], "facing": "north"} + } + } +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json new file mode 100644 index 0000000000..02f9579287 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json @@ -0,0 +1,249 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "14.02", + "title": "Blaine, the VOLCANOBADGE; out through the quiz doors, NO to Bill, heal at Cinnabar's Center", + "start": {"map": "CinnabarIsland_Gym", "tiles": [[5, 5]], "facing": "north"}, + "events": [ + { + "id": "challenge_blaine", + "kind": "talk", + "why": "Blaine (5, 4)" + }, + { + "id": "blaine", + "kind": "battle", + "args": { + "trainer": "TRAINER_LEADER_BLAINE", + "foes": ["growlithe", "ponyta", "rapidash", "arcanine"] + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 5]], "facing": "north"}, + "why": "Blaine (TRAINER_LEADER_BLAINE): Growlithe Lv42, Ponyta Lv40, Rapidash Lv42, Arcanine Lv47 (pokeguy: one Surf each, 1:21:44 to 1:23:09); then the VOLCANOBADGE and TM38 Fire Blast, read to the overworld with the battle's text" + }, + { + "id": "above_door_6", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[5, 8]], "facing": "south"} + }, + "why": "down to above door 6, open since quiz 6" + }, + { + "id": "into_door_6", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 9]], "facing": "south"}, + "why": "a step onto door 6's floor (5, 9), a barrier on the map" + }, + { + "id": "through_door_6", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 10]], "facing": "south"}, + "why": "a step through door 6 onto (5, 10)" + }, + { + "id": "above_door_5", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[5, 16]], "facing": "south"} + }, + "why": "down to above door 5" + }, + { + "id": "into_door_5", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 17]], "facing": "south"}, + "why": "a step onto door 5's floor (5, 17)" + }, + { + "id": "through_door_5", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 18]], "facing": "south"}, + "why": "a step through door 5 onto (5, 18)" + }, + { + "id": "west_of_door_4", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[10, 22]], "facing": "east"} + }, + "why": "down and east to west of door 4" + }, + { + "id": "into_door_4", + "kind": "step", + "args": { + "direction": "east" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[11, 22]], "facing": "east"}, + "why": "a step onto door 4's floor (11, 22)" + }, + { + "id": "through_door_4", + "kind": "step", + "args": { + "direction": "east" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[12, 22]], "facing": "east"}, + "why": "a step through door 4 onto (12, 22)" + }, + { + "id": "below_door_3", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[17, 17]], "facing": "north"} + }, + "why": "up and east to below door 3" + }, + { + "id": "into_door_3", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 16]], "facing": "north"}, + "why": "a step onto door 3's floor (17, 16)" + }, + { + "id": "through_door_3", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 15]], "facing": "north"}, + "why": "a step through door 3 onto (17, 15)" + }, + { + "id": "below_door_2", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[17, 10]], "facing": "north"} + }, + "why": "up to below door 2" + }, + { + "id": "into_door_2", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 9]], "facing": "north"}, + "why": "a step onto door 2's floor (17, 9)" + }, + { + "id": "through_door_2", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 8]], "facing": "north"}, + "why": "a step through door 2 onto (17, 8)" + }, + { + "id": "above_door_1", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[26, 8]], "facing": "south"} + }, + "why": "east through the top room to above door 1" + }, + { + "id": "into_door_1", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[26, 9]], "facing": "south"}, + "why": "a step onto door 1's floor (26, 9)" + }, + { + "id": "through_door_1", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[26, 10]], "facing": "south"}, + "why": "a step through door 1 onto (26, 10)" + }, + { + "id": "below_gym_door", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland", "tiles": [[20, 5]], "facing": "south"} + }, + "why": "down the east rooms to the mat (25, 23) and out of the gym's door (20, 4)" + }, + { + "id": "decline_bill", + "kind": "answer", + "args": { + "yes": false + }, + "why": "Bill walks up from (20, 7) (CinnabarIsland_EventScript_BillScene, VAR_MAP_SCENE_CINNABAR_ISLAND 1 after Blaine): \"come with me to ONE ISLAND?\" NO (pokeguy 1:23:10 to 1:23:44)" + }, + { + "id": "bill_leaves", + "kind": "scene", + "declared_after": {"map": "CinnabarIsland", "tiles": [[20, 5]], "facing": "south"}, + "why": "\"I'll be waiting in the POKeMON CENTER\"; he walks off to the Center and is removed" + }, + { + "id": "below_center_door", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland", "tiles": [[14, 12]], "facing": "north"} + }, + "why": "west and down to below the Center's door (14, 11)" + }, + { + "id": "cinnabar_nurse", + "kind": "game_action", + "action": "center_enter", + "declared_after": {"map": "CinnabarIsland_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, + "why": "the Center script in: through the door and up to the nurse; no map of the Center. Bill stands in the Center now (FLAG_HIDE_CINNABAR_POKECENTER_BILL cleared), off the way to the nurse" + }, + { + "id": "heal_cinnabar", + "kind": "heal", + "why": "full HP and PP" + } + ] + }, + "execution": { + "menu": "full", + "notes": { + "checkpoint": [ + "Blaine (5, 4), talked to from below, from the save in front of him (14.01): Growlithe Lv42, Ponyta Lv40, Rapidash Lv42, Arcanine Lv47 (sParty_LeaderBlaine); then the VOLCANOBADGE and TM38 Fire Blast. The lead's Surf (taught in 12.01) is 2x on all four.", + "Out the way in: the quiz doors stay open while the player is in the gym (the flags are set and OnLoad reopens them), each crossed by two plain steps as in 14.01.", + "Outside, Bill's scene runs on the first frame (VAR_MAP_SCENE_CINNABAR_ISLAND 1, set by Blaine's win): NO to the Sevii trip, as pokeguy. He walks to the Center and waits there; the Center visit here doesn't talk to him.", + "Ends at Cinnabar's nurse. PokeGuy flies to Celadon from outside the gym (1:23:45); 14.03 starts from Fly's landing in Celadon, so the Fly (a step type in #406) goes at 14.03's start or here once it is in." + ] + } + }, + "metadata": { + "phase": "testing", + "postconditions": { + "position": {"map": "CinnabarIsland_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"} + } + } +} diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 6be5941899..408a4e5817 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -2048,6 +2048,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCaptureTurns.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp From 1a0e9351b5a70ef6a786a7f2eb40e81bd86e87ce Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 20:36:28 -0800 Subject: [PATCH 02/11] fixup: unused constant --- .../AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp index 447b38459c..705f2d7911 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp @@ -38,7 +38,6 @@ namespace PokemonFRLG{ namespace{ const std::string GYM = "CinnabarIsland_Gym"; -const std::string CINNABAR = "CinnabarIsland"; struct AutoStoryCinnabarGymInput{ std::string name; From 28ee2d317015e973599ac41db177c331622b1c28 Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 20:38:22 -0800 Subject: [PATCH 03/11] PokemonFRLG: Cinnabar Island's save card place; S14a route golden --- .../Menus/PokemonFRLG_SaveCardReader.cpp | 1 + .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 1 + .../PokemonFRLG_AutoStoryPlanGolden.h | 92 +++++++++++++++++++ 3 files changed, 94 insertions(+) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp index 3933913e12..1c9d00f688 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp @@ -80,6 +80,7 @@ class PlaceNameMatcher : public OCR::SmallDictionaryMatcher{ {"vermilion-city", "Vermilion City"}, {"celadon-city", "Celadon City"}, {"rocket-hideout", "Rocket Hideout"}, + {"cinnabar-island", "Cinnabar Island"}, }){ JsonArray names; names.push_back(std::string(name)); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index fff6d558f3..fcaff7ce04 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -357,6 +357,7 @@ std::string save_card_place(const std::string& map){ {"LavenderTown", "lavender-town"}, {"CeladonCity", "celadon-city"}, {"RocketHideout", "rocket-hideout"}, + {"CinnabarIsland", "cinnabar-island"}, }; for (const auto& [prefix, place] : PLACES){ if (map == prefix || map.rfind(prefix + "_", 0) == 0){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden.h index 4cd5d9abe1..5602352f27 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden.h @@ -849,6 +849,98 @@ inline constexpr std::string_view FRLG_PLAN_GOLDEN[] = { "09.02 face north -> RocketHideout_B4F (19, 5)", "09.02 face_silph_scope from RocketHideout_B4F (19, 5) facing south to RocketHideout_B4F (19, 5) facing east", "09.02 face east -> RocketHideout_B4F (19, 5)", + "14.01 below_center_door from CinnabarIsland (8, 4) facing south to CinnabarIsland (14, 12) facing north", + "14.01 walk east 10 (to wall) -> CinnabarIsland (18, 4)", + "14.01 walk south 4 (to wall) -> CinnabarIsland (18, 8)", + "14.01 walk east 4 (to wall) -> CinnabarIsland (22, 8)", + "14.01 walk south 4 -> CinnabarIsland (22, 12)", + "14.01 walk west 8 -> CinnabarIsland (14, 12)", + "14.01 face north -> CinnabarIsland (14, 12)", + "14.01 below_quiz_1 from CinnabarIsland_PokemonCenter_1F (7, 4) facing north to CinnabarIsland_Gym (23, 11) facing north", + "14.01 walk south 5 (warp) -> CinnabarIsland (14, 12) [walk only]", + "14.01 walk east 7 -> CinnabarIsland (21, 12)", + "14.01 walk north 7 (to wall) -> CinnabarIsland (21, 5)", + "14.01 walk west 1 -> CinnabarIsland (20, 5)", + "14.01 walk north 1 (warp) -> CinnabarIsland_Gym (25, 23)", + "14.01 walk north 7 (to wall) -> CinnabarIsland_Gym (25, 16) [walk only]", + "14.01 walk east 3 (to wall) -> CinnabarIsland_Gym (28, 16) [walk only]", + "14.01 walk north 4 -> CinnabarIsland_Gym (28, 12) [walk only]", + "14.01 walk west 5 -> CinnabarIsland_Gym (23, 12) [walk only]", + "14.01 walk north 1 (to wall) -> CinnabarIsland_Gym (23, 11) [walk only]", + "14.01 below_door_1 from CinnabarIsland_Gym (23, 11) facing north to CinnabarIsland_Gym (26, 10) facing north", + "14.01 walk south 2 (to wall) -> CinnabarIsland_Gym (23, 13) [walk only]", + "14.01 walk east 3 -> CinnabarIsland_Gym (26, 13) [walk only]", + "14.01 walk north 3 (to wall) -> CinnabarIsland_Gym (26, 10) [walk only]", + "14.01 below_quiz_2 from CinnabarIsland_Gym (26, 8) facing north to CinnabarIsland_Gym (16, 3) facing north", + "14.01 walk north 5 -> CinnabarIsland_Gym (26, 3) [walk only]", + "14.01 walk west 10 -> CinnabarIsland_Gym (16, 3) [walk only]", + "14.01 face north -> CinnabarIsland_Gym (16, 3) [walk only]", + "14.01 above_door_2 from CinnabarIsland_Gym (16, 3) facing north to CinnabarIsland_Gym (17, 8) facing south", + "14.01 walk south 4 (to wall) -> CinnabarIsland_Gym (16, 7) [walk only]", + "14.01 walk east 1 -> CinnabarIsland_Gym (17, 7) [walk only]", + "14.01 walk south 1 (to wall) -> CinnabarIsland_Gym (17, 8) [walk only]", + "14.01 below_quiz_3 from CinnabarIsland_Gym (17, 10) facing south to CinnabarIsland_Gym (14, 11) facing north", + "14.01 walk south 2 -> CinnabarIsland_Gym (17, 12) [walk only]", + "14.01 walk west 3 -> CinnabarIsland_Gym (14, 12) [walk only]", + "14.01 walk north 1 (to wall) -> CinnabarIsland_Gym (14, 11) [walk only]", + "14.01 above_door_3 from CinnabarIsland_Gym (14, 11) facing north to CinnabarIsland_Gym (17, 15) facing south", + "14.01 walk south 3 (to wall) -> CinnabarIsland_Gym (14, 14) [walk only]", + "14.01 walk east 3 -> CinnabarIsland_Gym (17, 14) [walk only]", + "14.01 walk south 1 (to wall) -> CinnabarIsland_Gym (17, 15) [walk only]", + "14.01 below_quiz_4 from CinnabarIsland_Gym (17, 17) facing south to CinnabarIsland_Gym (14, 18) facing north", + "14.01 walk south 2 -> CinnabarIsland_Gym (17, 19) [walk only]", + "14.01 walk west 3 -> CinnabarIsland_Gym (14, 19) [walk only]", + "14.01 walk north 1 (to wall) -> CinnabarIsland_Gym (14, 18) [walk only]", + "14.01 east_of_door_4 from CinnabarIsland_Gym (14, 18) facing north to CinnabarIsland_Gym (12, 22) facing west", + "14.01 walk south 5 (to wall) -> CinnabarIsland_Gym (14, 23) [walk only]", + "14.01 walk west 2 (to wall) -> CinnabarIsland_Gym (12, 23) [walk only]", + "14.01 walk north 1 (to wall) -> CinnabarIsland_Gym (12, 22) [walk only]", + "14.01 face west -> CinnabarIsland_Gym (12, 22) [walk only]", + "14.01 below_quiz_5 from CinnabarIsland_Gym (10, 22) facing west to CinnabarIsland_Gym (2, 19) facing north", + "14.01 walk west 8 -> CinnabarIsland_Gym (2, 22) [walk only]", + "14.01 walk north 3 (to wall) -> CinnabarIsland_Gym (2, 19) [walk only]", + "14.01 below_door_5 from CinnabarIsland_Gym (2, 19) facing north to CinnabarIsland_Gym (5, 18) facing north", + "14.01 walk south 4 (to wall) -> CinnabarIsland_Gym (2, 23) [walk only]", + "14.01 walk east 3 -> CinnabarIsland_Gym (5, 23) [walk only]", + "14.01 walk north 5 (to wall) -> CinnabarIsland_Gym (5, 18) [walk only]", + "14.01 below_quiz_6 from CinnabarIsland_Gym (5, 16) facing north to CinnabarIsland_Gym (2, 11) facing north", + "14.01 walk north 4 -> CinnabarIsland_Gym (5, 12) [walk only]", + "14.01 walk west 3 -> CinnabarIsland_Gym (2, 12) [walk only]", + "14.01 walk north 1 (to wall) -> CinnabarIsland_Gym (2, 11) [walk only]", + "14.01 below_door_6 from CinnabarIsland_Gym (2, 11) facing north to CinnabarIsland_Gym (5, 10) facing north", + "14.01 walk south 4 (to wall) -> CinnabarIsland_Gym (2, 15) [walk only]", + "14.01 walk east 3 -> CinnabarIsland_Gym (5, 15) [walk only]", + "14.01 walk north 5 (to wall) -> CinnabarIsland_Gym (5, 10) [walk only]", + "14.01 below_blaine from CinnabarIsland_Gym (5, 8) facing north to CinnabarIsland_Gym (5, 5) facing north", + "14.01 walk north 3 -> CinnabarIsland_Gym (5, 5) [walk only]", + "14.02 above_door_6 from CinnabarIsland_Gym (5, 5) facing north to CinnabarIsland_Gym (5, 8) facing south", + "14.02 walk south 3 (to wall) -> CinnabarIsland_Gym (5, 8) [walk only]", + "14.02 above_door_5 from CinnabarIsland_Gym (5, 10) facing south to CinnabarIsland_Gym (5, 16) facing south", + "14.02 walk south 6 (to wall) -> CinnabarIsland_Gym (5, 16) [walk only]", + "14.02 west_of_door_4 from CinnabarIsland_Gym (5, 18) facing south to CinnabarIsland_Gym (10, 22) facing east", + "14.02 walk south 5 (to wall) -> CinnabarIsland_Gym (5, 23) [walk only]", + "14.02 walk east 5 (to wall) -> CinnabarIsland_Gym (10, 23) [walk only]", + "14.02 walk north 1 (to wall) -> CinnabarIsland_Gym (10, 22) [walk only]", + "14.02 face east -> CinnabarIsland_Gym (10, 22) [walk only]", + "14.02 below_door_3 from CinnabarIsland_Gym (12, 22) facing east to CinnabarIsland_Gym (17, 17) facing north", + "14.02 walk east 5 -> CinnabarIsland_Gym (17, 22) [walk only]", + "14.02 walk north 5 (to wall) -> CinnabarIsland_Gym (17, 17) [walk only]", + "14.02 below_door_2 from CinnabarIsland_Gym (17, 15) facing north to CinnabarIsland_Gym (17, 10) facing north", + "14.02 walk north 5 (to wall) -> CinnabarIsland_Gym (17, 10) [walk only]", + "14.02 above_door_1 from CinnabarIsland_Gym (17, 8) facing north to CinnabarIsland_Gym (26, 8) facing south", + "14.02 walk east 1 (to wall) -> CinnabarIsland_Gym (18, 8) [walk only]", + "14.02 walk north 6 (to wall) -> CinnabarIsland_Gym (18, 2) [walk only]", + "14.02 walk east 8 -> CinnabarIsland_Gym (26, 2) [walk only]", + "14.02 walk south 6 (to wall) -> CinnabarIsland_Gym (26, 8) [walk only]", + "14.02 below_gym_door from CinnabarIsland_Gym (26, 10) facing south to CinnabarIsland (20, 5) facing south", + "14.02 walk south 13 (to wall) -> CinnabarIsland_Gym (26, 23) [walk only]", + "14.02 walk west 1 -> CinnabarIsland_Gym (25, 23) [walk only]", + "14.02 walk south 1 (warp) -> CinnabarIsland (20, 5) [walk only]", + "14.02 below_center_door from CinnabarIsland (20, 5) facing south to CinnabarIsland (14, 12) facing north", + "14.02 walk east 1 (to wall) -> CinnabarIsland (21, 5)", + "14.02 walk south 7 -> CinnabarIsland (21, 12)", + "14.02 walk west 7 -> CinnabarIsland (14, 12)", + "14.02 face north -> CinnabarIsland (14, 12)", }; } // namespace PokemonFRLG From 6cd6da6ca4f70b56fb3568d54ea62ca92804eec5 Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 20:39:25 -0800 Subject: [PATCH 04/11] PokemonFRLG: Cinnabar Gym test message with std::format --- .../AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp index 705f2d7911..a07bd2fee7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp @@ -146,7 +146,7 @@ bool gym_wall(const TilePos& tile){ return map.tiles.at(tile) == TileKind::WALL; } } - throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "No map " + GYM + "."); + throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, std::format("No map {}.", GYM)); } Direction behind(Direction direction){ From fa7f838eb920a008e66c3b4bbe46ac799838afe8 Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 21:06:59 -0800 Subject: [PATCH 05/11] PokemonFRLG: 14.02 checks the lead is at least pokeguy's Lv40 before Blaine A LEVEL step on the lead before the fight. pokeguy's Blastoise is Lv40 here, and PokemonSimulation's docs/battles/pokeguy-conditions.md sims that entry (B recovery, 24/126 HP: 100/100 wins); at his level or above those sims stand for this fight, below it the run stops before the fight. A sim test runs the step with a Lv40 and a Lv39 lead. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- ...PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp | 47 +++++++++++++++++++ .../AutoStory/StoryData/frlg-14.02.plan.json | 7 +++ 2 files changed, 54 insertions(+) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp index a07bd2fee7..ef0db5a2b8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp @@ -26,6 +26,7 @@ #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryParty.h" #include "PokemonFRLG_AutoStoryRooms.h" +#include "PokemonFRLG_AutoStoryMember.h" #include "PokemonFRLG_AutoStoryRowSim.h" #include "PokemonFRLG_AutoStoryRows_Tests.h" #include "PokemonFRLG_AutoStoryTable.h" @@ -230,6 +231,45 @@ UnitTestResult test_lead_moves_against_blaine(){ return true; } +class QuietLogger : public Logger{ +public: + using Logger::log; + virtual void log(const std::string&, Color) override{} +}; + +// Battle checkpoint `id`'s precondition: a LEVEL step on the lead before +// its battle `battle`, at least `pokeguy`, pokeguy's level there (whose +// sims stand for the fight at that level or above). A lead at that level +// passes it; one a level below stops the checkpoint before the fight. +UnitTestResult check_lead_level_precondition(Logger& logger, std::string_view id, std::string_view battle, unsigned pokeguy){ + std::optional check; + for (const StoryStep& step : checkpoint(id).steps){ + if (step.kind == StoryStepKind::BATTLE && step.name == battle){ + break; + } + if (step.action == LEVEL_ACTION){ + check = level_check_of(step.args); + } + } + if (!check || check->slot != 0 || check->level != pokeguy){ + return std::format("{}: expected a LEVEL step on the lead, at least Lv{}, before {}.", id, pokeguy, battle); + } + for (const unsigned level : {pokeguy, pokeguy - 1}){ + const MemberReader lead = [level](size_t slot) -> std::optional{ + if (slot != 0){ + return std::nullopt; + } + return MemberInfo{.species = "blastoise", .level = level}; + }; + const LevelResult result = run_level_check(logger, lead, *check); + const LevelEnd expected = level >= pokeguy ? LevelEnd::REACHED : LevelEnd::BELOW; + if (result.end != expected || result.level != level){ + return std::format("{}: a Lv{} lead {} the Lv{} check.", id, level, level >= pokeguy ? "fails" : "passes", pokeguy); + } + } + return true; +} + const AutoStoryCinnabarGymCase AUTO_STORY_CINNABAR_GYM_CASES[] = { { .input = {.name = "Cinnabar Gym's quiz doors are shut on the map", .body = test_quiz_doors_on_map}, @@ -243,6 +283,13 @@ const AutoStoryCinnabarGymCase AUTO_STORY_CINNABAR_GYM_CASES[] = { .input = {.name = "the lead's attacks against Blaine", .body = test_lead_moves_against_blaine}, .expectation = {.description = "Surf against each Fire type"}, }, + { + .input = {.name = "14.02 stops before Blaine unless the lead is at least pokeguy's Lv40", .body = []{ + QuietLogger logger; + return check_lead_level_precondition(logger, "14.02", "blaine", 40); + }}, + .expectation = {.description = "a Lv40 lead passes the LEVEL step, a Lv39 one stops there"}, + }, }; } // namespace diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json index 02f9579287..0eada30ce1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json @@ -6,6 +6,13 @@ "title": "Blaine, the VOLCANOBADGE; out through the quiz doors, NO to Bill, heal at Cinnabar's Center", "start": {"map": "CinnabarIsland_Gym", "tiles": [[5, 5]], "facing": "north"}, "events": [ + { + "id": "lead_lv40_for_blaine", + "kind": "game_action", + "action": "level", + "args": {"slot": 1, "min": 40}, + "why": "the precondition for Blaine: the lead at least Lv40, pokeguy's Blastoise here (PokemonSimulation docs/battles/pokeguy-conditions.md, blaine: B recovery, no X items, from 24/126 HP: 100/100 wins, 90.0% to 100.0%); at his level or above, those sims stand for this fight and no new one is needed; below it, the run stops here, before the fight" + }, { "id": "challenge_blaine", "kind": "talk", From cd4c72d7a4470da8a53824f653a58e136436b2c2 Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 14:24:47 -0800 Subject: [PATCH 06/11] FRLG 14.01/14.02: golden carries [tapped]; 14.01's quiz approaches listed as not yet tapped Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h | 2 +- .../Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h index 4cde4367fe..426316b039 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h @@ -104,7 +104,7 @@ inline constexpr std::string_view FRLG_PLAN_GOLDEN_14[] = { "14.02 walk south 6 (to wall) -> CinnabarIsland_Gym (26, 8) [walk only]", "14.02 below_gym_door from CinnabarIsland_Gym (26, 10) facing south to CinnabarIsland (20, 5) facing south", "14.02 walk south 13 (to wall) -> CinnabarIsland_Gym (26, 23) [walk only]", - "14.02 walk west 1 -> CinnabarIsland_Gym (25, 23) [walk only]", + "14.02 walk west 1 -> CinnabarIsland_Gym (25, 23) [walk only] [tapped]", "14.02 walk south 1 (warp) -> CinnabarIsland (20, 5) [walk only]", "14.02 below_center_door from CinnabarIsland (20, 5) facing south to CinnabarIsland (14, 12) facing north", "14.02 walk east 1 (to wall) -> CinnabarIsland (21, 5)", 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 c915ba973e..9780722d98 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -824,6 +824,10 @@ UnitTestResult test_approaches_end_on_their_tile(){ "02.02/below_oak", "03.02/before_brock", "05.07/below_bill_clefairy", "05.07/pc_front", "05.07/beside_bill", "06.01/behind_captain", "07.01/beside_chairman", "07.01/bike_clerk", "09.01/below_poster_guard", "09.02/below_left_guard", "09.03/above_tea_woman", "10.01/below_fly_woman", + // Not run on a console: 14.01 (#410) predates this rule. Its quiz machine approaches are held + // open routes; tap them (follow-up) and drop these. + "14.01/below_quiz_1", "14.01/below_quiz_2", "14.01/below_quiz_3", "14.01/below_quiz_4", + "14.01/below_quiz_5", "14.01/below_quiz_6", }; std::string wrong; size_t count = 0; From 0a8f1042d16d3a0363f2a30bfa8631b4e7601ba4 Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 14:25:19 -0800 Subject: [PATCH 07/11] FRLG 14.01: register Cinnabar Gym tests in PokemonFRLG_AutoStoryRows14_Tests.h (header symbol limit) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG/PokemonFRLG_Tests.cpp | 1 + ...PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp | 1 + .../PokemonFRLG_AutoStoryRows14_Tests.h | 27 +++++++++++++++++++ .../PokemonFRLG_AutoStoryRows_Tests.h | 2 -- SerialPrograms/cmake/SourceFiles.cmake | 1 + 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows14_Tests.h diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp index 54d1464523..a0f1b1917e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp @@ -55,6 +55,7 @@ #include "Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryHealing.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryRows12_Tests.h" +#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows14_Tests.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryTable.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h" #include "Programs/AutoStory/Data/Json_Tests.h" diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp index ef0db5a2b8..375abbb516 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp @@ -29,6 +29,7 @@ #include "PokemonFRLG_AutoStoryMember.h" #include "PokemonFRLG_AutoStoryRowSim.h" #include "PokemonFRLG_AutoStoryRows_Tests.h" +#include "PokemonFRLG_AutoStoryRows14_Tests.h" #include "PokemonFRLG_AutoStoryTable.h" namespace PokemonAutomation{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows14_Tests.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows14_Tests.h new file mode 100644 index 0000000000..b1832a84a4 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows14_Tests.h @@ -0,0 +1,27 @@ +/* AutoStory Row Tests, Segment 14 + * + * From: https://github.com/PokemonAutomation/ + * + * Registration of the tests that run segment 14's rows on the overworld + * sim, beside PokemonFRLG_AutoStoryRows_Tests.h's earlier stretches. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryRows14_Tests_H +#define PokemonAutomation_PokemonFRLG_AutoStoryRows14_Tests_H + +#include "Common/Cpp/TestRunners/UnitTestDatabase.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// Rows 14.01 and 14.02, Cinnabar Gym, on the overworld sim (PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp). +void add_tests_AutoStoryCinnabarGym(UnitTestDatabase& database); + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h index 3dfc9dbce5..d3b53712e5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h @@ -35,8 +35,6 @@ void add_tests_AutoStorySnorlax(UnitTestDatabase& database); void add_tests_AutoStorySlope(UnitTestDatabase& database); // Row 11.03 on the sims (PokemonFRLG_AutoStorySafari_Tests.cpp). void add_tests_AutoStorySafari(UnitTestDatabase& database); -// Rows 14.01 and 14.02, Cinnabar Gym, on the overworld sim (PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp). -void add_tests_AutoStoryCinnabarGym(UnitTestDatabase& database); // Row 15.01, Route 7's gate to Saffron, on the overworld sim (PokemonFRLG_AutoStorySaffron_Tests.cpp). void add_tests_AutoStorySaffron(UnitTestDatabase& database); diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index bc067995c1..9aab98280d 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -2164,6 +2164,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows12_Tests.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows14_Tests.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSimStubs.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngReturns.h From 7abc95ffc4da0bb5258f506694be70ac77310399 Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 14:47:54 -0800 Subject: [PATCH 08/11] PokemonFRLG: keep starts_after_unauthored_rows() for 14.01 and 14.03; 14.03 and 14.04 golden lines follow 14.02's Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryPlanGolden12.h | 31 ------------------- .../PokemonFRLG_AutoStoryPlanGolden14.h | 31 +++++++++++++++++++ .../PokemonFRLG_AutoStorySimulation_Tests.cpp | 7 ++++- .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 8 +++-- 4 files changed, 43 insertions(+), 34 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden12.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden12.h index 2a6f7574bf..ff88c84f9d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden12.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden12.h @@ -91,37 +91,6 @@ inline constexpr std::string_view FRLG_PLAN_GOLDEN_12[] = { "12.03 walk south 3 (to wall) -> FuchsiaCity_PokemonCenter_1F (0, 5) [walk only]", "12.03 walk east 7 -> FuchsiaCity_PokemonCenter_1F (7, 5) [walk only]", "12.03 walk south 4 (warp) -> FuchsiaCity (25, 32) [walk only]", - "14.03 above_gym_tree from CeladonCity (48, 12) facing south to CeladonCity (40, 34) facing south", - "14.03 walk west 7 -> CeladonCity (41, 12)", - "14.03 walk south 13 (to wall) -> CeladonCity (41, 25)", - "14.03 walk west 10 -> CeladonCity (31, 25)", - "14.03 walk south 8 (to wall) -> CeladonCity (31, 33)", - "14.03 walk east 9 -> CeladonCity (40, 33)", - "14.03 walk south 1 -> CeladonCity (40, 34)", - "14.03 below_tamia_line from CeladonCity (40, 35) facing south to CeladonCity_Gym (2, 11) facing north", - "14.03 walk south 2 (to wall) -> CeladonCity (40, 37)", - "14.03 walk west 29 -> CeladonCity (11, 37)", - "14.03 walk north 7 (warp) -> CeladonCity_Gym (6, 18)", - "14.03 walk west 4 -> CeladonCity_Gym (2, 18) [walk only]", - "14.03 walk north 7 -> CeladonCity_Gym (2, 11) [walk only]", - "14.03 below_erika from CeladonCity_Gym (6, 5) facing east to CeladonCity_Gym (6, 5) facing north", - "14.03 face north -> CeladonCity_Gym (6, 5) [walk only]", - "14.04 below_gym_tree_out from CeladonCity_Gym (2, 18) facing south to CeladonCity (40, 36) facing north", - "14.04 walk east 4 -> CeladonCity_Gym (6, 18) [walk only] [tapped]", - "14.04 walk south 1 (warp) -> CeladonCity (11, 31) [walk only]", - "14.04 walk south 6 (to wall) -> CeladonCity (11, 37)", - "14.04 walk east 30 (to wall) -> CeladonCity (41, 37)", - "14.04 walk north 1 (to wall) -> CeladonCity (41, 36)", - "14.04 walk west 1 -> CeladonCity (40, 36)", - "14.04 face north -> CeladonCity (40, 36)", - "14.04 celadon_below_center from CeladonCity (40, 35) facing north to CeladonCity (48, 12) facing north", - "14.04 walk north 3 -> CeladonCity (40, 32)", - "14.04 walk west 9 -> CeladonCity (31, 32)", - "14.04 walk north 8 (to wall) -> CeladonCity (31, 24)", - "14.04 walk east 12 -> CeladonCity (43, 24)", - "14.04 walk north 12 (to wall) -> CeladonCity (43, 12)", - "14.04 walk east 5 -> CeladonCity (48, 12)", - "14.04 face north -> CeladonCity (48, 12)", }; } // namespace PokemonFRLG diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h index 426316b039..5eb0e26247 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h @@ -111,6 +111,37 @@ inline constexpr std::string_view FRLG_PLAN_GOLDEN_14[] = { "14.02 walk south 7 -> CinnabarIsland (21, 12)", "14.02 walk west 7 -> CinnabarIsland (14, 12)", "14.02 face north -> CinnabarIsland (14, 12)", + "14.03 above_gym_tree from CeladonCity (48, 12) facing south to CeladonCity (40, 34) facing south", + "14.03 walk west 7 -> CeladonCity (41, 12)", + "14.03 walk south 13 (to wall) -> CeladonCity (41, 25)", + "14.03 walk west 10 -> CeladonCity (31, 25)", + "14.03 walk south 8 (to wall) -> CeladonCity (31, 33)", + "14.03 walk east 9 -> CeladonCity (40, 33)", + "14.03 walk south 1 -> CeladonCity (40, 34)", + "14.03 below_tamia_line from CeladonCity (40, 35) facing south to CeladonCity_Gym (2, 11) facing north", + "14.03 walk south 2 (to wall) -> CeladonCity (40, 37)", + "14.03 walk west 29 -> CeladonCity (11, 37)", + "14.03 walk north 7 (warp) -> CeladonCity_Gym (6, 18)", + "14.03 walk west 4 -> CeladonCity_Gym (2, 18) [walk only]", + "14.03 walk north 7 -> CeladonCity_Gym (2, 11) [walk only]", + "14.03 below_erika from CeladonCity_Gym (6, 5) facing east to CeladonCity_Gym (6, 5) facing north", + "14.03 face north -> CeladonCity_Gym (6, 5) [walk only]", + "14.04 below_gym_tree_out from CeladonCity_Gym (2, 18) facing south to CeladonCity (40, 36) facing north", + "14.04 walk east 4 -> CeladonCity_Gym (6, 18) [walk only] [tapped]", + "14.04 walk south 1 (warp) -> CeladonCity (11, 31) [walk only]", + "14.04 walk south 6 (to wall) -> CeladonCity (11, 37)", + "14.04 walk east 30 (to wall) -> CeladonCity (41, 37)", + "14.04 walk north 1 (to wall) -> CeladonCity (41, 36)", + "14.04 walk west 1 -> CeladonCity (40, 36)", + "14.04 face north -> CeladonCity (40, 36)", + "14.04 celadon_below_center from CeladonCity (40, 35) facing north to CeladonCity (48, 12) facing north", + "14.04 walk north 3 -> CeladonCity (40, 32)", + "14.04 walk west 9 -> CeladonCity (31, 32)", + "14.04 walk north 8 (to wall) -> CeladonCity (31, 24)", + "14.04 walk east 12 -> CeladonCity (43, 24)", + "14.04 walk north 12 (to wall) -> CeladonCity (43, 12)", + "14.04 walk east 5 -> CeladonCity (48, 12)", + "14.04 face north -> CeladonCity (48, 12)", }; } // namespace PokemonFRLG diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp index 8c655a9757..67ad4d8c7e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp @@ -40,6 +40,7 @@ #include "PokemonFRLG_AutoStoryRows_Tests.h" #include "PokemonFRLG_AutoStoryStepTable.h" #include "PokemonFRLG_AutoStoryTable.h" +#include "PokemonFRLG_AutoStoryUnauthoredStarts_Tests.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -226,9 +227,13 @@ UnitTestResult test_whole_story(){ if (sim.begun() != ids || sim.saves.size() != ids.size()){ return "Expected each checkpoint once, in order, each saving at its end:" + joined(sim.game.trace); } - // Each checkpoint starts where the save before it stands. + // Each checkpoint starts where the save before it stands, but one + // authored before the rows that lead up to it. for (size_t c = 1; c < sim.rows.size(); c++){ const StoryCheckpoint& data = sim.rows[c]; + if (starts_after_unauthored_rows(data.id)){ + continue; + } const std::optional start = story_pose(*start_pose(data)); const std::optional saved = story_pose(sim.saves[c - 1].second); const bool same = start && saved && start->map == saved->map && start->tile == saved->tile 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 320bb43b7c..d4e35cbf9c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -44,6 +44,7 @@ #include "PokemonFRLG_AutoStoryMoveData.h" #include "PokemonFRLG_AutoStoryStepTable.h" #include "PokemonFRLG_AutoStoryTable.h" +#include "PokemonFRLG_AutoStoryUnauthoredStarts_Tests.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -284,7 +285,8 @@ UnitTestResult check_checkpoint(const StoryCheckpoint& checkpoint, StoryPose& po } // Plans every route of the story, each checkpoint from where the one -// before leaves the player, and adds the plans to `golden`. +// before leaves the player (or, past rows not authored yet, from its own +// start: starts_after_unauthored_rows()), and adds the plans to `golden`. UnitTestResult chain_story_routes(std::vector& golden){ const std::vector& checkpoints = story_checkpoints(); if (checkpoints.size() != 58 || checkpoints[0].start){ @@ -293,7 +295,9 @@ UnitTestResult chain_story_routes(std::vector& golden){ StoryPose pose; for (size_t c = 0; c < checkpoints.size(); c++){ const StoryCheckpoint& checkpoint = checkpoints[c]; - if (c > 0){ + if (c > 0 && starts_after_unauthored_rows(checkpoint.id)){ + pose = one_tile(Pokemon::grid_pose_of(*checkpoint.start)); + }else if (c > 0){ const StoryPose start = one_tile(Pokemon::grid_pose_of(*checkpoint.start)); const bool same_facing = !start.facing || start.facing == pose.facing; if (start.map != pose.map || !(start.tile == pose.tile) || !same_facing){ From bfa27476899f5ba66d1a1372491e08d312939e9d Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 17:24:28 -0800 Subject: [PATCH 09/11] FRLG 14.02: Blaine is fought by PokeGuy's solo-recovery policy 14.02 blaine names solo-recovery (the doc's B) with the foe rows from the doc's stats, and a plan test checks them. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryBattlePolicy_Tests.cpp | 17 +++++++++++++++++ .../AutoStory/StoryData/frlg-14.02.plan.json | 11 +++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattlePolicy_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattlePolicy_Tests.cpp index 285f9fbbd5..3ac64209d4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattlePolicy_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattlePolicy_Tests.cpp @@ -363,6 +363,19 @@ UnitTestResult test_plan_erika(){ return check_policy_step("14.04", "erika", {.spa = 1, .accuracy = 2, .outspeed = true, .guard_accuracy = true}); } +UnitTestResult test_plan_blaine(){ + const StoryStep& step = battle_step("14.02", "blaine"); + const auto foes = arg_of>(step, "foes"); + const auto rows = arg_of>>(step, "foe_threats"); + if (arg_of(step, "policy") != "solo-recovery"){ + return "14.02 blaine: expected policy solo-recovery."; + } + if (!foes || !rows || !foe_threats_of(*rows) || rows->size() != foes->size()){ + return "14.02 blaine: expected one valid foe_threats row per foe."; + } + return true; +} + struct AutoStoryBattlePolicyInput{ std::string name; @@ -449,6 +462,10 @@ const std::vector AUTO_STORY_BATTLE_POLICY_CASES = { .input = {.name = "plan: 14.04 erika names the policy, goals and foes", .body = test_plan_erika}, .expectation = {.description = "the policy, goals and 3 foe rows"}, }, + { + .input = {.name = "plan: 14.02 blaine names solo-recovery and its foes", .body = test_plan_blaine}, + .expectation = {.description = "the policy and 4 foe rows"}, + }, { .input = {.name = "plan: 10.03 rival_tower names the policy, goals and foes", .body = test_plan_tower_rival}, .expectation = {.description = "the policy, goals and 5 foe rows"}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json index 0eada30ce1..703537e9fb 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json @@ -23,10 +23,17 @@ "kind": "battle", "args": { "trainer": "TRAINER_LEADER_BLAINE", - "foes": ["growlithe", "ponyta", "rapidash", "arcanine"] + "foes": ["growlithe", "ponyta", "rapidash", "arcanine"], + "policy": "solo-recovery", + "foe_threats": [ + [60, 21, 14, 44, 23, 0, 0], + [69, 23, 17, 50, 26, 0, 0], + [93, 25, 19, 54, 28, 0, 0], + [84, 39, 27, 84, 43, 0, 0] + ] }, "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 5]], "facing": "north"}, - "why": "Blaine (TRAINER_LEADER_BLAINE): Growlithe Lv42, Ponyta Lv40, Rapidash Lv42, Arcanine Lv47 (pokeguy: one Surf each, 1:21:44 to 1:23:09); then the VOLCANOBADGE and TM38 Fire Blast, read to the overworld with the battle's text" + "why": "Blaine (TRAINER_LEADER_BLAINE), fought by pokeguy's policy B (solo-recovery: cure and heal by safety, no setup; the doc's blaine row, foe_threats from its stats): Growlithe Lv42, Ponyta Lv40, Rapidash Lv42, Arcanine Lv47 (pokeguy: one Surf each, 1:21:44 to 1:23:09); then the VOLCANOBADGE and TM38 Fire Blast, read to the overworld with the battle's text" }, { "id": "above_door_6", From 76c7e5399aca5324edf82d24dff2da79b5d26da3 Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 20:37:46 -0800 Subject: [PATCH 10/11] FRLG 14.02: Blaine alone; the exit, Bill and the heal are 14.02b A boss battle is its own checkpoint (user, 2026-11-12). 14.02 starts in front of Blaine and ends there after the VOLCANOBADGE and TM38 text; the new 14.02b starts at the same tile and goes out through the quiz doors, says NO to Bill and heals at Cinnabar's Center. Ids are not renumbered; the golden, run-plan, table, count and gym tests follow. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- ...PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp | 23 +- .../PokemonFRLG_AutoStoryPlanGolden14.h | 56 ++--- .../PokemonFRLG_AutoStoryRows14_Tests.h | 2 +- .../PokemonFRLG_AutoStoryRunPlan_Tests.cpp | 8 +- .../AutoStory/PokemonFRLG_AutoStoryTable.cpp | 2 +- .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 4 +- .../AutoStory/StoryData/frlg-14.02.plan.json | 214 +--------------- .../AutoStory/StoryData/frlg-14.02b.plan.json | 234 ++++++++++++++++++ 8 files changed, 290 insertions(+), 253 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02b.plan.json diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp index 375abbb516..dc153be8bb 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp @@ -2,7 +2,7 @@ * * From: https://github.com/PokemonAutomation/ * - * Rows 14.01 and 14.02 (StoryData/frlg-14.01.plan.json, 14.02) on the + * Rows 14.01, 14.02 and 14.02b (StoryData/frlg-14.01.plan.json, 14.02, 14.02b) on the * overworld sim: from outside the Pokemon Mansion to Cinnabar's nurse, * into the gym and through its six quiz doors to below Blaine; and from * Blaine back out through the doors, past Bill, to the nurse. And the @@ -185,8 +185,9 @@ UnitTestResult test_quiz_doors_on_map(){ } // 14.01 from outside the Mansion: the nurse, the gym and its six quiz -// doors, nobody fought, to below Blaine, where 14.02 starts; then 14.02 -// from there out of the gym to the nurse. +// doors, nobody fought, to below Blaine, where 14.02 starts; 14.02, +// Blaine's battle, which ends where it starts; then 14.02b from there out +// of the gym to the nurse. UnitTestResult test_gym_rows(){ GymWalk walk(*story_pose(Pokemon::pose_of(*checkpoint("14.01").start))); if (const std::string failure = row_on_sim("14.01", walk); !failure.empty()){ @@ -206,11 +207,21 @@ UnitTestResult test_gym_rows(){ if (const std::string failure = row_on_sim("14.02", walk); !failure.empty()){ return failure; } + if (!(walk.sim->state().position == below_blaine)){ + return std::format("14.02: ended on {}, not in front of Blaine where 14.02b starts.", to_string(walk.sim->state().position)); + } + const StoryPose after_blaine = *story_pose(Pokemon::pose_of(*checkpoint("14.02b").start)); + if (after_blaine.map != GYM || !(after_blaine.tile == below_blaine.point)){ + return "14.02b doesn't start where 14.02 ends."; + } + if (const std::string failure = row_on_sim("14.02b", walk); !failure.empty()){ + return failure; + } if (!walk.all_fought().empty()){ - return "14.02: fought a gym trainer on the way out."; + return "14.02b: fought a gym trainer on the way out."; } if (walk.at.map != "CinnabarIsland_PokemonCenter_1F"){ - return std::format("14.02: ended on {}, not at Cinnabar's nurse.", walk.at.map); + return std::format("14.02b: ended on {}, not at Cinnabar's nurse.", walk.at.map); } return true; } @@ -277,7 +288,7 @@ const AutoStoryCinnabarGymCase AUTO_STORY_CINNABAR_GYM_CASES[] = { .expectation = {.description = "each of 14.01's door steps crosses one barrier tile between floor"}, }, { - .input = {.name = "14.01 through the quiz to below Blaine and 14.02 back to the nurse", .body = test_gym_rows}, + .input = {.name = "14.01 through the quiz to below Blaine, 14.02 on the spot and 14.02b back to the nurse", .body = test_gym_rows}, .expectation = {.description = "no gym trainer fought; ends at Cinnabar's nurse"}, }, { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h index 426316b039..d0dfc47a5b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden14.h @@ -83,34 +83,34 @@ inline constexpr std::string_view FRLG_PLAN_GOLDEN_14[] = { "14.01 walk north 5 (to wall) -> CinnabarIsland_Gym (5, 10) [walk only]", "14.01 below_blaine from CinnabarIsland_Gym (5, 8) facing north to CinnabarIsland_Gym (5, 5) facing north", "14.01 walk north 3 -> CinnabarIsland_Gym (5, 5) [walk only]", - "14.02 above_door_6 from CinnabarIsland_Gym (5, 5) facing north to CinnabarIsland_Gym (5, 8) facing south", - "14.02 walk south 3 (to wall) -> CinnabarIsland_Gym (5, 8) [walk only]", - "14.02 above_door_5 from CinnabarIsland_Gym (5, 10) facing south to CinnabarIsland_Gym (5, 16) facing south", - "14.02 walk south 6 (to wall) -> CinnabarIsland_Gym (5, 16) [walk only]", - "14.02 west_of_door_4 from CinnabarIsland_Gym (5, 18) facing south to CinnabarIsland_Gym (10, 22) facing east", - "14.02 walk south 5 (to wall) -> CinnabarIsland_Gym (5, 23) [walk only]", - "14.02 walk east 5 (to wall) -> CinnabarIsland_Gym (10, 23) [walk only]", - "14.02 walk north 1 (to wall) -> CinnabarIsland_Gym (10, 22) [walk only]", - "14.02 face east -> CinnabarIsland_Gym (10, 22) [walk only]", - "14.02 below_door_3 from CinnabarIsland_Gym (12, 22) facing east to CinnabarIsland_Gym (17, 17) facing north", - "14.02 walk east 5 -> CinnabarIsland_Gym (17, 22) [walk only]", - "14.02 walk north 5 (to wall) -> CinnabarIsland_Gym (17, 17) [walk only]", - "14.02 below_door_2 from CinnabarIsland_Gym (17, 15) facing north to CinnabarIsland_Gym (17, 10) facing north", - "14.02 walk north 5 (to wall) -> CinnabarIsland_Gym (17, 10) [walk only]", - "14.02 above_door_1 from CinnabarIsland_Gym (17, 8) facing north to CinnabarIsland_Gym (26, 8) facing south", - "14.02 walk east 1 (to wall) -> CinnabarIsland_Gym (18, 8) [walk only]", - "14.02 walk north 6 (to wall) -> CinnabarIsland_Gym (18, 2) [walk only]", - "14.02 walk east 8 -> CinnabarIsland_Gym (26, 2) [walk only]", - "14.02 walk south 6 (to wall) -> CinnabarIsland_Gym (26, 8) [walk only]", - "14.02 below_gym_door from CinnabarIsland_Gym (26, 10) facing south to CinnabarIsland (20, 5) facing south", - "14.02 walk south 13 (to wall) -> CinnabarIsland_Gym (26, 23) [walk only]", - "14.02 walk west 1 -> CinnabarIsland_Gym (25, 23) [walk only] [tapped]", - "14.02 walk south 1 (warp) -> CinnabarIsland (20, 5) [walk only]", - "14.02 below_center_door from CinnabarIsland (20, 5) facing south to CinnabarIsland (14, 12) facing north", - "14.02 walk east 1 (to wall) -> CinnabarIsland (21, 5)", - "14.02 walk south 7 -> CinnabarIsland (21, 12)", - "14.02 walk west 7 -> CinnabarIsland (14, 12)", - "14.02 face north -> CinnabarIsland (14, 12)", + "14.02b above_door_6 from CinnabarIsland_Gym (5, 5) facing north to CinnabarIsland_Gym (5, 8) facing south", + "14.02b walk south 3 (to wall) -> CinnabarIsland_Gym (5, 8) [walk only]", + "14.02b above_door_5 from CinnabarIsland_Gym (5, 10) facing south to CinnabarIsland_Gym (5, 16) facing south", + "14.02b walk south 6 (to wall) -> CinnabarIsland_Gym (5, 16) [walk only]", + "14.02b west_of_door_4 from CinnabarIsland_Gym (5, 18) facing south to CinnabarIsland_Gym (10, 22) facing east", + "14.02b walk south 5 (to wall) -> CinnabarIsland_Gym (5, 23) [walk only]", + "14.02b walk east 5 (to wall) -> CinnabarIsland_Gym (10, 23) [walk only]", + "14.02b walk north 1 (to wall) -> CinnabarIsland_Gym (10, 22) [walk only]", + "14.02b face east -> CinnabarIsland_Gym (10, 22) [walk only]", + "14.02b below_door_3 from CinnabarIsland_Gym (12, 22) facing east to CinnabarIsland_Gym (17, 17) facing north", + "14.02b walk east 5 -> CinnabarIsland_Gym (17, 22) [walk only]", + "14.02b walk north 5 (to wall) -> CinnabarIsland_Gym (17, 17) [walk only]", + "14.02b below_door_2 from CinnabarIsland_Gym (17, 15) facing north to CinnabarIsland_Gym (17, 10) facing north", + "14.02b walk north 5 (to wall) -> CinnabarIsland_Gym (17, 10) [walk only]", + "14.02b above_door_1 from CinnabarIsland_Gym (17, 8) facing north to CinnabarIsland_Gym (26, 8) facing south", + "14.02b walk east 1 (to wall) -> CinnabarIsland_Gym (18, 8) [walk only]", + "14.02b walk north 6 (to wall) -> CinnabarIsland_Gym (18, 2) [walk only]", + "14.02b walk east 8 -> CinnabarIsland_Gym (26, 2) [walk only]", + "14.02b walk south 6 (to wall) -> CinnabarIsland_Gym (26, 8) [walk only]", + "14.02b below_gym_door from CinnabarIsland_Gym (26, 10) facing south to CinnabarIsland (20, 5) facing south", + "14.02b walk south 13 (to wall) -> CinnabarIsland_Gym (26, 23) [walk only]", + "14.02b walk west 1 -> CinnabarIsland_Gym (25, 23) [walk only] [tapped]", + "14.02b walk south 1 (warp) -> CinnabarIsland (20, 5) [walk only]", + "14.02b below_center_door from CinnabarIsland (20, 5) facing south to CinnabarIsland (14, 12) facing north", + "14.02b walk east 1 (to wall) -> CinnabarIsland (21, 5)", + "14.02b walk south 7 -> CinnabarIsland (21, 12)", + "14.02b walk west 7 -> CinnabarIsland (14, 12)", + "14.02b face north -> CinnabarIsland (14, 12)", }; } // namespace PokemonFRLG diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows14_Tests.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows14_Tests.h index b1832a84a4..d42bdccdde 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows14_Tests.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows14_Tests.h @@ -17,7 +17,7 @@ namespace NintendoSwitch{ namespace PokemonFRLG{ -// Rows 14.01 and 14.02, Cinnabar Gym, on the overworld sim (PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp). +// Rows 14.01, 14.02 and 14.02b, Cinnabar Gym, on the overworld sim (PokemonFRLG_AutoStoryCinnabarGym_Tests.cpp). void add_tests_AutoStoryCinnabarGym(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 c590c8f5d6..fa1003675e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp @@ -145,7 +145,7 @@ class Test_RunPlan : public UnitTest{ const RunPlanScenario m_scenario; }; -const std::string TODAY = "01.01 01.03 01.04 01.05 02.01 02.02 02.03 03.01 03.02 03.03 04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 15.01 16.01 13.01 13.02 13.03 13.04 14.01 14.02"; +const std::string TODAY = "01.01 01.03 01.04 01.05 02.01 02.02 02.03 03.01 03.02 03.03 04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 15.01 16.01 13.01 13.02 13.03 13.04 14.01 14.02 14.02b"; const RunPlanScenario RUN_PLAN_CASES[] = { { @@ -236,11 +236,11 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Gift RNG off: 04.03 is passed over", .first = "04.01"}, - .expectation = {.expected_ids = "04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 15.01 16.01 13.01 13.02 13.03 13.04 14.01 14.02"}, + .expectation = {.expected_ids = "04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 15.01 16.01 13.01 13.02 13.03 13.04 14.01 14.02 14.02b"}, }, { .input = {.name = "Gift RNG off: 04.03 runs when started at", .first = "04.03"}, - .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 15.01 16.01 13.01 13.02 13.03 13.04 14.01 14.02"}, + .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 15.01 16.01 13.01 13.02 13.03 13.04 14.01 14.02 14.02b"}, }, { .input = { .name = "Gift RNG: started at 04.03, from the save beside the salesman", @@ -279,7 +279,7 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Starter RNG alone: 04.03 runs when started at", .first = "04.03", .handoffs = {.starter_rng = true}}, - .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 15.01 16.01 13.01 13.02 13.03 13.04 14.01 14.02"}, + .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 15.01 16.01 13.01 13.02 13.03 13.04 14.01 14.02 14.02b"}, }, { .input = { .name = "Starter RNG first, with both on", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp index d781d1abf5..176750c4d7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp @@ -234,7 +234,7 @@ constexpr std::string_view STORY_ORDER[] = { "05.03", "05.04", "05.05", "05.06", "05.07", "05.08", "05.09", "05.10", "06.01", "06.02", "06.03", "06.04", "07.01", "07.02", "08.01", "08.02", "08.03", "09.01", "09.02", "09.03", "09.04", "10.01", "10.02", "10.03", "10.04", "10.05", "10.06", "11.01", "11.02", "11.03", - "12.01", "12.02", "12.02b", "12.03", "14.03", "14.04", "15.01", "16.01", "13.01", "13.02", "13.03", "13.04", "14.01", "14.02", + "12.01", "12.02", "12.02b", "12.03", "14.03", "14.04", "15.01", "16.01", "13.01", "13.02", "13.03", "13.04", "14.01", "14.02", "14.02b", }; // `checkpoints` in STORY_ORDER's order. Throws ParseException for a 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 977cc8fd14..f999b3f768 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -291,8 +291,8 @@ UnitTestResult check_checkpoint(const StoryCheckpoint& checkpoint, StoryPose& po // start: starts_after_unauthored_rows()), and adds the plans to `golden`. UnitTestResult chain_story_routes(std::vector& golden){ const std::vector& checkpoints = story_checkpoints(); - if (checkpoints.size() != 64 || checkpoints[0].start){ - return "Expected 64 checkpoints, the first from a new game."; + if (checkpoints.size() != 65 || checkpoints[0].start){ + return "Expected 65 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/StoryData/frlg-14.02.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json index 703537e9fb..91c9b05de2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02.plan.json @@ -3,7 +3,7 @@ "game": "frlg", "checkpoint": { "id": "14.02", - "title": "Blaine, the VOLCANOBADGE; out through the quiz doors, NO to Bill, heal at Cinnabar's Center", + "title": "Blaine and the VOLCANOBADGE", "start": {"map": "CinnabarIsland_Gym", "tiles": [[5, 5]], "facing": "north"}, "events": [ { @@ -34,212 +34,6 @@ }, "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 5]], "facing": "north"}, "why": "Blaine (TRAINER_LEADER_BLAINE), fought by pokeguy's policy B (solo-recovery: cure and heal by safety, no setup; the doc's blaine row, foe_threats from its stats): Growlithe Lv42, Ponyta Lv40, Rapidash Lv42, Arcanine Lv47 (pokeguy: one Surf each, 1:21:44 to 1:23:09); then the VOLCANOBADGE and TM38 Fire Blast, read to the overworld with the battle's text" - }, - { - "id": "above_door_6", - "kind": "route", - "action": "run", - "args": { - "target": {"map": "CinnabarIsland_Gym", "tiles": [[5, 8]], "facing": "south"} - }, - "why": "down to above door 6, open since quiz 6" - }, - { - "id": "into_door_6", - "kind": "step", - "args": { - "direction": "south" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 9]], "facing": "south"}, - "why": "a step onto door 6's floor (5, 9), a barrier on the map" - }, - { - "id": "through_door_6", - "kind": "step", - "args": { - "direction": "south" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 10]], "facing": "south"}, - "why": "a step through door 6 onto (5, 10)" - }, - { - "id": "above_door_5", - "kind": "route", - "action": "run", - "args": { - "target": {"map": "CinnabarIsland_Gym", "tiles": [[5, 16]], "facing": "south"} - }, - "why": "down to above door 5" - }, - { - "id": "into_door_5", - "kind": "step", - "args": { - "direction": "south" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 17]], "facing": "south"}, - "why": "a step onto door 5's floor (5, 17)" - }, - { - "id": "through_door_5", - "kind": "step", - "args": { - "direction": "south" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 18]], "facing": "south"}, - "why": "a step through door 5 onto (5, 18)" - }, - { - "id": "west_of_door_4", - "kind": "route", - "action": "run", - "args": { - "target": {"map": "CinnabarIsland_Gym", "tiles": [[10, 22]], "facing": "east"} - }, - "why": "down and east to west of door 4" - }, - { - "id": "into_door_4", - "kind": "step", - "args": { - "direction": "east" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[11, 22]], "facing": "east"}, - "why": "a step onto door 4's floor (11, 22)" - }, - { - "id": "through_door_4", - "kind": "step", - "args": { - "direction": "east" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[12, 22]], "facing": "east"}, - "why": "a step through door 4 onto (12, 22)" - }, - { - "id": "below_door_3", - "kind": "route", - "action": "run", - "args": { - "target": {"map": "CinnabarIsland_Gym", "tiles": [[17, 17]], "facing": "north"} - }, - "why": "up and east to below door 3" - }, - { - "id": "into_door_3", - "kind": "step", - "args": { - "direction": "north" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 16]], "facing": "north"}, - "why": "a step onto door 3's floor (17, 16)" - }, - { - "id": "through_door_3", - "kind": "step", - "args": { - "direction": "north" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 15]], "facing": "north"}, - "why": "a step through door 3 onto (17, 15)" - }, - { - "id": "below_door_2", - "kind": "route", - "action": "run", - "args": { - "target": {"map": "CinnabarIsland_Gym", "tiles": [[17, 10]], "facing": "north"} - }, - "why": "up to below door 2" - }, - { - "id": "into_door_2", - "kind": "step", - "args": { - "direction": "north" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 9]], "facing": "north"}, - "why": "a step onto door 2's floor (17, 9)" - }, - { - "id": "through_door_2", - "kind": "step", - "args": { - "direction": "north" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 8]], "facing": "north"}, - "why": "a step through door 2 onto (17, 8)" - }, - { - "id": "above_door_1", - "kind": "route", - "action": "run", - "args": { - "target": {"map": "CinnabarIsland_Gym", "tiles": [[26, 8]], "facing": "south"} - }, - "why": "east through the top room to above door 1" - }, - { - "id": "into_door_1", - "kind": "step", - "args": { - "direction": "south" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[26, 9]], "facing": "south"}, - "why": "a step onto door 1's floor (26, 9)" - }, - { - "id": "through_door_1", - "kind": "step", - "args": { - "direction": "south" - }, - "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[26, 10]], "facing": "south"}, - "why": "a step through door 1 onto (26, 10)" - }, - { - "id": "below_gym_door", - "kind": "route", - "action": "run", - "args": { - "target": {"map": "CinnabarIsland", "tiles": [[20, 5]], "facing": "south"} - }, - "why": "down the east rooms to the mat (25, 23) and out of the gym's door (20, 4)" - }, - { - "id": "decline_bill", - "kind": "answer", - "args": { - "yes": false - }, - "why": "Bill walks up from (20, 7) (CinnabarIsland_EventScript_BillScene, VAR_MAP_SCENE_CINNABAR_ISLAND 1 after Blaine): \"come with me to ONE ISLAND?\" NO (pokeguy 1:23:10 to 1:23:44)" - }, - { - "id": "bill_leaves", - "kind": "scene", - "declared_after": {"map": "CinnabarIsland", "tiles": [[20, 5]], "facing": "south"}, - "why": "\"I'll be waiting in the POKeMON CENTER\"; he walks off to the Center and is removed" - }, - { - "id": "below_center_door", - "kind": "route", - "action": "run", - "args": { - "target": {"map": "CinnabarIsland", "tiles": [[14, 12]], "facing": "north"} - }, - "why": "west and down to below the Center's door (14, 11)" - }, - { - "id": "cinnabar_nurse", - "kind": "game_action", - "action": "center_enter", - "declared_after": {"map": "CinnabarIsland_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, - "why": "the Center script in: through the door and up to the nurse; no map of the Center. Bill stands in the Center now (FLAG_HIDE_CINNABAR_POKECENTER_BILL cleared), off the way to the nurse" - }, - { - "id": "heal_cinnabar", - "kind": "heal", - "why": "full HP and PP" } ] }, @@ -248,16 +42,14 @@ "notes": { "checkpoint": [ "Blaine (5, 4), talked to from below, from the save in front of him (14.01): Growlithe Lv42, Ponyta Lv40, Rapidash Lv42, Arcanine Lv47 (sParty_LeaderBlaine); then the VOLCANOBADGE and TM38 Fire Blast. The lead's Surf (taught in 12.01) is 2x on all four.", - "Out the way in: the quiz doors stay open while the player is in the gym (the flags are set and OnLoad reopens them), each crossed by two plain steps as in 14.01.", - "Outside, Bill's scene runs on the first frame (VAR_MAP_SCENE_CINNABAR_ISLAND 1, set by Blaine's win): NO to the Sevii trip, as pokeguy. He walks to the Center and waits there; the Center visit here doesn't talk to him.", - "Ends at Cinnabar's nurse. PokeGuy flies to Celadon from outside the gym (1:23:45); 14.03 starts from Fly's landing in Celadon, so the Fly (a step type in #406) goes at 14.03's start or here once it is in." + "A boss battle is its own checkpoint (user, 2026-11-12): Blaine's fight is all this row does. It ends in front of Blaine after the VOLCANOBADGE and TM38 text, and saves there; 14.02b goes on out of the gym." ] } }, "metadata": { "phase": "testing", "postconditions": { - "position": {"map": "CinnabarIsland_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"} + "position": {"map": "CinnabarIsland_Gym", "tiles": [[5, 5]], "facing": "north"} } } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02b.plan.json new file mode 100644 index 0000000000..d1bedaeee3 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-14.02b.plan.json @@ -0,0 +1,234 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "14.02b", + "title": "Out through the quiz doors, NO to Bill, heal at Cinnabar's Center", + "start": {"map": "CinnabarIsland_Gym", "tiles": [[5, 5]], "facing": "north"}, + "events": [ + { + "id": "above_door_6", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[5, 8]], "facing": "south"} + }, + "why": "down to above door 6, open since quiz 6" + }, + { + "id": "into_door_6", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 9]], "facing": "south"}, + "why": "a step onto door 6's floor (5, 9), a barrier on the map" + }, + { + "id": "through_door_6", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 10]], "facing": "south"}, + "why": "a step through door 6 onto (5, 10)" + }, + { + "id": "above_door_5", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[5, 16]], "facing": "south"} + }, + "why": "down to above door 5" + }, + { + "id": "into_door_5", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 17]], "facing": "south"}, + "why": "a step onto door 5's floor (5, 17)" + }, + { + "id": "through_door_5", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[5, 18]], "facing": "south"}, + "why": "a step through door 5 onto (5, 18)" + }, + { + "id": "west_of_door_4", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[10, 22]], "facing": "east"} + }, + "why": "down and east to west of door 4" + }, + { + "id": "into_door_4", + "kind": "step", + "args": { + "direction": "east" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[11, 22]], "facing": "east"}, + "why": "a step onto door 4's floor (11, 22)" + }, + { + "id": "through_door_4", + "kind": "step", + "args": { + "direction": "east" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[12, 22]], "facing": "east"}, + "why": "a step through door 4 onto (12, 22)" + }, + { + "id": "below_door_3", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[17, 17]], "facing": "north"} + }, + "why": "up and east to below door 3" + }, + { + "id": "into_door_3", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 16]], "facing": "north"}, + "why": "a step onto door 3's floor (17, 16)" + }, + { + "id": "through_door_3", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 15]], "facing": "north"}, + "why": "a step through door 3 onto (17, 15)" + }, + { + "id": "below_door_2", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[17, 10]], "facing": "north"} + }, + "why": "up to below door 2" + }, + { + "id": "into_door_2", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 9]], "facing": "north"}, + "why": "a step onto door 2's floor (17, 9)" + }, + { + "id": "through_door_2", + "kind": "step", + "args": { + "direction": "north" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[17, 8]], "facing": "north"}, + "why": "a step through door 2 onto (17, 8)" + }, + { + "id": "above_door_1", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland_Gym", "tiles": [[26, 8]], "facing": "south"} + }, + "why": "east through the top room to above door 1" + }, + { + "id": "into_door_1", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[26, 9]], "facing": "south"}, + "why": "a step onto door 1's floor (26, 9)" + }, + { + "id": "through_door_1", + "kind": "step", + "args": { + "direction": "south" + }, + "declared_after": {"map": "CinnabarIsland_Gym", "tiles": [[26, 10]], "facing": "south"}, + "why": "a step through door 1 onto (26, 10)" + }, + { + "id": "below_gym_door", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland", "tiles": [[20, 5]], "facing": "south"} + }, + "why": "down the east rooms to the mat (25, 23) and out of the gym's door (20, 4)" + }, + { + "id": "decline_bill", + "kind": "answer", + "args": { + "yes": false + }, + "why": "Bill walks up from (20, 7) (CinnabarIsland_EventScript_BillScene, VAR_MAP_SCENE_CINNABAR_ISLAND 1 after Blaine): \"come with me to ONE ISLAND?\" NO (pokeguy 1:23:10 to 1:23:44)" + }, + { + "id": "bill_leaves", + "kind": "scene", + "declared_after": {"map": "CinnabarIsland", "tiles": [[20, 5]], "facing": "south"}, + "why": "\"I'll be waiting in the POKeMON CENTER\"; he walks off to the Center and is removed" + }, + { + "id": "below_center_door", + "kind": "route", + "action": "run", + "args": { + "target": {"map": "CinnabarIsland", "tiles": [[14, 12]], "facing": "north"} + }, + "why": "west and down to below the Center's door (14, 11)" + }, + { + "id": "cinnabar_nurse", + "kind": "game_action", + "action": "center_enter", + "declared_after": {"map": "CinnabarIsland_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, + "why": "the Center script in: through the door and up to the nurse; no map of the Center. Bill stands in the Center now (FLAG_HIDE_CINNABAR_POKECENTER_BILL cleared), off the way to the nurse" + }, + { + "id": "heal_cinnabar", + "kind": "heal", + "why": "full HP and PP" + } + ] + }, + "execution": { + "menu": "full", + "notes": { + "checkpoint": [ + "Starts in front of Blaine, where 14.02 ends after his battle and saves.", + "Out the way in: the quiz doors stay open while the player is in the gym (the flags are set and OnLoad reopens them), each crossed by two plain steps as in 14.01.", + "Outside, Bill's scene runs on the first frame (VAR_MAP_SCENE_CINNABAR_ISLAND 1, set by Blaine's win): NO to the Sevii trip, as pokeguy. He walks to the Center and waits there; the Center visit here doesn't talk to him.", + "Ends at Cinnabar's nurse. PokeGuy flies to Celadon from outside the gym (1:23:45); 14.03 starts from Fly's landing in Celadon, so the Fly (a step type in #406) goes at 14.03's start or here once it is in." + ] + } + }, + "metadata": { + "phase": "testing", + "postconditions": { + "position": {"map": "CinnabarIsland_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"} + } + } +} From ba0c8fe0d0b40fdbbb2489d6ad69eaa3978aaf7e Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 20:47:25 -0800 Subject: [PATCH 11/11] FRLG AutoStory: the chain test expects 66 checkpoints (the split's merge counted one twice) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 f999b3f768..78752acf9b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -291,8 +291,8 @@ UnitTestResult check_checkpoint(const StoryCheckpoint& checkpoint, StoryPose& po // start: starts_after_unauthored_rows()), and adds the plans to `golden`. UnitTestResult chain_story_routes(std::vector& golden){ const std::vector& checkpoints = story_checkpoints(); - if (checkpoints.size() != 65 || checkpoints[0].start){ - return "Expected 65 checkpoints, the first from a new game."; + if (checkpoints.size() != 66 || checkpoints[0].start){ + return "Expected 66 checkpoints, the first from a new game."; } StoryPose pose; for (size_t c = 0; c < checkpoints.size(); c++){