Skip to content

devtools/maps: decode map grids from the pret decompilation, overlay them on the DP images - #83

Merged
dayfine merged 8 commits into
mainfrom
devtools/map-grid
Nov 1, 2026
Merged

dayfine merged 8 commits into
mainfrom
devtools/map-grid

Conversation

@dayfine

@dayfine dayfine commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Depends on #58

Run 1 of the BDSP AutoStory (2026-10-31) showed that grids traced from Bulbapedia's DP map images are 3/4 of a tile per row (12 px rows under 16 px columns, cliffs painted taller than their tiles), so no offset fixes a traced grid, while grids decoded from the Pokemon Platinum decompilation matched the console at every probed anchor. This adds python3 -m devtools.maps decomp <MAP>, which fetches the map's cell(s), matrix and events from pret/pokeplatinum (or pret/pokediamond, whose binary files decode the same way) with gh api, caches them, and prints the data files' C++ rows with the objects placed plus a header comment in the Data/MAPS.md form; overlay now draws a grid with 12 px rows and per-cliff row offsets over the DP image and takes a text grid as its source, and levels.py moves to the README's "maps without a decomp" section. Tested with the package's unit tests (python3 -m unittest discover -s devtools/maps/tests -t ., synthetic Platinum- and Diamond-style trees) and by decoding Route 204 North and the Ravaged Path: the rows match PokemonBDSP_AutoStory_Route204.cpp except its three noted hand edits, and Platinum and Diamond give identical rows.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

dayfine and others added 3 commits October 30, 2026 07:36
…stone examples

Flood-fills walkable pixels into levels, joins them only through stairs,
then plans over 16 px tiles that take a level. Judging tiles by colour
alone had routes climbing rock rims.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…n the floor, console edits

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
… its map; a sandtown profile

A grid off by a row or column plans legs to walls that aren't there
(Route 201 near Sandgem, r130a). python3 -m devtools.maps fetches a
Bulbapedia map by its archive hash path, reads a data file's grid rows,
named tiles and image origin, and draws them over the image as SVG with
the walks a console run planned and walked from SerialPrograms.log,
marking legs planned to a wall that did not stop as blocked. levels.py
gets a sandtown profile for towns on dirt and sand; README notes what it
gets right and wrong on Sandgem against the console-checked grid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine dayfine changed the title devtools: map_grid, draw a navigation grid and logged routes over its map image devtools/maps: level-aware map parser, and grid and route overlays over the map Oct 30, 2026
dayfine and others added 4 commits October 30, 2026 10:09
…yers

Map, route and walk fail differently and are fixed in different places;
the README now says how to tell which failed, how to measure a map with
the Command File Runner's walk, and how to plan routes that end on walls.

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
The tufts' greens on the DP route maps (measured on Route 204) are
walkable and a tile mostly made of them is written as '"' in the grid,
so a route sees where wild encounters are. Before, one of those greens
read as blocked and the tufts' outlines were taken for objects on the
floor, which blocked the whole grass block.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Grids traced from Bulbapedia's DP images have 12 px rows for 16 px
columns and cliffs painted taller than their tiles, so no offset fixes
them; the Platinum decompilation's collision matched the console at
every probed anchor (BDSP AutoStory run 1, 2026-10-31).

`decomp` fetches a map's land data, matrix and events from
pret/pokeplatinum or pret/pokediamond with gh api, caches them, and
prints the data files' C++ rows with the objects placed and a header
comment in the Data/MAPS.md form, or the bare rows. `overlay` takes
12 px rows, per-cliff row offsets and a text grid as its source. The
README leads with decomp first and keeps levels.py for maps no decomp
covers. Tests decode a synthetic map from Platinum-style and
Diamond-style trees.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine dayfine changed the title devtools/maps: level-aware map parser, and grid and route overlays over the map devtools/maps: decode map grids from the pret decompilation, overlay them on the DP images Nov 1, 2026
The five PNGs under examples/ were routes levels.py read off Bulbapedia's
DP images (Veilstone's levels and two Gym routes, Oreburgh's Center to
the mine, Mine B2F to Roark): traced grids with the 3/4-row drift on
maps the decomp covers, and the README names none of them. The text
grids stay, marked as pre-decomp.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine marked this pull request as ready for review November 1, 2026 03:40
@dayfine
dayfine merged commit c9d9657 into main Nov 1, 2026
14 checks passed
@dayfine
dayfine deleted the devtools/map-grid branch November 1, 2026 03:40
dayfine added a commit that referenced this pull request Nov 1, 2026
Co-Authored-By: Claude Fable 5.1 <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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant