Repository navigation
devtools/maps: decode map grids from the pret decompilation, overlay them on the DP images - #83
Merged
Merged
Conversation
…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
force-pushed
the
devtools/map-grid
branch
from
October 30, 2026 14:38
2891457 to
d7c7a0d
Compare
…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
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
marked this pull request as ready for review
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) withgh api, caches them, and prints the data files' C++ rows with the objects placed plus a header comment in the Data/MAPS.md form;overlaynow 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