design: spherical (wrapping) world topology — equirectangular pole-wrap #233

Open
opened 2026-08-01 08:48:42 +02:00 by panda · 0 comments
Collaborator

Requirement

The world is a planet: reaching a map edge comes out the other side. Owner's call: spherical. The editor still shows a rectangle.

Honest geometry

A uniform square grid cannot perfectly tile a sphere (Euler characteristic / curvature) — every rectangle→sphere mapping distorts somewhere. Options:

  • Equirectangular + pole wrap (chosen, single rectangle): east-west wraps as longitude; crossing the N/S edge crosses the pole to the opposite longitude (x → x + W/2). Genuinely spherical topology on one rectangle. Caveat: polar distortion — cells near the poles cover less real area; the extreme rows approach the pole point. (Confirm the trade-off is acceptable, else fall back to polar ice caps.)
  • Cube-sphere (6 faces): distortion-free, but not a single rectangle — breaks the rectangular editor.
  • Cylinder: wrap E-W only, poles = impassable ice. No distortion, but poles not crossable.

Decision (pending final confirm of the polar-distortion trade-off)

Equirectangular with pole-crossing wrap.

Affected systems (each gets attention when this is built)

  • TileMap/CanStep + movement: a step across the seam wraps; a step over a pole maps to opposite longitude.
  • GridPosition distance + AoI: shortest wrapped distance (min(|dx|, W-|dx|) E-W; pole logic N/S).
  • Client rendering: draw opposite-edge tiles seamlessly at the seam.
  • Editor rendering (later, PR 4b+): optional seam preview; the editor stays rectangular.
  • Orthogonal to the chunked format (#229): the map stays a rectangle on disk; wrap is coordinate normalization applied by consumers.

Sequencing

Its own critical design review before implementation, alongside the gameplay/rendering phases. Does NOT block the Fase-4 editor work (rectangular editor). Tracking issue only for now.

## Requirement The world is a **planet**: reaching a map edge comes out the other side. Owner's call: **spherical**. The editor still shows a rectangle. ## Honest geometry A uniform square grid **cannot** perfectly tile a sphere (Euler characteristic / curvature) — every rectangle→sphere mapping distorts somewhere. Options: - **Equirectangular + pole wrap (chosen, single rectangle):** east-west wraps as longitude; crossing the N/S edge crosses the pole to the opposite longitude (`x → x + W/2`). Genuinely spherical topology on one rectangle. **Caveat:** polar distortion — cells near the poles cover less real area; the extreme rows approach the pole point. (Confirm the trade-off is acceptable, else fall back to polar ice caps.) - **Cube-sphere (6 faces):** distortion-free, but not a single rectangle — breaks the rectangular editor. - **Cylinder:** wrap E-W only, poles = impassable ice. No distortion, but poles not crossable. ## Decision (pending final confirm of the polar-distortion trade-off) Equirectangular with pole-crossing wrap. ## Affected systems (each gets attention when this is built) - `TileMap`/`CanStep` + movement: a step across the seam wraps; a step over a pole maps to opposite longitude. - `GridPosition` distance + AoI: shortest wrapped distance (`min(|dx|, W-|dx|)` E-W; pole logic N/S). - Client rendering: draw opposite-edge tiles seamlessly at the seam. - Editor rendering (later, PR 4b+): optional seam preview; the editor stays rectangular. - **Orthogonal to the chunked format** (#229): the map stays a rectangle on disk; wrap is coordinate normalization applied by consumers. ## Sequencing Its own critical design review before implementation, alongside the gameplay/rendering phases. **Does NOT block the Fase-4 editor work** (rectangular editor). Tracking issue only for now.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo#233
No description provided.