Repository navigation
PokemonBDSP AutoStory: story worlds also as connected maps - #411
Conversation
Maps joined by their warps and edges, with the player's place as a map and a tile of it. Where a warp or an edge leads is computed once here; whether a step is allowed stays per game. connect_by_world() joins maps placed on one world grid, for BDSP's maps, which have no connections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…edge entry split out Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Each StoryWorld now keeps its maps as Pokemon::ConnectedMaps too, joined where they meet on its grid, so the planner can move to a map and a tile (seam 2's one world type). Nothing reads it yet; a test checks that on the story's worlds every step off a map's edge lands where the grid puts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…dge check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Conflict in SourceFiles.cmake: kept both file lists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Conflict in the registration lists (SerialPrograms/cmake/SourceFiles.cmake ): kept both sides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 27e7ac5
Reviewed against bdsp/autostory-v4. The Pokemon_ConnectedMaps* files in the diff are #408's, merged in (byte-identical to #408's head), and are reviewed there.
Verdict
APPROVED (LGTM to merge, after #408)
Nothing reads connected_maps() yet, so plans are unchanged and the plan golden is untouched by this diff. The new test is a good one: on six real story worlds it checks every off-edge step agrees between the stitched grid and the connected maps, which is exactly the invariant the next PR relies on. Code Health: 0 failures (advisory: StoryWorld::add() 26 lines, header at 7 names).
Findings (non-blocking)
- (Low) Test dereferences
story_plan_world()unchecked.*story_plan_world("TwinleafTown", "Route202")is UB if a pair is renamed or dropped; check for null and fail with the missing pair's names. - (Low) Test structs:
ConnectedWorldExpectation::connectionshas no initializer;.input = {"…", story_maps}is positional (use.name = …, .world = …);ConnectedWorldInput::namecan bestd::string_viewlike the other suites. - (Low, for the next PR)
connected_maps()documents that blocked tiles and tiles taken off the maps are not in the connected maps. Once the planner moves onto them,StoryWorld's blocking must be applied in the step model, or plans will walk through blocked tiles. Worth a test in that PR that a blocked tile stops a step on both representations. - (Nit) The same temporary issue as #408 finding 1 applies one level up:
connected_maps(some_temporary_world())returns a view into a destroyedStoryWorld. DeletingConnectedMaps' rvalue constructor does not catch this; aconnected_maps(StoryWorld&&) = delete;would.
Notes
- Fork Draft CI is red from the base (
Duplicate Test Name: PokemonBDSP::ShortDialogDetector …, same onbdsp/autostory-v4), so the suites ran only locally.
…exes, orders MapPlace (#408 review) The rvalue constructor is deleted, map() throws InternalProgramError past the last map, and MapPlace gets a defaulted <=> over TilePos's. The test art matches the maps, the Lake to Route edge has two cases, and stale map indexes have their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
… connected_maps() refuses temporaries (#411 review) Each row names its plan world's two places, and a pair that is renamed or dropped fails with their names instead of dereferencing null. Test fields get defaults and designated names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…ealth) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
|
Review addressed at 60a1a5b (fix: d76aa60, plus #408's update merged in).
Also merged: the #128 base fixes (the duplicate BDSP detector registration and the GCC dangling-pointer fix). Local headless run of the PokemonBDSP::AutoStory and StoryData suites is green, golden included. Code health: 0. |
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 60a1a5b
Delta since my review at 27e7ac5: the base and parent merges bb345f7, 0ec0e42 and 60a1a5b, plus the fix d76aa60. The PR's own BDSP files differ from 27e7ac5 only by d76aa60. The Pokemon_ConnectedMaps* files match origin/nav/connected-maps exactly, so they were reviewed in #408.
Verdict
APPROVED (LGTM to merge, after #408 / its parent chain)
Earlier points:
- Unchecked
story_plan_world(): resolved. A row names.plan_from/.plan_to, and a null result fails with "No story plan world from X to Y."story_plan_world()returns a pointer to a long-lived world, so the reference taken from it is safe. - Test structs: resolved.
connections = 0, the rows use designated.name/.world/.plan_from/.plan_to, andnameis astd::string_view. - Blocked tiles once the planner moves onto connected maps: noted for #413. That's fine while
RobustWorldModelstill steps throughStoryWorld::step(). - Temporaries: resolved.
connected_maps(StoryWorld&&) = delete;is added.
Checks: Fork Draft CI on 60a1a5b is green with no FAILED lines. All six "Story world as connected maps" rows pass, as do the 17 Pokemon::ConnectedMaps cases and "plans match the golden". The red "Runtime map reader" (native-schema) job fails on the base too and is not from this PR.
Findings (optional)
- (Nit)
ConnectedWorldInputnow takes its world from either a function pointer or a place pair, chosen byworld != nullptr. The comment covers it. Two rows (story_maps,jubilife_maps) use the pointer; if more cases come, astd::variantor two small row kinds would make the either-or explicit. Not blocking.
…er) into bdsp/start-certainty BDSP's robust routes now plan on Pokemon::plan_robust_legs. The held open legs this line added to BDSP's own planner (#375: hold_open_legs, per_open_grass_tile, open_hold_error(), TileLeg::held) move into the shared planner as RobustLegCosts::hold_open_legs / per_open_wild_tile and RobustLeg::held, off by default, so BDSP plans the same legs as before. SourceFiles.cmake keeps both sides' new files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Depends on #408.
Base:
bdsp/autostory-v4, withnav/connected-maps(#408) merged in; until #408 lands there the diff also shows its files.AutoStory seam 2, PR1b. BDSP's maps carry no connections: a story world stitches them onto one grid at their decomp corners, and the planner works on world tiles. Each
StoryWorldnow also keeps its maps asPokemon::ConnectedMaps(connected_maps(world)), joined byconnect_by_world()where they meet on its grid, so the next PR can plan BDSP on a map and a tile like FRLG. Nothing reads it yet, so plans are unchanged. Tested in the headless runner with thePokemonBDSPandPokemon::ConnectedMapssuites: the plan golden (#392) passes unchanged; a new test checks, on six story worlds (Twinleaf to Route 202, Route 203 into Jubilife, both halves of Route 204, and two single-map worlds), that every step off a map's edge lands on the same map and tile as on the grid, and counts each world's connections; the only failures are image tests without fixtures.🤖 Generated with Claude Code
https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss