Skip to content

BDSP AutoStory maps: the story maps as generated JSON, read through MapData - #134

Draft
dayfine wants to merge 20 commits into
nav/story-stepsfrom
bdsp/maps-v4
Draft

dayfine wants to merge 20 commits into
nav/story-stepsfrom
bdsp/maps-v4

Conversation

@dayfine

@dayfine dayfine commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Depends on #122 (base nav/story-steps); the diff shows only this PR's change.

BDSP's 21 story maps (16 outdoor and cave maps, 5 interiors) as JSON generated from the decompilations by a script anyone can rerun, read through the shared MapData.

  • devtools/maps/bdsp_maps.py writes each map from pret/pokediamond, since BDSP keeps Diamond/Pearl's layout; the five interiors and the Ravaged Path come from pret/pokeplatinum. --check regenerates and fails on any difference.
  • Each map carries named points and regions, the people BDSP shows, and its coord_events (the scene triggers) from the events files, with Diamond's story variables named from pokeplatinum's generated/vars_flags.txt.
  • Hand tables on top of the decomp: COORD_EVENTS names the triggers the story uses and adds ones found on the console (add: Mom's call at (6, 9), r45/r46); PATCHES holds console-measured tiles with the run that found them (PlayerHouse1F (4, 8) open, r32; Route 201's row 18 trees and sign, r16; Route 202's catch patch and Route 204 North's grass).
  • devtools/maps/decomp.py (fork devtools/maps: decode map grids from the pret decompilation, overlay them on the DP images #83, on main) learns coord events and Diamond's variable names.
  • A small loader (story_map(), map_point(), map_region()) embeds the JSON and reads it through MapData; the unit test runner now calls PokemonBDSP::add_tests().

Testing

  • bdsp_maps.py --check passes for all 21 maps; the Python tests in devtools/maps/tests pass.
  • C++: the BDSP Maps suite.
  • Console: the patches and the added coord event are each from a named console run; the interiors are otherwise the decomp's and not walked tile by tile.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

dayfine and others added 3 commits November 1, 2026 13:20
devtools/maps/bdsp_maps.py writes each map from its world rectangle of the
pret/pokediamond decompilation (Platinum's for the Ravaged Path), with the
named points and regions the story walks to, the objects BDSP shows, and
the tiles the console measured as patches. --check regenerates them and
fails on any difference.

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

PokemonBDSP_AutoStory_Maps reads the embedded JSON through the shared
MapData loader: story_map(), map_point(), and map_region() for the numbered
points a region is written as. The tests load every map, check that points
and objects stand where they can, and that the lookups find and refuse
what they should. PokemonBDSP::add_tests() is now run by the unit test
runner, which never called it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The player's and Barry's houses (both floors) and Rowan's lab, from
pokeplatinum at c6689696d5fb, decomp only and not yet checked on the
console: their stairs, doors and the tiles the story talks from, and the
doors' warps to Twinleaf's and Sandgem's door points. The map tests check
that every warp leads to a point that exists.

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 13:49
catch_save_area, after_training_area, catch_grass and jubilife_exit were
computed by the story code from tile loops; they are now regions of
Route202, and a map test checks each against the loop it replaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
GCC -Werror=dangling-reference flagged story_map("Route202") bound to a
reference: with a const std::string& parameter, the temporary string looks
like what the result refers to. string_view arguments are not flagged;
callers are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine and others added 9 commits November 1, 2026 15:15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
v3's Mart lady walk went west along that row past the mat on console;
r42's entry is likely a story trigger or the run, not the map.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The commit before this one, misnamed "Revert ...", put a door at (8, 11);
v3's Mart lady walk went west past that mat on console, so it goes.

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 made a warp's destination optional (left out for a map not
loaded). Every BDSP warp still has to lead to a point that exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The cell list stepped 32 tiles from the rectangle's corner, so a rectangle
not starting on a cell edge missed its last cell: Route203.json named
narc_0016 and narc_0019 but not narc_0020. Its tiles are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
(cherry picked from commit 6517171)
…tches

Both files had their console measurements (r32's open tile in the house,
r16's trees and sign on Route 201) edited into the tiles by hand, so
bdsp_maps.py --check failed for them. The generator's PATCHES table now
holds them; the tiles go back to the decomp's and the loader applies the
patches, so the walked grid is unchanged. --check passes for all 21 maps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
(cherry picked from commit 1f14bca)
Each map JSON now lists its events file's coord events (the scene
triggers) under "coord_events": local box, story variable and value, and
a source naming the file, index, world tile and script. Diamond's events
files carry them after the warps; their variable numbers are named from
pokeplatinum's generated/vars_flags.txt, which agrees with Platinum's own
events on every trigger both games have. The five interiors read
pokeplatinum's JSON. COORD_EVENTS names the triggers the story uses and
adds Mom's call (6, 9) in the player's house, found on the console (r45,
r46), so hand-measured triggers survive regeneration. The shared map
loader ignores the key.

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
dayfine added a commit that referenced this pull request Nov 3, 2026
00.05 starts from a save at (48, 62), below Jubilife's steps (45..47, 61)
against the wall east of them, where 00.04d's Dawn scene now says it
leaves us: the old event went "a tile west, then up the steps" from
there, two taps north (2026-10-30). That tile is the event's numbers on
the map, not a measured one (#134).

up_the_steps is a LEGS step of the same taps, a tile west and two north,
ending on (47, 60); the route to the Center plans from that one tile,
not the steps' region (46..47, 58..60).

Events_Jubilife.cpp keeps only 00.05b's wandering clowns. The Events
header lists what stays named and why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine added this pull request to stack #230 November 5, 2026 18:39
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