Skip to content
Isthimius edited this page Jun 22, 2026 · 2 revisions

Gondwana uses several coordinate spaces on purpose, and understanding them early will save you a lot of confusion.


Coordinate Space types

1. Grid space

Grid space is tile-relative. A position like (4, 7) means “column 4, row 7” on a given SceneLayer.

This is useful for:

  • tile addressing
  • map logic
  • spawn placement
  • coordinate-system-aware movement

2. World pixel space

World space is Gondwana’s primary simulation space.

Most core engine logic happens here:

  • camera position
  • dirty rectangles
  • sprite placement
  • collision bounds
  • layer origins
  • view transforms

This is the engine’s real “source of truth.”


3. Screen space

Screen space is render-surface space. These are the pixel coordinates on the destination surface after camera, parallax, viewport placement, and zoom have been applied.

This is where:

  • the backbuffer is actually drawn
  • dirty presentation regions are tracked
  • view overlays live

4. Layer-local projection space

Each SceneLayer has a coordinate system implementation that converts grid positions to world pixels. Orthogonal, isometric, and hex variants are handled at this layer.

That means grid-to-world math is layer-specific, not global.


Key insight

Gameplay logic should usually think in world or grid space. Rendering code is where world becomes screen.


Mental model

Grid -> World -> Screen

That pipeline is everywhere in Gondwana.


Where to read next

  • Gondwana/Scenes/SceneLayer.cs
  • Gondwana/Rendering/Views/View.cs
  • coordinate classes under Gondwana/Drawing/Coordinates/

Clone this wiki locally