From 9599e482b20b452ce808793d9dca92465b867876 Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 15:11:05 -0800 Subject: [PATCH 1/3] PokemonFRLG: 16.01, Saffron to Silph Co.'s 3F and its pad to 5F The stairs to 3F, west along the hall and onto the pad (4, 6) to 5F's (15, 7), on the maps of Silph Co.'s eleven floors. The rest of the way to the CARD KEY (Beau's wander zone, the Rocket in the corridor, the Card Key doors) is noted in the row for 16.02. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Menus/PokemonFRLG_SaveCardReader.cpp | 1 + .../Overworld/PokemonFRLG_OverworldMaps.cpp | 13 ++ .../PokemonFRLG/PokemonFRLG_Tests.cpp | 2 + .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 1 + .../PokemonFRLG_AutoStoryPlanGolden16.h | 40 ++++++ .../PokemonFRLG_AutoStoryRows16_Tests.h | 27 ++++ .../PokemonFRLG_AutoStoryRunPlan_Tests.cpp | 8 +- .../PokemonFRLG_AutoStorySilph_Tests.cpp | 124 ++++++++++++++++++ .../AutoStory/PokemonFRLG_AutoStoryTable.cpp | 2 +- .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 6 +- .../AutoStory/StoryData/frlg-16.01.plan.json | 81 ++++++++++++ SerialPrograms/cmake/SourceFiles.cmake | 3 + 12 files changed, 301 insertions(+), 7 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden16.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows16_Tests.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySilph_Tests.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-16.01.plan.json diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp index b11e7e5dcd..4b2fd47008 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp @@ -84,6 +84,7 @@ class PlaceNameMatcher : public OCR::SmallDictionaryMatcher{ {"route-16", "Route 16"}, {"fuchsia-city", "Fuchsia City"}, {"saffron-city", "Saffron City"}, + {"silph-co", "Silph Co"}, }){ JsonArray names; names.push_back(std::string(name)); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp index 9d0f50d026..0ac65d4f66 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp @@ -146,6 +146,19 @@ constexpr std::string_view MAP_NAMES[] = { // Route 7's east gate, where the guard takes the TEA, and Saffron City. "Route7_EastEntrance", "SaffronCity", + // Silph Co.'s floors, 1F to 11F (the lift's map, SilphCo_Elevator, is + // not built in). + "SilphCo_1F", + "SilphCo_2F", + "SilphCo_3F", + "SilphCo_4F", + "SilphCo_5F", + "SilphCo_6F", + "SilphCo_7F", + "SilphCo_8F", + "SilphCo_9F", + "SilphCo_10F", + "SilphCo_11F", "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 7b9482e3f8..58b1d1f02b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp @@ -56,6 +56,7 @@ #include "Programs/AutoStory/PokemonFRLG_AutoStoryHealing.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryRows12_Tests.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryRows15_Tests.h" +#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows16_Tests.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryTable.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h" #include "Programs/AutoStory/Data/Json_Tests.h" @@ -337,6 +338,7 @@ static void add_tests_AutoStoryRows(UnitTestDatabase& database){ add_tests_AutoStoryHealing(database); add_tests_AutoStoryCeladonGym(database); add_tests_AutoStorySaffron(database); + add_tests_AutoStorySilph(database); } void add_tests(UnitTestDatabase& database){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index bb913f86ab..bc2341feef 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -372,6 +372,7 @@ std::string save_card_place(const std::string& map){ {"Route16", "route-16"}, {"FuchsiaCity", "fuchsia-city"}, {"SaffronCity", "saffron-city"}, + {"SilphCo", "silph-co"}, }; for (const auto& [prefix, place] : PLACES){ if (map == prefix || map.rfind(prefix + "_", 0) == 0){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden16.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden16.h new file mode 100644 index 0000000000..3381f705f2 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden16.h @@ -0,0 +1,40 @@ +/* FRLG AutoStory Plan Golden, Segment 16 + * + * From: https://github.com/PokemonAutomation/ + * + * The golden's lines from segment 16 on, after + * PokemonFRLG_AutoStoryPlanGolden15.h's. The test reads FRLG_PLAN_GOLDEN, + * FRLG_PLAN_GOLDEN_10, _11, _12 and _15, then these. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryPlanGolden16_H +#define PokemonAutomation_PokemonFRLG_AutoStoryPlanGolden16_H + +#include + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + +// The stored plan lines from segment 16 on, after FRLG_PLAN_GOLDEN_15's. +inline constexpr std::string_view FRLG_PLAN_GOLDEN_16[] = { + "16.01 silph_3f_by_pad from SaffronCity_PokemonCenter_1F (7, 4) facing north to SilphCo_3F (5, 6) facing west", + "16.01 walk south 5 (warp) -> SaffronCity (24, 39) [walk only]", + "16.01 walk west 9 (to wall) -> SaffronCity (15, 39)", + "16.01 walk north 7 -> SaffronCity (15, 32)", + "16.01 walk east 18 -> SaffronCity (33, 32)", + "16.01 walk north 2 (warp) -> SilphCo_1F (8, 20)", + "16.01 walk north 15 (to wall) -> SilphCo_1F (8, 5)", + "16.01 walk east 23 -> SilphCo_1F (31, 5)", + "16.01 walk north 3 (to wall) -> SilphCo_1F (31, 2)", + "16.01 walk east 1 (warp) -> SilphCo_2F (30, 2)", + "16.01 walk west 3 (warp) -> SilphCo_3F (28, 2)", + "16.01 walk south 4 -> SilphCo_3F (28, 6)", + "16.01 walk west 23 -> SilphCo_3F (5, 6)", +}; + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows16_Tests.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows16_Tests.h new file mode 100644 index 0000000000..c5a7d77654 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows16_Tests.h @@ -0,0 +1,27 @@ +/* AutoStory Row Tests, Segment 16 + * + * From: https://github.com/PokemonAutomation/ + * + * Registration of the tests that run segment 16's rows on the overworld + * sim, beside PokemonFRLG_AutoStoryRows_Tests.h's earlier stretches. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryRows16_Tests_H +#define PokemonAutomation_PokemonFRLG_AutoStoryRows16_Tests_H + +#include "Common/Cpp/TestRunners/UnitTestDatabase.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// Row 16.01, Silph Co., on the overworld sim (PokemonFRLG_AutoStorySilph_Tests.cpp). +void add_tests_AutoStorySilph(UnitTestDatabase& database); + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif 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 2601bfbe81..ba82ab4fd3 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 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.03 14.03 14.04 15.01"; +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.03 14.03 14.04 15.01 16.01"; 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 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.03 14.03 14.04 15.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.03 14.03 14.04 15.01 16.01"}, }, { .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.03 14.03 14.04 15.01"}, + .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.03 14.03 14.04 15.01 16.01"}, }, { .input = { .name = "Gift RNG: started at 04.03, from the save beside the salesman", @@ -273,7 +273,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.03 14.03 14.04 15.01"}, + .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.03 14.03 14.04 15.01 16.01"}, }, { .input = { .name = "Starter RNG first, with both on", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySilph_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySilph_Tests.cpp new file mode 100644 index 0000000000..d5ccb81d4d --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySilph_Tests.cpp @@ -0,0 +1,124 @@ +/* AutoStory Silph Tests + * + * From: https://github.com/PokemonAutomation/ + * + * Row 16.01 (StoryData/frlg-16.01.plan.json) on the overworld sim: from + * Saffron's nurse into Silph Co., up to 3F and through its pad to 5F. + * + */ + +#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 "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" +#include "PokemonFRLG_AutoStoryEvents.h" +#include "PokemonFRLG_AutoStoryRooms.h" +#include "PokemonFRLG_AutoStoryRowSim.h" +#include "PokemonFRLG_AutoStoryRows_Tests.h" +#include "PokemonFRLG_AutoStoryRows16_Tests.h" +#include "PokemonFRLG_AutoStoryTable.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +struct AutoStorySilphInput{ + std::string name; + std::function body; +}; + +struct AutoStorySilphExpectation{ + std::string_view description; +}; + +struct AutoStorySilphCase{ + AutoStorySilphInput input; + AutoStorySilphExpectation expectation; +}; + +class Test_AutoStorySilph : public UnitTest{ +public: + explicit Test_AutoStorySilph(AutoStorySilphCase 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: + AutoStorySilphCase 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)); +} + +// 16.01 on the sim from Saffron's nurse: Silph Co.'s stairs to 3F, west +// along the hall and onto the pad to 5F, where the player stands on the pad +// that leads back. No trainer is met and no rule is broken. +UnitTestResult test_pad_to_5f(){ + const StoryCheckpoint& row = checkpoint("16.01"); + StoryPose at = *story_pose(Pokemon::pose_of(*row.start)); + OverworldSim sim(story_maps(), MapPosition{at.map, at.tile}, *at.facing); + std::vector floors; + for (const StoryStep& step : row.steps){ + if (const std::string failure = row_step_on_sim(sim, at, step, row.id); !failure.empty()){ + return std::format("16.01: ended on {}; {}", to_string(sim.state().position), failure); + } + floors.push_back(sim.state().position.map); + } + const MapPosition pad{"SilphCo_5F", {15, 7}}; + if (!(sim.state().position == pad)){ + return std::format("16.01: ended on {}, not on 5F's pad {}.", to_string(sim.state().position), to_string(pad)); + } + if (floors != std::vector{"SilphCo_3F", "SilphCo_5F"}){ + return "16.01: the steps ended on the wrong floors."; + } + if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ + return "16.01: met a trainer or broke a rule on the way."; + } + return true; +} + +const AutoStorySilphCase AUTO_STORY_SILPH_CASES[] = { + { + .input = {.name = "16.01 Silph Co.'s stairs to 3F and its pad to 5F", .body = test_pad_to_5f}, + .expectation = {.description = "to 3F's pad (4, 6), onto 5F's (15, 7), nobody met"}, + }, +}; + +} // namespace + + +void add_tests_AutoStorySilph(UnitTestDatabase& database){ + for (const auto& item : AUTO_STORY_SILPH_CASES){ + database.add(item); + } +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp index 316f52c464..ba69349b75 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp @@ -232,7 +232,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.03", "14.03", "14.04", "15.01", + "12.01", "12.02", "12.03", "14.03", "14.04", "15.01", "16.01", }; // `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 963bae040f..1ac9756154 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -39,6 +39,7 @@ #include "PokemonFRLG_AutoStoryPlanGolden11.h" #include "PokemonFRLG_AutoStoryPlanGolden12.h" #include "PokemonFRLG_AutoStoryPlanGolden15.h" +#include "PokemonFRLG_AutoStoryPlanGolden16.h" #include "PokemonFRLG_AutoStoryRows_Tests.h" #include "PokemonFRLG_AutoStoryMoveData.h" #include "PokemonFRLG_AutoStoryStepTable.h" @@ -286,8 +287,8 @@ UnitTestResult check_checkpoint(const StoryCheckpoint& checkpoint, StoryPose& po // before leaves the player, and adds the plans to `golden`. UnitTestResult chain_story_routes(std::vector& golden){ const std::vector& checkpoints = story_checkpoints(); - if (checkpoints.size() != 56 || checkpoints[0].start){ - return "Expected 56 checkpoints, the first from a new game."; + if (checkpoints.size() != 57 || checkpoints[0].start){ + return "Expected 57 checkpoints, the first from a new game."; } StoryPose pose; for (size_t c = 0; c < checkpoints.size(); c++){ @@ -330,6 +331,7 @@ UnitTestResult test_golden_plans(){ golden.insert(golden.end(), std::begin(FRLG_PLAN_GOLDEN_11), std::end(FRLG_PLAN_GOLDEN_11)); golden.insert(golden.end(), std::begin(FRLG_PLAN_GOLDEN_12), std::end(FRLG_PLAN_GOLDEN_12)); golden.insert(golden.end(), std::begin(FRLG_PLAN_GOLDEN_15), std::end(FRLG_PLAN_GOLDEN_15)); + golden.insert(golden.end(), std::begin(FRLG_PLAN_GOLDEN_16), std::end(FRLG_PLAN_GOLDEN_16)); const size_t stored = golden.size(); size_t first_diff = 0; while (first_diff < actual.size() && first_diff < stored && actual[first_diff] == golden[first_diff]){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-16.01.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-16.01.plan.json new file mode 100644 index 0000000000..f218753eaf --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-16.01.plan.json @@ -0,0 +1,81 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "16.01", + "title": "Saffron to Silph Co.: 3F's pad to 9F's, 9F's to 5F's corridor, the CARD KEY", + "start": { + "map": "SaffronCity_PokemonCenter_1F", + "tiles": [ + [ + 7, + 4 + ] + ], + "facing": "north" + }, + "events": [ + { + "id": "silph_3f_by_pad", + "kind": "route", + "action": "run", + "args": { + "target": { + "map": "SilphCo_3F", + "tiles": [ + [ + 5, + 6 + ] + ], + "facing": "west" + } + }, + "why": "out of Saffron's Center, along the city to Silph Co.'s door (33, 30), up its stairs (1F (31, 2), 2F (28, 2)) to 3F and west along the hall to (5, 6), a tile east of the warp pad (4, 6); the hall keeps clear of the Rocket at (25, 9), who faces west along row 9 (pokeguy bikes in and climbs to 3F, 1:27:44)" + }, + { + "id": "pad_3f_to_5f", + "kind": "step", + "args": { + "direction": "west" + }, + "declared_after": { + "map": "SilphCo_5F", + "tiles": [ + [ + 15, + 7 + ] + ], + "facing": "west" + }, + "why": "onto the pad (4, 6), which warps to 5F's (15, 7) (SilphCo_3F map.json warp 1)" + } + ] + }, + "execution": { + "menu": "full", + "notes": { + "checkpoint": [ + "Starts at Saffron's nurse, facing her, where 15.01 ends (healed there, so no Max Elixir or Super Potion on 5F as pokeguy's low-HP run has). Ends on 5F's pad (15, 7), where the pad from 3F leaves the player.", + "PokeGuy (1:27:44 to 1:28:14): stairs to 3F, warp pads via 5F and briefly 9F, back to the 5F corridor, the CARD KEY at 1:28:11. His pad coordinates were not measured; these are read from the decomp (SilphCo_3F, 5F and 9F map.json warps): 3F (4, 6) to 5F (15, 7), then 5F (10, 20) to 9F (22, 18) and back (the pad pair is the only way into 5F's bottom corridor; the Rocket at 3F (25, 9), facing west along row 9, blocks the other way round to 3F's west rooms).", + "Next (16.02, not authored): 5F (15, 7) down column 10 to (10, 19), the pad (10, 20), a step off 9F's pad (22, 18) and back on, east along the corridor to the CARD KEY (22, 21). Open: Beau, the scientist who wanders 5F (10..12, 5..7) with sight 1, sees every way from (15, 7) to column 9 or 10 (the walk cannot tell where he would stop the player: a wait or a battle is needed); the Rocket at (9, 21) looks up and right, and (12, 21) is in his line; and the Card Key doors (5F bg_events (8, 9), (8, 10), (8, 18), (8, 19)) are open tiles on the pack's map, so a planned route could cross a closed door." + ] + } + }, + "metadata": { + "phase": "testing", + "postconditions": { + "position": { + "map": "SilphCo_5F", + "tiles": [ + [ + 15, + 7 + ] + ], + "facing": "west" + } + } + } +} diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index f80a6c3a95..bc62f848ba 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -2062,6 +2062,8 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladonGym_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySaffron_Tests.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySilph_Tests.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows16_Tests.h 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 @@ -2147,6 +2149,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden11.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden12.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden16.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryResources.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryResources.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryResources_Tests.cpp From 18bc82a75df3ae07676fb2c02816e1f400b1907e Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 15:11:28 -0800 Subject: [PATCH 2/3] PokemonFRLG: 16.01 notes the Lapras and Master Ball gifts --- .../Programs/AutoStory/StoryData/frlg-16.01.plan.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-16.01.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-16.01.plan.json index f218753eaf..53e5e76fad 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-16.01.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-16.01.plan.json @@ -59,7 +59,8 @@ "checkpoint": [ "Starts at Saffron's nurse, facing her, where 15.01 ends (healed there, so no Max Elixir or Super Potion on 5F as pokeguy's low-HP run has). Ends on 5F's pad (15, 7), where the pad from 3F leaves the player.", "PokeGuy (1:27:44 to 1:28:14): stairs to 3F, warp pads via 5F and briefly 9F, back to the 5F corridor, the CARD KEY at 1:28:11. His pad coordinates were not measured; these are read from the decomp (SilphCo_3F, 5F and 9F map.json warps): 3F (4, 6) to 5F (15, 7), then 5F (10, 20) to 9F (22, 18) and back (the pad pair is the only way into 5F's bottom corridor; the Rocket at 3F (25, 9), facing west along row 9, blocks the other way round to 3F's west rooms).", - "Next (16.02, not authored): 5F (15, 7) down column 10 to (10, 19), the pad (10, 20), a step off 9F's pad (22, 18) and back on, east along the corridor to the CARD KEY (22, 21). Open: Beau, the scientist who wanders 5F (10..12, 5..7) with sight 1, sees every way from (15, 7) to column 9 or 10 (the walk cannot tell where he would stop the player: a wait or a battle is needed); the Rocket at (9, 21) looks up and right, and (12, 21) is in his line; and the Card Key doors (5F bg_events (8, 9), (8, 10), (8, 18), (8, 19)) are open tiles on the pack's map, so a planned route could cross a closed door." + "Next (16.02, not authored): 5F (15, 7) down column 10 to (10, 19), the pad (10, 20), a step off 9F's pad (22, 18) and back on, east along the corridor to the CARD KEY (22, 21). Open: Beau, the scientist who wanders 5F (10..12, 5..7) with sight 1, sees every way from (15, 7) to column 9 or 10 (the walk cannot tell where he would stop the player: a wait or a battle is needed); the Rocket at (9, 21) looks up and right, and (12, 21) is in his line; and the Card Key doors (5F bg_events (8, 9), (8, 10), (8, 18), (8, 19)) are open tiles on the pack's map, so a planned route could cross a closed door.", + "TODO (RNG gift, later rows): the Lapras Lv25 from the employee on 7F (SilphCo_7F_EventScript_LaprasGuy, FLAG_GOT_LAPRAS_FROM_SILPH) is a Gift RNG shiny target; the Master Ball from the president on 11F is taken too (pokeguy skips both, 1:32:51)." ] } }, From ad81c3b128b2364cb9562de9a31a8015247007e1 Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 20:47:19 -0800 Subject: [PATCH 3/3] FRLG AutoStory: the chain test expects 59 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 36bba720d9..63d0f4f9cd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -287,8 +287,8 @@ UnitTestResult check_checkpoint(const StoryCheckpoint& checkpoint, StoryPose& po // before leaves the player, 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){ - return "Expected 58 checkpoints, the first from a new game."; + if (checkpoints.size() != 59 || checkpoints[0].start){ + return "Expected 59 checkpoints, the first from a new game."; } StoryPose pose; for (size_t c = 0; c < checkpoints.size(); c++){