Skip to content

fix(studio): render game's odd-R hex geometry for both tile spaces and retune tile border to graphite#1642

Merged
mateicanavra merged 1 commit into
mainfrom
design/tile-game-geometry
Jun 12, 2026
Merged

fix(studio): render game's odd-R hex geometry for both tile spaces and retune tile border to graphite#1642
mateicanavra merged 1 commit into
mainfrom
design/tile-game-geometry

Conversation

@mateicanavra

Copy link
Copy Markdown
Owner

Both tile spaces (tile.hexOddR and tile.hexOddQ) now render the game's actual plot geometry: regular pointy-top hexes on a row-offset (odd-R) lattice, with columns √3·size apart, rows 1.5·size apart, and odd rows shifted east by half a tile.

The previous renderer treated tile.hexOddQ as a genuine column-offset lattice and drew a custom squashed flat-top hexagon to tile it exactly. A hex-convention audit (research/03-hex-convention-audit.md) established that Civ7's grid is odd-R, not odd-Q — Firaxis's own debug dumpers indent odd rows, the official direction set has E/W neighbors but no N/S (pointy-top adjacency), and the engine boundary writes (x, y) untransposed. mapgen-core's odd-Q projection puts the offset on the wrong axis, producing a lattice that is not a regular hex tiling, which is why the tiling hexagon had to be vertically compressed and the grid looked squished. tile.hexOddQ is now treated as a mislabel of the same game grid. The world frame (√3·width × 1.5·height) is unchanged, so world.xy co-registration is unaffected.

The odd-Q lattice math, its squashed polygon function, and the separate bounds branch for odd-Q are removed. Both tileCenter, tilePoint, and boundsForTileGrid now use the single odd-R path.

Tile border color is changed from mid-luminance slate ([100, 116, 139, 220]) to graphite ([13, 13, 17, 200], #0d0d11 at α200) — one ink in both themes. Borders only appear between filled tiles; unfilled tiles draw nothing. The dark seam recedes into the canvas in dark mode and reads as a crisp graphite grid in light mode without competing with the data palette.

Tests are updated so both tile spaces assert regular pointy-top vertices (unit radius, vertex straight above center) and the row-offset lattice spacing (same-row y, odd-row east shift). The engine-side migration of mapgen-core from odd-Q to odd-R is tracked as a separate task, as it is gameplay-affecting and requires its own regression plan.

This was referenced Jun 12, 2026
@github-actions

Copy link
Copy Markdown

Railway preview (MapGen Studio): not provisioned for this PR.

Policy (Graphite stacks): previews are created only for the top-of-stack PR by default.

  • To force a preview for this PR: add label railway-preview
  • To suppress a preview: add label no-railway-preview

Debug: {"isClosed":false,"isFork":false,"suppress":false,"force":false,"isTopOfStack":false,"hasToken":true,"draft":false}

mateicanavra commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

Merge activity

  • Jun 12, 8:50 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 12, 10:08 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 12, 10:08 PM UTC: @mateicanavra merged this pull request with Graphite.

@mateicanavra
mateicanavra changed the base branch from design/pass5-ledger to graphite-base/1642 June 12, 2026 22:05
@mateicanavra
mateicanavra changed the base branch from graphite-base/1642 to main June 12, 2026 22:06
…quish) + graphite border ink, with the hex-convention audit
@mateicanavra
mateicanavra force-pushed the design/tile-game-geometry branch from cbf64b5 to 73d50b8 Compare June 12, 2026 22:07
@mateicanavra
mateicanavra merged commit f108206 into main Jun 12, 2026
This was referenced Jun 12, 2026
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