thedivergentai/gd-agentic-skills

godot-tilemap-mastery

Expert blueprint for TileMapLayer and TileSet systems for efficient 2D level design.

First seen Feb 10, 2026

Installation

$ npx skills add thedivergentai/gd-agentic-skills --skill godot-tilemap-mastery

Summary

  • Expert blueprint for TileMapLayer and TileSet systems for efficient 2D level design.
  • Covers terrain autotiling, physics layers, custom data, navigation integration, and runtime manipulation.
  • Use when building grid-based levels OR implementing destructible tiles.
  • Keywords TileMapLayer, TileSet, terrain, autotiling, atlas, physics layer, custom data.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from thedivergentai/gd-agentic-skills · top by installs.

npx skills add thedivergentai/gd-agentic-skills

Browse all from thedivergentai/gd-agentic-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 678
License LICENSE
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 11,587 B
  • docs SUMMARY.md 3,994 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 333 installs

SKILL.md

NEVER Do in TileMaps

  • NEVER call set_cell() in huge loops without batching — Prefer terrain connect, patterns, or chunk batchers.
  • NEVER forget sourceid in setcell — Wrong overload → crash or silent miss.
  • NEVER mix world coords with tile coords — Always localtomap / maptolocal.
  • NEVER hand-paint organic blobs when terrains exist — Use terrain sets + setcellsterrain_connect.
  • NEVER put dynamic actors in the TileMap — Enemies/pickups are nodes; tiles are geometry / destructible cells.
  • NEVER spam getcelltiledata() every physics frame — Cache metadata ([fastmetadatacache.gd](scripts/fastmetadata_cache.gd)).

Decision Tree: How to Write Cells

Goal Prefer Script Trade-off
Organic ground / roads / rivers Terrain autotile [terrainautotile.gd](scripts/terrainautotile.gd) / [terrainpathpainter.gd](scripts/terrainpathpainter.gd) Setup cost in TileSet; fastest designer iteration
Prefab rooms / houses / stamps TileMapPattern [tilepatternstamper.gd](scripts/tilepatternstamper.gd) Great for procgen pieces; less flexible per-cell
Sparse / precise edits set_cell Fine for few cells; bad for thousands/frame
Huge streaming worlds Chunks [tilemapchunking.gd](scripts/tilemapchunking.gd) / [proceduralchunkbatcher.gd](scripts/proceduralchunkbatcher.gd) / [tilemapdatamanager.gd](scripts/tilemapdatamanager.gd) Indirection + load boundaries
Destructible dig/break Custom data HP [destructibletilelogic.gd](scripts/destructibletilelogic.gd) Must refresh nav/physics after edits
Gameplay queries (friction/hazard) Custom data + cache [gameplaydataquery.gd](scripts/gameplaydataquery.gd) / [fastmetadatacache.gd](scripts/fastmetadatacache.gd) Cache invalidation on set_cell
Nav after edits Runtime nav fix [navmeshteleportfix.gd](scripts/navmeshteleportfix.gd) Costly if every cell; batch rebuilds
One-way / physics layers TileSet physics [physicsshapeinteraction.gd](scripts/physicsshapeinteraction.gd) Align with CharacterBody masks
Iso / multi-floor sort Y-sort layers [sortingZlayering.gd](scripts/sortingZlayering.gd) Parent + all layers need y_sort
Legacy TileMap → layers Migration [tilemaplayerv43upgrade.gd](scripts/tilemaplayerv43upgrade.gd) One-time upgrade aid

Editor atlas/physics paint setup: Official Documentation in Reference — Do NOT reload Steps 1–3 / flood_fill tutorials from this skill body.

Available Scripts (single index + MANDATORY triggers)

Task MANDATORY script(s)
Serialize / large world data [tilemapdatamanager.gd](scripts/tilemapdatamanager.gd)
Runtime terrain paths [terrainpathpainter.gd](scripts/terrainpathpainter.gd) / [terrainautotile.gd](scripts/terrainautotile.gd)
Destructible tiles [destructibletilelogic.gd](scripts/destructibletilelogic.gd)
Custom data gameplay reads [gameplaydataquery.gd](scripts/gameplaydataquery.gd) (+ [fastmetadatacache.gd](scripts/fastmetadatacache.gd) if hot)
Procedural bulk place [proceduralchunkbatcher.gd](scripts/proceduralchunkbatcher.gd)
Chunk stream in/out [tilemapchunking.gd](scripts/tilemapchunking.gd)
Pattern stamp prefabs [tilepatternstamper.gd](scripts/tilepatternstamper.gd)
Nav repair after edits [navmeshteleportfix.gd](scripts/navmeshteleportfix.gd)
One-way / physics layer ops [physicsshapeinteraction.gd](scripts/physicsshapeinteraction.gd)
Y-sort / Z layering [sortingZlayering.gd](scripts/sortingZlayering.gd)
4.3+ multi-layer upgrade [tilemaplayerv43upgrade.gd](scripts/tilemaplayerv43upgrade.gd)

