Skip to content

docs(tilemap): infinite maps guide chapter + procedural terrain examples (Slice 4c)#381

Merged
Exoridus merged 7 commits into
mainfrom
worktree-infinite-maps-slice2
Jul 16, 2026
Merged

docs(tilemap): infinite maps guide chapter + procedural terrain examples (Slice 4c)#381
Exoridus merged 7 commits into
mainfrom
worktree-infinite-maps-slice2

Conversation

@Exoridus

Copy link
Copy Markdown
Owner

Summary

Infinite Maps Slice 4c — docs/content only, no engine code.

  • New guide chapter rendering/infinite-maps: unbounded TileMap/TileLayer semantics, ChunkStreamer (radii/hysteresis/frame budget, determinism pitfall), procedural terrain via createSampledChunkSource (value-noise fBm walkthrough), off-thread sampling via createWorkerSampledChunkSource (workerSource pattern, exactly-once reply pitfall, destroy/CSP notes), Tiled infinite-map streaming, and the retained-container guidance for streamed layers (own group or none).
  • Two playground examples (Kenney map-pack biome tileset, identical deterministic worlds): infinite-terrain (sync provider, seed reroll) and worker-streamed-terrain (sync/worker toggle + sampling-cost slider + frame-time readout to make the main-thread jank difference visible).
  • Cross-page fixes: retained-containers chapter links the streamed-layer caveat; tiled-maps chapter no longer claims infinite maps throw (stale since streaming support landed); stale ldtk-world-import.js twin regenerated.
  • Verified: all typecheck/lint/format gates, site build, playground smoke for both examples in headless Chromium, plus screenshot-based visual verification of the biome tile ids (caught two wrong water tile ids) and of the spritesheet-await fix.

Notes for follow-up (deliberately not in this PR)

  • Pre-existing repo-wide example bug: spritesheet images passed via non-awaiting loader.get() get their sliced frames reset to the full atlas by the Sprite texture-load self-heal (affects ~5 merged examples; root cause analysis in the branch review). This PR's two new examples avoid it by awaiting the texture.
  • scripts/sync-example-capabilities.ts lists webWorkers in its ordering array but has no derivation rule for it.

Exoridus added 7 commits July 16, 2026 07:39
The .ts source gained the unbounded width/height guard when TileLayer went
optional-dimensions, but the committed generated twin was never re-synced.
Surfaced by running examples:sync for the new infinite-terrain example.
…self-heal

A texture passed while unhydrated gets its Spritesheet-sliced frames reset to the full atlas by the Sprite texture-load self-heal once it hydrates. Await the load like the tileset texture already does.
@Exoridus
Exoridus enabled auto-merge (squash) July 16, 2026 15:27
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@Exoridus
Exoridus merged commit 96f4298 into main Jul 16, 2026
17 checks passed
@Exoridus
Exoridus deleted the worktree-infinite-maps-slice2 branch July 16, 2026 15:35
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