Skip to content

PokemonBDSP AutoStory: story worlds also as connected maps - #411

Merged
dayfine merged 16 commits into
bdsp/autostory-v4from
bdsp/connected-maps
Nov 12, 2026
Merged

dayfine merged 16 commits into
bdsp/autostory-v4from
bdsp/connected-maps

Conversation

@dayfine

@dayfine dayfine commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Depends on #408.

Base: bdsp/autostory-v4, with nav/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 StoryWorld now also keeps its maps as Pokemon::ConnectedMaps (connected_maps(world)), joined by connect_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 the PokemonBDSP and Pokemon::ConnectedMaps suites: 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

dayfine and others added 7 commits November 11, 2026 20:31
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
dayfine and others added 2 commits November 11, 2026 21:41
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 dayfine left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

  1. (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.
  2. (Low) Test structs: ConnectedWorldExpectation::connections has no initializer; .input = {"…", story_maps} is positional (use .name = …, .world = …); ConnectedWorldInput::name can be std::string_view like the other suites.
  3. (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.
  4. (Nit) The same temporary issue as #408 finding 1 applies one level up: connected_maps(some_temporary_world()) returns a view into a destroyed StoryWorld. Deleting ConnectedMaps' rvalue constructor does not catch this; a connected_maps(StoryWorld&&) = delete; would.

Notes

  • Fork Draft CI is red from the base (Duplicate Test Name: PokemonBDSP::ShortDialogDetector …, same on bdsp/autostory-v4), so the suites ran only locally.

dayfine and others added 7 commits November 12, 2026 00:15
…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
@dayfine

dayfine commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Review addressed at 60a1a5b (fix: d76aa60, plus #408's update merged in).

  1. Each row now names its plan world's two places (.plan_from/.plan_to) instead of a wrapper that dereferences. A null story_plan_world() fails with "No story plan world from X to Y."
  2. The test structs: connections = 0, the designated .name/.world/.plan_from/.plan_to, and std::string_view name.
  3. Noted for the planner PR: blocked tiles must be applied in the step model. PokemonBDSP AutoStory: plan robust routes with the shared robust leg planner #413's RobustWorldModel still reads StoryWorld's own step(), so blocking applies there today.
  4. Added connected_maps(StoryWorld&&) = delete;.

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 dayfine left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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.
  2. Test structs: resolved. connections = 0, the rows use designated .name/.world/.plan_from/.plan_to, and name is a std::string_view.
  3. Blocked tiles once the planner moves onto connected maps: noted for #413. That's fine while RobustWorldModel still steps through StoryWorld::step().
  4. 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)

  1. (Nit) ConnectedWorldInput now takes its world from either a function pointer or a place pair, chosen by world != nullptr. The comment covers it. Two rows (story_maps, jubilife_maps) use the pointer; if more cases come, a std::variant or two small row kinds would make the either-or explicit. Not blocking.

@dayfine
dayfine merged commit a84a6fc into bdsp/autostory-v4 Nov 12, 2026
14 of 17 checks passed
dayfine added a commit that referenced this pull request Nov 12, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant