Index of every page on this site: llms.txt
All skills
thedivergentai avatar

/godot-tilemap-mastery

@db004d7
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/thedivergentai/game-dev-agentic-skills/godot-tilemap-mastery

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈93 tokens for metadata: the name and description. ≈2.8k when used: this file. ≈1.5k more on demand in 4 files.

Description uses 4.7% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈374 characters, or 4.7%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

NEVER Do in TileMaps

  • NEVER call set_cell() in huge loops without batching — Prefer terrain connect, patterns, or chunk batchers.
  • NEVER forget source_id in set_cell — Wrong overload → crash or silent miss.
  • NEVER mix world coords with tile coords — Always local_to_map / map_to_local.
  • NEVER hand-paint organic blobs when terrains exist — Use terrain sets + set_cells_terrain_connect.
  • NEVER put dynamic actors in the TileMap — Enemies/pickups are nodes; tiles are geometry / destructible cells.
  • NEVER spam get_cell_tile_data() every physics frame — Cache metadata (fast_metadata_cache.gd).

Decision Tree: How to Write Cells

Goal Prefer Script Trade-off
Organic ground / roads / rivers Terrain autotile terrain_autotile.gd / terrain_path_painter.gd Setup cost in TileSet; fastest designer iteration
Prefab rooms / houses / stamps TileMapPattern tile_pattern_stamper.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 tilemap_chunking.gd / procedural_chunk_batcher.gd / tilemap_data_manager.gd Indirection + load boundaries
Destructible dig/break Custom data HP destructible_tile_logic.gd Must refresh nav/physics after edits
Gameplay queries (friction/hazard) Custom data + cache gameplay_data_query.gd / fast_metadata_cache.gd Cache invalidation on set_cell
Nav after edits Runtime nav fix nav_mesh_teleport_fix.gd Costly if every cell; batch rebuilds
One-way / physics layers TileSet physics physics_shape_interaction.gd Align with CharacterBody masks
Iso / multi-floor sort Y-sort layers sorting_Z_layering.gd Parent + all layers need y_sort
Legacy TileMap → layers Migration tilemap_layer_v43_upgrade.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 tilemap_data_manager.gd
Runtime terrain paths terrain_path_painter.gd / terrain_autotile.gd
Destructible tiles destructible_tile_logic.gd
Custom data gameplay reads gameplay_data_query.gd (+ fast_metadata_cache.gd if hot)
Procedural bulk place procedural_chunk_batcher.gd
Chunk stream in/out tilemap_chunking.gd
Pattern stamp prefabs tile_pattern_stamper.gd
Nav repair after edits nav_mesh_teleport_fix.gd
One-way / physics layer ops physics_shape_interaction.gd
Y-sort / Z layering sorting_Z_layering.gd
4.3+ multi-layer upgrade tilemap_layer_v43_upgrade.gd

Expert Trade-offs (routing only)

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
Runtime APIs + flood/terrain runtime-tile-patterns.md
Iso / patterns / diff 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 set_cell / 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 y_sort_origin used at query time.
  • TileMapPattern — capture/stamp multi-tile prefabs without per-cell set_cell 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-migration — tilemap_layer_v43_upgrade and TileMap→TileMapLayer sit on the 4.x hop path; run engine upgrades via the migration hub before applying layer scripts.
  • godot-characterbody-2d — move_and_slide 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 TILE_SHAPE_ISOMETRIC 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.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    No security issues detected. This skill provides legitimate GDScript templates and architectural guidance for Godot's TileMapLayer system, following established game development best practices.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at db004d7. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 4 months ago

README badge

README badge for thedivergentai/game-dev-agentic-skills/godot-tilemap-mastery