From eb9e957395d09e76f1faeaf8f5b73541347d32f3 Mon Sep 17 00:00:00 2001 From: dayfine Date: Sun, 8 Nov 2026 20:17:23 -0800 Subject: [PATCH] BDSP AutoStory: pin PokemonSimulation's Floaroma couple fix; drop the sim ground Bump the BDSP map pin to PokemonSimulation 7209388 (#76), which moves Floaroma's old couple a column east: old man (3, 25), old woman (4, 25). 01.11's walk west now stops at the field's edge on the map (x 0), and 4 taps east land on her column, so the sim-only extra column west of the map goes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonBDSP_AutoStory_StoryTable.cpp | 8 +- .../PokemonBDSP_AutoStory_GridSim_Tests.cpp | 13 ++-- .../PokemonBDSP_AutoStory_SimGround.cpp | 75 ------------------- .../PokemonBDSP_AutoStory_SimGround.h | 45 ----------- .../PokemonBDSP_AutoStory_StorySim_Tests.cpp | 16 +--- SerialPrograms/cmake/SourceFiles.cmake | 2 - devtools/maps/map-resources.lock.json | 4 +- 7 files changed, 15 insertions(+), 148 deletions(-) delete mode 100644 SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimGround.cpp delete mode 100644 SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimGround.h diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryTable.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryTable.cpp index 1306b106c2..bd7f61ccb7 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryTable.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryTable.cpp @@ -888,13 +888,13 @@ std::vector to_oreburgh(){ }; } -// 01.11: the old woman (3, 25), the old man (2, 25) west of her (r251a). 8 taps west from the banner's x 10..12 ended below -// him (lab-B 2026-11-08 18:41). The field's edge is 3 taps west of him (westedge batch 2026-11-08): x = -1, off the map. -// TODO(map points): the field goes on west of the map (the sim adds it, sim_ground()), or the couple stand a tile east. +// 01.11: the old woman (4, 25), the old man (3, 25) west of her (r251a; columns from the westedge batch 2026-11-08, +// PokemonSimulation#76). 8 taps west from the banner's x 10..12 ended below him (lab-B 2026-11-08 18:41), so the walk +// clips to the field's west edge (x 0) and taps east to her column. StoryCheckpoint floaromas_old_couple(){ const Pose below_the_old_woman = next_to(FLOAROMA, "old_woman", SOUTH, NORTH); const Pose below_the_old_man = next_to(FLOAROMA, "old_man", SOUTH, NORTH); - const Pose at_the_field_edge = Pokemon::tile_pose(FLOAROMA, {TilePos{-1, 27}, TilePos{-1, 28}, TilePos{-1, 29}}, WEST); + const Pose at_the_field_edge = Pokemon::tile_pose(FLOAROMA, {TilePos{0, 27}, TilePos{0, 28}, TilePos{0, 29}}, WEST); return row("01.11", "Floaroma's old couple", into_floaroma(), { anchored(to_walls("west_to_the_field_edge", {{.direction = WEST, .tiles = 13}}, "until the field's edge stops us"), at_the_field_edge), legs("below_her_column", {{.direction = EAST, .tiles = 4}}, "4 taps east to her column (westedge batch 2026-11-08)"), diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_GridSim_Tests.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_GridSim_Tests.cpp index 177439cd52..7e26ac9b84 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_GridSim_Tests.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_GridSim_Tests.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -24,7 +23,6 @@ #include "PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_PlanCosts.h" #include "PokemonBDSP_AutoStory_GridSim.h" #include "PokemonBDSP_AutoStory_OldStorySteps.h" -#include "PokemonBDSP_AutoStory_SimGround.h" #include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.h" #include "PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryExecutor.h" #include "PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryPlaces.h" @@ -597,22 +595,21 @@ UnitTestResult test_gate_walk_part_tile_off(Logger&){ // lab-B 2026-11-08 18:41: 01.11's 8 taps west, then north, ended below the // old man, and no one answered the old woman's talk. Floaroma's banner // stops us on any of (10..12, 27..29): the old taps miss her from x 10 and -// 12; the table's walk west to the field's edge and 4 taps east end below +// 11; the table's walk west to the field's edge and 4 taps east end below // her from all nine. UnitTestResult test_old_couple_from_each_arrival(Logger& logger){ const std::optional table = table_steps("01.11", "west_to_the_field_edge", "old_woman"); - const auto ground = std::ranges::find(sim_ground(), std::string("FloaromaTown"), &SimGround::map); - if (!table || table->steps.empty() || ground == sim_ground().end()){ - return "01.11 has no walk west to the field's edge, or Floaroma no ground west of its map."; + const StoryWorld* world = story_plan_world("FloaromaTown", "FloaromaTown"); + if (!table || table->steps.empty() || world == nullptr){ + return "01.11 has no walk west to the field's edge, or Floaroma no map."; } const TableSteps old_taps{table->start, {old_west_along_the_field(), table->steps.back()}}; - const std::unique_ptr world = with_ground(*story_plan_world("FloaromaTown", "FloaromaTown"), *ground); const TilePos below_her = story_to_world(*world, "FloaromaTown", map_point("FloaromaTown", "old_woman").next(Direction::SOUTH)); for (int x = 10; x <= 12; x++){ for (int y = 27; y <= 29; y++){ const TilePos start = story_to_world(*world, "FloaromaTown", {x, y}); const std::string old_miss = walk_misses(*world, old_taps, start, {{"up_to_the_old_woman", below_her}}, logger); - if (old_miss.empty() != (x == 11)){ + if (old_miss.empty() != (x == 12)){ return std::format("The old taps from ({}, {}): {}", x, y, old_miss.empty() ? "ended below her." : old_miss); } const std::string miss = walk_misses(*world, *table, start, {{"up_to_the_old_woman", below_her}}, logger); diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimGround.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimGround.cpp deleted file mode 100644 index bf45e6068a..0000000000 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimGround.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* BDSP AutoStory - Simulated ground - * - * From: https://github.com/PokemonAutomation/ - * - */ - -#include -#include "Common/Cpp/Exceptions.h" -#include "PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryPlaces.h" -#include "PokemonBDSP_AutoStory_SimGround.h" - -namespace PokemonAutomation{ -namespace NintendoSwitch{ -namespace PokemonBDSP{ - -using Pokemon::TileKind; -using Pokemon::TilePos; - - -const std::vector& sim_ground(){ - static const std::vector ground{ - // Floaroma's flower field goes on a column west of the map: from - // below the old man (2, 26), taps west moved 3 tiles and the 4th - // bumped (westedge batch 2026-11-08). - {.map = "FloaromaTown", .tiles = {{-1, 26}, {-1, 27}, {-1, 28}, {-1, 29}}, .row = "01.11"}, - }; - return ground; -} - -namespace{ - -// The offset `map` is placed at on `world`: a wall placed at offset (0, 0) -// of a copy shows where that offset lands. -TilePos placed_at(const StoryWorld& world, const std::string& map){ - Pokemon::MapData probe; - probe.name = "probe"; - probe.tiles = Pokemon::Grid{1, 1, {TileKind::WALL}}; - StoryWorld copy = world; - copy.add(probe.name, probe, {0, 0}); - const TilePos corner = story_to_world(copy, map, {0, 0}); - const TilePos zero = copy.to_world(probe.name, {0, 0}); - return {corner.x - zero.x, corner.y - zero.y}; -} - -} // namespace - -std::unique_ptr with_ground(const StoryWorld& world, const SimGround& ground){ - if (ground.tiles.empty()){ - throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "No ground beside " + ground.map + "."); - } - TilePos low = ground.tiles.front(); - TilePos high = ground.tiles.front(); - for (const TilePos& pos : ground.tiles){ - low = {std::min(low.x, pos.x), std::min(low.y, pos.y)}; - high = {std::max(high.x, pos.x), std::max(high.y, pos.y)}; - } - Pokemon::MapData strip; - strip.name = ground.map + " ground"; - const int width = high.x - low.x + 1; - const int height = high.y - low.y + 1; - strip.tiles = Pokemon::Grid{width, height, std::vector((size_t)width * height, TileKind::WALL)}; - for (const TilePos& pos : ground.tiles){ - Pokemon::cell_at(strip.tiles, {pos.x - low.x, pos.y - low.y}) = TileKind::OPEN; - } - const TilePos corner = placed_at(world, ground.map); - auto out = std::make_unique(world); - out->add(strip.name, strip, {corner.x + low.x, corner.y + low.y}); - return out; -} - - - -} // namespace PokemonBDSP -} // namespace NintendoSwitch -} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimGround.h b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimGround.h deleted file mode 100644 index 2647626983..0000000000 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimGround.h +++ /dev/null @@ -1,45 +0,0 @@ -/* BDSP AutoStory - Simulated ground - * - * From: https://github.com/PokemonAutomation/ - * - * Ground the story's maps lack that the console showed, for the story - * simulation to walk on: tiles past a map's edge, as a map of their own - * beside it. - * - */ - -#ifndef PokemonAutomation_PokemonBDSP_AutoStory_SimGround_H -#define PokemonAutomation_PokemonBDSP_AutoStory_SimGround_H - -#include -#include -#include -#include "Pokemon/Navigation/Pokemon_Grid.h" -#include "PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_StoryWorld.h" - -namespace PokemonAutomation{ -namespace NintendoSwitch{ -namespace PokemonBDSP{ - - -// Open `tiles` of `map` (a JSON map's name), in its own coordinates past -// its edge, from story row `row` on. -struct SimGround{ - std::string map; - std::vector tiles; - std::string row; -}; - -// The ground the story's maps lack. -const std::vector& sim_ground(); - -// A copy of `world`, which holds `ground`'s map, with `ground`'s tiles -// beside that map. Throws InternalProgramError for no tiles. -std::unique_ptr with_ground(const StoryWorld& world, const SimGround& ground); - - - -} // namespace PokemonBDSP -} // namespace NintendoSwitch -} // namespace PokemonAutomation -#endif diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim_Tests.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim_Tests.cpp index a1d993191b..5f6a1a86b7 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim_Tests.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim_Tests.cpp @@ -42,7 +42,6 @@ #include "PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_Maps.h" #include "PokemonBDSP_AutoStory_GridSim.h" #include "PokemonBDSP_AutoStory_OldStorySteps.h" -#include "PokemonBDSP_AutoStory_SimGround.h" #include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.h" #include "PokemonBDSP/Programs/AutoStory/Actions/PokemonBDSP_AutoStory_Events.h" #include "PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryExecutor.h" @@ -440,7 +439,7 @@ class SimExecutor : public Pokemon::StoryStepExecutor{ GridSim m_sim; SimStoryStepIO m_io; StoryWalkSteps m_walks; - // The planner's worlds with sim_people() and sim_ground() on them, by world and who. + // The planner's worlds with sim_people() on them, by world and who. mutable std::map, std::unique_ptr> m_peopled; // The steps of this row that have run. std::set m_ran; @@ -471,21 +470,14 @@ const StoryWorld* SimExecutor::sim_world(const std::string& map) const{ who += person.name + ";"; } } - const SimGround* ground = nullptr; - for (const SimGround& item : sim_ground()){ - if (world != nullptr && m_row >= item.row && story_plan_world(item.map, item.map) == world){ - ground = &item; - who += item.map + " ground;"; - } - } - if (who.empty()){ + if (here.empty()){ return world; } std::unique_ptr& peopled = m_peopled[{world, who}]; if (!peopled){ - peopled = ground != nullptr ? with_ground(*world, *ground) : std::make_unique(*world); + peopled = std::make_unique(*world); for (const SimPerson& person : here){ - peopled->block(story_to_world(*peopled, person.map, person.tile)); + peopled->block(story_to_world(*world, person.map, person.tile)); } } return peopled.get(); diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 3cf67423fd..ce5d08921a 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1712,8 +1712,6 @@ file(GLOB LIBRARY_SOURCES Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryPlaces.h Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_OldStorySteps.cpp Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_OldStorySteps.h - Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimGround.cpp - Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_SimGround.h Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim_Tests.cpp Source/PokemonBDSP/Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySim_Tests.h Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_StoryTable_Tests.cpp diff --git a/devtools/maps/map-resources.lock.json b/devtools/maps/map-resources.lock.json index 08e0421209..1efcb689ef 100644 --- a/devtools/maps/map-resources.lock.json +++ b/devtools/maps/map-resources.lock.json @@ -3,9 +3,9 @@ "repository": "dayfine/PokemonSimulation", "games": { "bdsp": { - "revision": "4de7742a764d27293b4525d6ad2a6fc8a95f3e3a", + "revision": "72093886bc7bc80497aff770d803a753e7e4bca7", "manifest_path": "data/maps/runtime-manifest.json", - "manifest_sha256": "db6894b6e6c49a6ac7b7661d117a3514ebac2241c8c9311d9c101208abab35ad" + "manifest_sha256": "0ce25ea46dc00d91d5d8587c6f00f322490ca35b8d0ad9778588133a9f55d00f" } } }