Tilemap Asset Import Contracts
What This System Is
Tilemap import contracts describe how raw .png, .tsx, .tmx, .navmask, and .surfaces files become usable scene tilesets, prefabs, overlays, and standalone assets. The manifest connects source aliases to canonical asset paths so editor tools and runtime loading can resolve the right TSX metadata for a tileset image.
How Authors Use It
Add new tilemap families under assets/tilemaps, keep the PNG and TSX companion files together or declare their relationship in tilemap_import_manifest.json, then run asset preflight before using the tileset in a scene. Use nav masks and surfaces when gameplay or editor overlays need collision, movement, spawn safety, terrain, or placement data.
When importing a sample map or prefab, keep the .tmx source and referenced tilesets within the asset root so pack export can include the full dependency chain.
File Families
.png: the texture loaded by editor and runtime..tsx: Tiled tileset metadata, image source, tile size, columns, tile count, and custom properties..tmx: Tiled map or prefab source..navmask: movement and blocked-tile data used by editor/runtime overlays..surfaces: tile surface tags used by authoring and runtime affordances.tilemap_import_manifest.json: canonical import aliases and TSX companion contracts.
Rules And Invariants
Asset paths must be normalized and stay inside the asset root. TSX files must parse, contain a tileset element, reference a local image source, and agree with the image size, tile size, columns, and tile count. Manifest ids and asset paths must be unique. Aliases should explain legacy source names; they are not a substitute for canonical paths in scene documents.
Nav masks and surfaces should follow the same family ownership as their tileset. If a scene references a tileset by PNG, the resolver must be able to find the matching TSX metadata.
Validation And Debugging
Run asset catalog preflight when a tileset import changes. The report names the manifest entry, field, asset path, expected grid, and suggested repair. Use the editor asset-debug tilemap panels to inspect resolved companion files, grid mismatches, missing nav masks, and dependency edges.
If a scene renders with the wrong tiles or overlay data, check the canonical PNG path, candidate TSX paths, manifest aliases, and whether a stale sample-map TSX is shadowing the intended companion.
Examples
When adding tilemaps/example/example.png, add or verify tilemaps/example/example.tsx, confirm the TSX image source points to the PNG, add manifest aliases only for alternate source names, then run preflight before using it in a scene.
When adding a movement-blocking cliff set, ship the PNG, TSX, and nav mask together so viewport overlays and runtime movement authority agree about blocked tiles.