Repository navigation
feat: convert tiled maps to the collision contract - #96
Merged
Merged
Conversation
Give collision authors a deterministic export for all docs/13 layer shapes, using stage pixels and explicit region, chunk and state metadata. Reject malformed geometry before writing output and cover the conversion, CLI, bounds and existing-output preservation with tests.
Rusty Creek annotations now carry pickup item names, patrol bounds and trigger notes. Preserve these custom values instead of silently discarding them during conversion. Decode Tiled 1.12 typed lists to plain arrays and reject custom properties that would override authored geometry. Add regression coverage for both behaviours.
Member
|
Lane A answers (Alexander + Claude).
No changes needed here. It's ready for Alexander to merge. |
arudaev
self-requested a review
October 23, 2026 20:30
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.
What and why
Convert a finite orthogonal Tiled JSON map into the docs/13 collision schema so Lex can draw collision over the stage instead of editing coordinate arrays. All eleven object layers map to the existing contract. Reference image layers are ignored; no art files were generated or changed in this PR.
Issue
Closes #92
Acceptance criteria
python scripts/collision_from_tiled.py <export.tmj>writesart/stages/<region>/<chunk>.<state>.collision.jsonVerification
py -3.13 -m unittest discover -s scripts -p "test_*.py"— 30 tests pass, including 14 converter testspy -3.13 scripts/check_docs.py— 382 files passgit diff --cached --checkd02f76800704cf88945e4c78b8c260e804e4d214: authored JSON → synthesized Tiled 1.12 JSON → this converter reproduces every field and value exactly. Custom pickupitem, spawnpatrol, and triggernotemetadata are retained. Typed list entries are decoded to plain arrays; custom properties cannot override geometry..tmj; runtime overlay belongs to [M1-S6] Load collision annotation per chunk, with a debug overlay #34Game files are unchanged and the scaffold is still pending in #94, so there is no game build on this independent branch.
Authoring setup / question
The existing collision schema stays unchanged. Destination metadata was unspecified: this implementation reads string map properties
region,chunk,state. Example:rusty-creek,rc-0-0,anomaly. Is that acceptable for Lex's Tiled files? The CLI help documents this setup.kind,id, and hazarddamageare object properties; an object's name can supply its ID. Box layers use Tiled rectangles, not polygons or polylines. Image layers can show the composed stage as a backdrop. Other object custom properties are preserved. Lists use Tiled 1.12 typed list properties, e.g. apatrollist containing two integer items. No implicit JSON-string parsing is performed.Screenshots
No visible game change. Real overlay evidence remains pending the annotation and #34.