Expert Trade-offs (routing only)

  • Isometric Y-sort: enable ysortenabled on parent and each TileMapLayer; tune ysortorigin on tall tiles — see [sortingZlayering.gd](scripts/sortingZlayering.gd).
  • Procgen: stamp patterns or batch terrain; avoid per-cell setcell storms — [tilepatternstamper.gd](scripts/tilepatternstamper.gd) / [proceduralchunkbatcher.gd](scripts/proceduralchunk_batcher.gd).
  • Diff / save deltas: compare getusedcells() sourceid/atlas between layers; persist deltas via [tilemapdatamanager.gd](scripts/tilemapdata_manager.gd) rather than full maps when possible.

Deep recipes (on demand)

LLM-ignorance rule: if a general agent would not know it before reading, it lives here or in scripts/ — never delete, only move.

Topic Reference
TileSet editor steps [tileset-editor-setup.md](references/tileset-editor-setup.md)
Runtime APIs + flood/terrain [runtime-tile-patterns.md](references/runtime-tile-patterns.md)
Iso / patterns / diff [expert-tilemap-architectures.md](references/expert-tilemap-architectures.md)

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.

Official Documentation

  • Using TileMaps — TileMapLayer workflow, layers, runtime setcell / terrain painting, and when multiple layers beat a single legacy TileMap.
  • Using TileSets — atlas sources, terrains, physics/navigation/custom data layers painted in the TileSet editor.
  • TileMapLayer — cell APIs, terrain connect, patterns, coordinate conversion, and runtime tile-data updates.
  • TileSet — physics/terrain/custom-data layer definitions shared by every TileMapLayer that references the resource.
  • TileSetAtlasSource — atlas grid, alternatives, and per-tile TileData that drive collision and metadata.
  • TileData — custom data, physics polygons, navigation polygons, and ysort_origin used at query time.
  • TileMapPattern — capture/stamp multi-tile prefabs without per-cell setcell loops.
  • Collision shapes (2D) — shape choices and one-way collision patterns that TileSet physics layers expose to CharacterBody2D.
  • Navigation introduction (2D) — how tile navigation polygons feed NavigationRegion2D / NavigationAgent2D after edits.
  • Canvas layers — z-index / CanvasLayer separation for ground, decoration, and roof TileMapLayers.
  • Background loading — threaded ResourceLoader patterns for streaming chunk TileSets / tilemap scenes without hitch spikes.

Related Skills

Prerequisites

  • godot-project-foundations — scene tree, resources, and import layout before authoring TileSet atlases and multi-layer level scenes.
  • godot-gdscript-mastery — typed Vector2i APIs, caching patterns, and signal-up/call-down structure used in runtime tile managers.
  • godot-2d-physics — collision layers/masks and StaticBody2D-equivalent behavior that TileMapLayer physics layers participate in.

Complements

  • godot-version-migrationtilemaplayerv43_upgrade and TileMap→TileMapLayer sit on the 4.x hop path; run engine upgrades via the migration hub before applying layer scripts.
  • godot-characterbody-2dmoveandslide against tile colliders, one-way platforms, and floor/wall queries over TileMapLayer geometry.
  • godot-navigation-pathfinding — NavigationAgent2D / region updates when destructible or procedural tiles change walkable polygons.
  • godot-camera-systems — Camera2D limits and follow radii that drive chunk load/unload around the player.
  • godot-adapt-3d-to-2d — isometric / Y-sort depth tricks that pair with TILESHAPEISOMETRIC and multi-floor TileMapLayers.
  • godot-scene-management — packing and swapping chunk scenes so large tile worlds stream without orphaned layers.
  • godot-performance-optimization — batching, cache budgets, and profiler checks when set_cell / custom-data queries dominate frame time.

Downstream / consumers

  • godot-procedural-generation — noise/BSP/WFC generators that write cells via terrain connect, patterns, or chunk batchers.
  • godot-genre-platformer — precision platformer levels built from TileSet physics, one-ways, and hazard custom data.
  • godot-genre-metroidvania — interconnected room grids, ability gates, and map revelation layered on TileMapLayer chunks.
  • godot-genre-sandbox — diggable/buildable 2D worlds that treat TileMapLayer as the editable terrain backend.
  • godot-monte-carlo-balancer — simulate hazard density, destructible HP, and traversal cost encoded in tile custom data before shipping maps.

Master

  • godot-master — library router and mirrored module entry for cross-skill discovery.