Level-of-detail zooming for endless chunked pixel/tile worlds

Scope: how a 2D pixel game can zoom, in steps or continuously, from a region map (a pixel per tile or less) down to single plants and characters, and how chunks are generated, cached and drawn at each level. The notes feed a Tycho engine roadmap. Tycho is plain JS. Each frame it draws through a limited canvas API (fillRect, drawImage, alpha, four blends, transforms, gradients) and bakes everything else offscreen.

Local paths are absolute. Line numbers are from the working trees on 2026-11-03. Elsewhere’s vendor/tycho is at commit 68b29b6 and /Users/david/projects/tycho at c4ab110; the Chunks code cited below sits on the same lines in both.


1. Local precedent: how Merryfolk zooms and how far Tycho supports it

Takeaway

Merryfolk has five fixed zoom steps, [1, 2, 4, 6, 8] screen pixels per world pixel, over a canvas that always holds 2 canvas pixels per world pixel. Its whole LOD scheme is three small switches:

The ground is cached as 256-world-px chunk canvases (16 tiles, not the 32 the comments claim). Each chunk shows a flat sketch first and is then painted nearest-first by a sliced generator under a per-frame millisecond budget. The cache keeps at most 112 chunks (about 1 MB each) and evicts the least recently used. Tycho has a generic LRU chunk cache (Chunks/Painter) and a pinch gesture, but no camera, no zoom and no LOD levels. Its chunk cache also refuses negative or out-of-bounds chunk coordinates, so it cannot hold an endless world as it stands.

Cited Findings

Zoom steps and the canvas

What is dropped at which zoom

Chunk painting, order and eviction

Memory budget

Pinch, wheel and keys in Merryfolk

Tycho’s support

Inferences

Gaps


2. How shipped games do semantic zoom and LOD in 2D

Takeaway

Almost every shipped game that spans region and close-up scales uses separate representations rather than one image filtered down:

Tile pyramids (each zoom level has 4× the tiles of the one above) are the standard structure for continuous web-map zoom.

Cited Findings

Factorio

RimWorld

Dwarf Fortress

Civilization VI

Minecraft maps

— Minecraft Wiki, Map

Distant Horizons (Minecraft LOD mod)

Terraria

— Terraria Wiki, Minimap

Web tile pyramids (Google/OSM slippy maps)

Inferences

Gaps


3. Mipmapping pixel art: box filtering vs representative color vs palette-aware downscaling

Takeaway

Straight mipmaps (box or bilinear averaging) blur pixel art and invent colors outside its palette. Dark outlines turn into mid-tone halos, and small bright marks wash out. Representative-color downscaling (mode/majority, like Minecraft Java’s “most common block”), point sampling (Bedrock), or palette-aware quantization after averaging keep the result inside the palette and crisp.

For far zoom, an object should become a hand-made or derived impostor: a tree as a 2×2 dark-green blob, a house as a roof-colored square, a person as one or two pixels or an icon. A filtered copy of the full sprite is the wrong tool.

Cited Findings

Inferences

Gaps


4. Consistency across levels: the far color must match what is up close

Takeaway

Consistency comes from generating every level from the same position-pure functions of the seed:

The coarse level then evaluates the same functions on a coarser grid, or with the high-frequency octaves dropped, rather than painting something separately. Detail that only exists up close (single plants) should come from a hash keyed by cell, so the far level can compute its density, and therefore its average color, without placing each plant.

Cited Findings

Inferences

Gaps


5. Chunk systems for infinite worlds

Takeaway

Use power-of-two chunks keyed by (level, cx, cy), with a fixed pixel size per chunk at every level (for example 128–256 px), so a level-L chunk covers 2^L times the world span. Then:

Merryfolk and Tycho already cover the single-level case; what is missing is the level dimension and unbounded coordinates.

Cited Findings

Inferences

Gaps


6. Transitions: integer steps vs continuous zoom, crossfades, crisp pixels at non-integer scale

Takeaway

Integer (or 2^n) zoom steps keep pixel art perfectly crisp and are what Merryfolk and Elsewhere’s view already do. Continuous zoom needs either:

Between LOD levels, crossfade the two baked levels with globalAlpha over a short span. That is within Tycho’s frame API.

Cited Findings

Inferences

Gaps


7. Touch controls: pinch anchored on the fingers, and wheel steps

Takeaway

Anchor a zoom by recording the world point under the focus (the pinch midpoint or the cursor) at the start, then re-solve the camera after every zoom change: cam = world - screen/zoom. Compute stepped pinch zoom from the cumulative distance ratio since the gesture began, snapped to the nearest step (with optional hysteresis). Accumulate wheel input into a threshold, with a smaller threshold for trackpad pinch (ctrlKey). Merryfolk has all of this working.

Cited Findings

Inferences

Gaps