Skip to content

BDSP navigation v4: story maps, planner and route records on MapData - #127

Draft
dayfine wants to merge 27 commits into
bdsp/maps-v4from
bdsp/nav-v4
Draft

dayfine wants to merge 27 commits into
bdsp/maps-v4from
bdsp/nav-v4

Conversation

@dayfine

@dayfine dayfine commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Depends on #134 (base bdsp/maps-v4); the diff shows only this PR's change.

BDSP navigation rebuilt on #134's JSON maps and the shared MapData, replacing BDSP's own TileGrid, MapSet and per-map C++ constants.

  • StoryWorld joins the maps at world offsets with BDSP's tile rules, in seven methods; walking rules are free functions. occupied() tells people from blocked tiles, and people are no wall to stop against.
  • The route planner moves onto it as BDSP code with the same behaviour (walk_to_wall is now slide_to_wall); plan costs are in PlanCosts.
  • StoryMaps, RouteRecords and Segment00Lines read their tiles through map_point() and map_region() (Route 202's areas are map regions).
  • Pokemon_TileGrid, Pokemon_MapSet, the per-map Data files and MapGrids are gone; what MapData still lacks for BDSP (world offsets, trainer sight) stays in BDSP code.

Testing

  • Suites: StoryWorld, RoutePlanner, StoryMaps and Segment00, locally and in fork CI.
  • Console: nothing in this PR runs on its own; the walls and people it plans around were measured on console B (runs named in the commits).

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

…with tests

The BDSP maps from new game to Floaroma (Twinleaf to Floaroma, the
Oreburgh Mine and Gym, the Ravaged Path), built into the program from
JSON by CMake, their tile grids and the joined StoryMaps world, the
recorded routes and segment 00's walked lines, and the costs the story's
walks are planned with. Carries Pokemon_TileGrid and Pokemon_MapSet
unchanged from the BDSP chain (fork #109).

Tests: the built-in maps parse, and the planned walks out of the catch
area and into Sandgem, the Oreburgh Gym and segment 00's lines plan on
the grids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
PokemonBDSP::add_tests() was never called, so the BDSP map tests did not
run in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine added a commit that referenced this pull request Nov 1, 2026
dayfine and others added 3 commits November 1, 2026 13:23
The story maps, devtools/maps/bdsp_maps.py and the CMake embed are
maps-v4's (add/add conflicts resolved to its versions); this brings in
nav/story-steps (#122) underneath. The per-map grids still load the maps
here until the next commits move them onto the shared MapData.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…MapData

StoryWorld joins story maps at world offsets (what Pokemon::MapSet did),
with BDSP's step rules on Pokemon::TileKind: ledges hop the arrow's way,
water and signs stop, objects standing still block, wanderers don't, and
tiles no map covers are off the maps. RoutePlanner is Pokemon_TileGrid's
planner moved onto it unchanged in behaviour (walk_to_wall,
plan_tile_route, plan_robust_route, sight lines), now in PokemonBDSP;
plan_robust_route's search is split into functions under the length limit.
Synthetic-map tests for both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…s go

StoryMaps, RouteRecords, Segment00Lines and PlanCosts now place
story_map()s in StoryWorlds and take their named tiles from
map_point()/map_region(). The trainers' sight lists move from the per-map
files into StoryMaps. Removed: the per-map Data files, MapGrids, MAPS.md
(its rules are in devtools/maps/bdsp_maps.py), the old MapGrid tests, and
the generic Pokemon_TileGrid and Pokemon_MapSet. The tests are split by
topic: story world, route planner, story maps (with the route records
traced on their maps) and Segment 00's lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine dayfine changed the title BDSP navigation v4: story maps as JSON, grids and plan costs BDSP navigation v4: story maps, planner and route records on MapData Nov 1, 2026
@dayfine
dayfine changed the base branch from nav/shared to bdsp/maps-v4 November 1, 2026 21:41
dayfine and others added 2 commits November 1, 2026 13:50
…s regions

The planner's walk_to_wall() is now slide_to_wall(), so it no longer
shares a name with the walker's walk_to_wall(), which walks on the
console. story_catch_save_area() and story_after_training_area() read
Route 202's regions instead of looping over its tiles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine added a commit that referenced this pull request Nov 1, 2026
Follows the rename in #127; the walker's own walk_to_wall() is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine and others added 5 commits November 1, 2026 14:24
Windows clang -Werror,-Wmissing-designated-field-initializers rejected
test rows that left fields out. The rows' optional fields now have
default member initializers, and the MapObjects built in the story world
tests name all their fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
#122 made Grid's at() read-only and added cell_at() for writes; the
story world and the Ravaged Path's smashed rocks follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ee functions

Code health: StoryWorld had 14 public methods, and its overlap check and
rebuild nested five deep. covered(), standable(), step(), at_wall() and
describe() now take the world as their first argument and read it through
tile() and occupied(); width() and height() are gone. The overlap check and
the painting of a map are split out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine and others added 3 commits November 1, 2026 15:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Like every other .h in the repo; line endings only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
A leg to a wall that ends against someone standing still stops there, but
they may turn and talk or walk off: r29 ran east into Mom, who talked.
Tiles blocked on the console stay walls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine and others added 12 commits November 1, 2026 20:00
…World's seven methods

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
A run west along row 11 went into the lab at (8, 11) (r41, r42).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
nav/shared added the tile kinds OUTSIDE and CLOSED_*, renamed WanderBox
to TileBox and gave MapObject trainer and hide_flag. None of the new
kinds is a ledge; BDSP maps don't use their glyphs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autostory AutoStory programs game:bdsp Brilliant Diamond/Shining Pearl navigation Maps, planner, walker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant