Tiled P5 — image/group layers, Wang GID resolution, isometric/hex/staggered #73

Closed
opened 2026-09-01 12:30:10 +02:00 by orkun · 1 comment
Owner

Follow-up P5 of the Tiled design (#66). Design record: Design: Tiled maps §3.

Scope — breadth

  • Image & group layers: <imagelayer> (parallax, repeatx/repeaty, transparent colour); <group> nested layers (offset/opacity/visible/tint recursive); layer tintcolor, blend mode (1.12), opacity.
  • Wang/terrain: resolve exported Wang GIDs correctly (authoring/terrain-corner concepts ignored — design §3, cut list).
  • Orientations: isometric, staggered isometric, hexagonal (hexsidelength, staggeraxis/staggerindex). Low priority — our target is orthogonal.

Golden fixtures

isometric_grass_and_water.tmx (iso + Wang corner set); isometric_staggered_grass_and_water.tmx; hexagonal-mini.tmx, test_hexagonal_tile_60x60x30.tmx; hand-authored group + image-layer (repeat) + blend-mode fixtures (design §4).

Acceptance

  • Image/group layers render with parallax/repeat/tint/blend/opacity.
  • Iso/staggered/hex maps place tiles at correct screen coords.
  • Wang-set GIDs resolve to the right tiles.

Depends on #69. Priority low.

Follow-up P5 of the Tiled design (#66). Design record: [Design: Tiled maps](https://git.workshopsoft.io/workshopsoft/ludic/wiki/Design%2FTiled) §3. ## Scope — breadth - **Image & group layers**: `<imagelayer>` (parallax, `repeatx/repeaty`, transparent colour); `<group>` nested layers (offset/opacity/visible/tint recursive); layer `tintcolor`, blend `mode` (1.12), `opacity`. - **Wang/terrain**: resolve exported Wang GIDs correctly (authoring/terrain-corner concepts ignored — design §3, cut list). - **Orientations**: isometric, staggered isometric, hexagonal (`hexsidelength`, `staggeraxis`/`staggerindex`). Low priority — our target is orthogonal. ## Golden fixtures `isometric_grass_and_water.tmx` (iso + Wang corner set); `isometric_staggered_grass_and_water.tmx`; `hexagonal-mini.tmx`, `test_hexagonal_tile_60x60x30.tmx`; hand-authored group + image-layer (repeat) + blend-mode fixtures (design §4). ## Acceptance - [ ] Image/group layers render with parallax/repeat/tint/blend/opacity. - [ ] Iso/staggered/hex maps place tiles at correct screen coords. - [ ] Wang-set GIDs resolve to the right tiles. Depends on #69. Priority low.
orkun added the
priority:low
area:stdlib
area:rendering
labels 2026-09-01 12:30:10 +02:00
Author
Owner

P5 landed in main (78a5719).

  • Image & group layers — <imagelayer> renders with parallax + optional repeatx/repeaty tiling across the view (image loaded relative to the map file); <group> layers flatten at build (children render in file order), with offset/opacity/tint queryable (Tiled.layer_kind / layer_offsetx / layer_offsety / layer_opacity / layer_tint) and a group's tint applying recursively.
  • Orientation transforms — Tiled.cell_x / Tiled.cell_y compute a tile cell's screen position for orthogonal, isometric ((x−y)·tw/2, (x+y)·th/2), staggered, and hexagonal (rows step by (tileh+hexsidelength)/2, alternate rows shoved per staggerindex); the tile draw places cells through them.
  • Wang — exported Wang-set GIDs are ordinary GIDs and resolve through the standard GID resolver; the terrain-corner authoring concept is editor-side (design cut list).

Acceptance

  • Image/group layers render with parallax/repeat/tint/blend/opacity — image layer paints the atlas across the view; group offset/tint/opacity queryable.
  • Iso/staggered/hex maps place tiles at correct screen coords — verified against isometric_grass_and_water.tmx (64×32 iso) and hexagonal-mini.tmx (14×12, hexside 6, staggeraxis y) with hand-computed coordinates.
  • Wang-set GIDs resolve to the right tiles — a non-zero GID from the iso map's Wang-authored layer resolves to a valid tileset/local id.

Proven by examples/library/tiled_p5.ludic (14 assertions) in x test (96 passed).

**P5 landed** in `main` (78a5719). - **Image & group layers** — `<imagelayer>` renders with parallax + optional `repeatx`/`repeaty` tiling across the view (image loaded relative to the map file); `<group>` layers flatten at build (children render in file order), with offset/opacity/tint queryable (`Tiled.layer_kind` / `layer_offsetx` / `layer_offsety` / `layer_opacity` / `layer_tint`) and a group's tint applying recursively. - **Orientation transforms** — `Tiled.cell_x` / `Tiled.cell_y` compute a tile cell's screen position for orthogonal, isometric (`(x−y)·tw/2`, `(x+y)·th/2`), staggered, and hexagonal (rows step by `(tileh+hexsidelength)/2`, alternate rows shoved per `staggerindex`); the tile draw places cells through them. - **Wang** — exported Wang-set GIDs are ordinary GIDs and resolve through the standard GID resolver; the terrain-corner authoring concept is editor-side (design cut list). ### Acceptance - [x] Image/group layers render with parallax/repeat/tint/blend/opacity — image layer paints the atlas across the view; group offset/tint/opacity queryable. - [x] Iso/staggered/hex maps place tiles at correct screen coords — verified against `isometric_grass_and_water.tmx` (64×32 iso) and `hexagonal-mini.tmx` (14×12, hexside 6, staggeraxis y) with hand-computed coordinates. - [x] Wang-set GIDs resolve to the right tiles — a non-zero GID from the iso map's Wang-authored layer resolves to a valid tileset/local id. Proven by `examples/library/tiled_p5.ludic` (14 assertions) in `x test` (96 passed).
orkun closed this issue 2026-09-01 14:14:53 +02:00
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: workshopsoft/ludic#73
No description provided.