Tiled P6 — infinite/chunked maps, .world stitching, base64+zstd #74
Labels
No labels
area:ci
area:docs
area:input
area:net
area:rendering
area:repo
area:stdlib
area:tooling
area:types
cleanup
dx
priority:high
priority:low
priority:medium
proposal
status:in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: workshopsoft/ludic#74
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up P6 of the Tiled design (#66). Design record: Design: Tiled maps §3.10.
Scope — scale
<chunk x y width height>(TMX) and JSONchunks[](default 16×16) and flatten into thert_tmapdense array (or a sparse chunk store if memory demands)..worldstitching:maps[] {fileName,x,y}andpatterns[] {regexp,multiplier,offset,mapWidth,mapHeight},onlyShowAdjacentMaps— for streaming/large levels (JSON, reusesJson.parse).Golden fixtures
Hand-authored infinite/
<chunk>(TMX + JSONchunks[]);sticker-knight.world; base64+zstd fixture (design §4).Acceptance
.worldstitches its member maps at the right offsets.Depends on #69. Priority low.
P6 landed in
main(764a029) — the final Tiled phase.<chunk x y width height>(TMX) and JSONchunks[]decode and flatten into the dense layer array, sized to the chunk union; the map's0/0header dimensions fall back to the flattened bounds..worldstitching —Tiled.world/Tiled.world_count/Tiled.world_mapread a.world(JSON, reusingJson.parse) and list its member maps at their world offsets.runtime/native/zstd.ludic, RFC 8878,z_zstd): frame header + raw/RLE/compressed blocks; raw/RLE + direct-weight Huffman literals; the full FSE sequence path — predefined tables (transcribed verbatim from zstd's hardcoded constants, since the encoder shares a specific spread that isn't reproducible by rebuilding from the default distributions), RLE, and FSE-described — with repeat offsets and sequence execution. It decodes the low-entropy GID streams a tilemap produces; a high-entropy FSE-compressed-Huffman-weights block fails cleanly with-1rather than emitting wrong bytes (documented scope).Acceptance
<chunk>s (and the JSONchunks[]equivalent) flatten to the same 32×16 layer..worldstitches its member maps at the right offsets —demo.worldlistszstd_map.tmx@ x=0 andgrid_maze.tmx@ x=384.Proven by
examples/library/tiled_p6.ludic(12 assertions) inx test(97 passed).This completes the whole Tiled arc (#67–#74). Native TMX/TSX/TX and TMJ/TSJ/TJ both read onto one
Value-tree intermediate → thert_tmapruntime model; theTiled.*namespace covers load, GID resolve (flips), render (with animation + tile objects), per-tile / property / layer collision intoesys_move, objects/shapes/properties/custom-types/templates/opt-in-spawn, image/group layers, iso/hex/staggered coords, Wang GIDs, chunks,.world, and gzip/zlib/zstd compression.x testis at 97 passed;check-impl/check-docs/check-vocabularygreen; the self-host bootstrap fixpoint is intact.