ludic/assets/kenney/tiny-dungeon/Tiled/sampleMap.tmj
Orkuncakilkaya bc301c8d17
All checks were successful
bootstrap / cfree-fixpoint (push) Successful in 20s
ci / build-and-test (push) Successful in 1m48s
commit-lint / conventional-commits (push) Successful in 3s
docs / build-and-deploy (push) Successful in 27s
feat(engine): Tiled P1 — rt_tmap model + GID resolver + render + projection (#69)
The heart of Tiled support: load a map and draw it.

- rt_tmap model (Tmap/TmLayer/TmTileset in tiled.ludic): map header + ordered
  layers (dense int32 GID arrays, heap-allocated to w*h, lifting the 96x64 cap)
  + tilesets. Built from the intermediate Value tree, so the TMX and TMJ paths
  both feed it.
- GID resolver (Tiled.resolve): gid -> (tileset, localId, flipH/V/D); the three
  flip flags masked off before the local-id lookup, returned alongside. gid==0
  is empty.
- Image-backed render (Tiled.draw): every visible tile layer in file order,
  blitting each tile from its tileset image with flips applied at draw.
- Compatibility projection (Tiled.project / auto on load): a designated
  collision layer projects to the legacy byte tilemap ('#' solid, '=' one-way
  via the oneway property, ' ' empty) so Grid.*/Path.*/esys_move are unchanged.
- Tiled.load resolves external tilesets + images relative to the map file and
  auto-projects a collision/solids/walls layer.
- The grid and physics_tiles demos now run off a loaded map (grid_maze.tmx /
  physics_map.tmx) instead of hand-authored Map.row strings, byte-identically.

Two compiler fixes fell out of this (see the changeset):
- emit_index_addr set g_addr_ty before evaluating the index, so slice[obj.field]
  came back mis-typed; set it last, like the raw-pointer branches.
- @strcmp was declared by both the world table and the fs prelude; centralise
  it in the head prelude so a game that uses Fs/Path links.

Proven by library/tiled_p1.ludic (14 assertions: loads+renders Kenney map
identically from .tmx and .tmj, flip mirroring) + the converted grid/
physics_tiles demos. x test: 92 passed; self-host bootstrap fixpoint intact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-01 14:43:29 +03:00

1981 lines
No EOL
15 KiB
Text

{
"type": "map",
"version": "1.8",
"tiledversion": "1.8.2",
"orientation": "orthogonal",
"renderorder": "right-down",
"width": 32,
"height": 20,
"tilewidth": 16,
"tileheight": 16,
"infinite": false,
"nextlayerid": 6,
"nextobjectid": 1,
"tilesets": [
{
"firstgid": 1,
"source": "sampleSheet.tsx"
}
],
"layers": [
{
"type": "tilelayer",
"id": 1,
"name": "Dungeon",
"width": 32,
"height": 20,
"x": 0,
"y": 0,
"opacity": 1,
"visible": true,
"data": [
14,
1610612787,
16,
1,
1,
3221225485,
1,
1,
1,
2,
3,
3,
3,
3,
3,
4,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
14,
1610612787,
17,
3,
3,
4,
1,
1,
1,
14,
41,
41,
41,
41,
41,
16,
1,
1,
1,
1,
1,
25,
1,
1,
1,
1,
1,
1,
1,
1,
1073741837,
1,
14,
1610612787,
58,
41,
41,
16,
25,
1,
1,
14,
1610612789,
51,
51,
52,
51,
16,
2,
3,
4,
1,
1,
1,
1,
2,
3,
7,
3,
3,
3,
7,
3,
4,
14,
1610612787,
51,
52,
51,
16,
1,
1,
1,
14,
1610612787,
49,
3221225522,
49,
49,
16,
14,
41,
16,
1,
1,
536870925,
1,
14,
41,
19,
41,
30,
41,
19,
41,
16,
14,
1610612787,
5,
27,
27,
28,
1,
1073741837,
1,
14,
1610612787,
49,
49,
49,
49,
16,
14,
1610612789,
16,
1,
1,
1,
1073741837,
14,
1610612789,
31,
51,
51,
52,
31,
51,
16,
14,
1610612787,
16,
2,
3,
3,
3,
3,
4,
26,
27,
27,
27,
27,
27,
28,
14,
1610612787,
17,
7,
3,
3,
4,
14,
1610612787,
49,
49,
49,
49,
49,
49,
16,
14,
1610612787,
16,
14,
41,
41,
41,
41,
17,
3,
3,
3,
3,
4,
1,
1,
14,
1610612787,
58,
19,
41,
41,
16,
14,
1610612787,
49,
49,
49,
49,
49,
49,
16,
18,
1610612787,
17,
18,
1610612789,
51,
52,
51,
58,
41,
41,
22,
41,
16,
2684354573,
1,
14,
1610612787,
51,
31,
51,
51,
16,
14,
1610612787,
49,
49,
49,
49,
49,
49,
16,
60,
1610612787,
58,
60,
1610612787,
49,
49,
49,
51,
51,
51,
51,
51,
17,
3,
3,
18,
1610612787,
49,
43,
49,
3221225522,
17,
18,
1610612787,
49,
49,
49,
49,
49,
2684354610,
17,
51,
54,
51,
51,
54,
43,
49,
50,
49,
49,
49,
49,
49,
58,
41,
41,
60,
1610612787,
49,
49,
43,
49,
58,
60,
37,
38,
38,
38,
38,
38,
39,
58,
49,
43,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
51,
52,
51,
51,
54,
49,
49,
49,
49,
51,
52,
54,
49,
49,
49,
49,
49,
49,
51,
49,
49,
49,
5,
27,
6,
1610612790,
49,
49,
2147483698,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
5,
27,
27,
27,
27,
27,
27,
27,
27,
49,
49,
49,
16,
1,
14,
1610612787,
49,
49,
49,
49,
49,
49,
5,
27,
27,
27,
27,
27,
27,
6,
1610612790,
49,
16,
1,
1,
1,
1,
1,
1,
1,
1,
27,
27,
27,
28,
3221225485,
14,
1610612787,
49,
49,
5,
27,
27,
27,
28,
2,
3,
3,
3,
3,
3,
18,
1610612787,
49,
16,
1,
1,
1,
2,
3,
3,
3,
3,
1,
1,
1,
1,
2,
18,
1610612787,
49,
49,
17,
3,
4,
1,
1,
14,
41,
20,
41,
41,
21,
60,
1610612787,
49,
16,
1,
1,
1073741837,
14,
41,
11,
12,
41,
1,
2,
3,
3,
18,
60,
1610612787,
49,
49,
58,
41,
17,
3,
3,
18,
1610612789,
32,
51,
51,
33,
51,
54,
2147483698,
16,
1,
1,
1,
14,
1610612789,
51,
51,
51,
1,
14,
41,
41,
60,
1610612789,
54,
49,
49,
51,
51,
58,
41,
41,
60,
1610612787,
49,
43,
49,
49,
49,
49,
49,
17,
3,
3,
3,
18,
1610612787,
49,
49,
49,
1,
14,
1610612789,
52,
51,
54,
49,
49,
2147483698,
42,
49,
51,
51,
51,
51,
54,
43,
49,
49,
49,
49,
49,
49,
58,
41,
41,
41,
60,
1610612787,
49,
49,
49,
1,
14,
1610612787,
3758096434,
49,
49,
49,
49,
49,
3758096434,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
43,
49,
51,
51,
51,
51,
51,
54,
49,
49,
49,
1,
14,
1610612787,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
49,
3758096434,
49
]
},
{
"type": "tilelayer",
"id": 4,
"name": "Objects",
"width": 32,
"height": 20,
"x": 0,
"y": 0,
"opacity": 1,
"visible": true,
"data": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
64,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
76,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
87,
0,
0,
64,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
75,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
66,
0,
65,
0,
65,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
67,
0,
67,
0,
67,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,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