All skills
thedivergentai avatar

/godot-tilemap-mastery

@57c9225

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/gd-agentic-skills/godot-tilemap-mastery

This session only. Nothing lands on disk.

referencesruntime-tile-patterns.md

≈328 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Runtime TileMapLayer patterns

Basic cell API

set_cell(Vector2i(0, 0), source_id, atlas_coords)
var atlas_coords := get_cell_atlas_coords(Vector2i(0, 0))
erase_cell(Vector2i(0, 0))

Always local_to_map(global_pos) — never pass world coords directly.

Flood fill

BFS over neighbors; compare get_cell_atlas_coords before writing.

Terrain connect

set_cells_terrain_connect([Vector2i(x, y)], terrain_set, terrain, false)

Prefer over per-cell set_cell for organic shapes.

Multi-layer scene tree

Ground / decoration / collision as sibling TileMapLayer nodes with distinct z_index and physics layers.

Custom data reads

func get_tile_damage(tile_pos: Vector2i) -> int:
    var tile_data := get_cell_tile_data(tile_pos)
    if tile_data:
        return tile_data.get_custom_data("damage_per_second")
    return 0

Cache hot reads — fast_metadata_cache.gd.

Destructible / highlight

See destructible_tile_logic.gd. After erase: refresh nav (nav_mesh_teleport_fix.gd).

Chunking

CHUNK_SIZE grids as child TileMapLayers; load/unload by player chunk — tilemap_chunking.gd.

Source: SKILL.md on GitHub

1 warning17d4 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    This skill is safe for development and provides well-structured GDScript templates for Godot Engine TileMap systems. A minor security surface was identified regarding indirect prompt injection, as the skill provides scripts that read custom metadata from game assets (TileSets) which could potentially contain malicious instructions if the assets originate from an untrusted source.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    4/4 files flagged

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

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-tilemap-mastery