ai-behavior-trees-util…
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system…
Build and edit tile-based 2D levels in Godot 4.7 with TileMapLayer and TileSet: paint layers, set up collision/navigation/custom-data on tiles, autotile with terrain sets, and read/write cells from code (set_cell, get_cell_tile_data, local_to_map). Use when working with
$ npx -y skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-tilemap --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/godot-tilemapContext preview
The summary Claude sees to decide when to auto-load this skill.
Build and edit tile-based 2D levels in Godot 4.7 with TileMapLayer and TileSet: paint layers, set up collision/navigation/custom-data on tiles, autotile with terrain sets, and read/write cells from code (set_cell, get_cell_tile_data, local_to_map). Use when working with
name: godot-tilemap description: > Build and edit tile-based 2D levels in Godot 4.7 with TileMapLayer and TileSet: paint layers, set up collision/navigation/custom-data on tiles, autotile with terrain sets, and read/write cells from code (set_cell, get_cell_tile_data, local_to_map). Use when working with TileMapLayer nodes, .tres TileSets, autotiling, or migrating a deprecated TileMap node to TileMapLayer.
Author tile-based levels with `TileMapLayer` + `TileSet`, add per-tile collision and custom data, autotile with terrains, and manipulate cells at runtime. Targets **Godot 4.7**, where `TileMapLayer` replaces the now-deprecated `TileMap` node.
navigation, custom data, terrains), or reading/writing tiles from code.
`TileMapLayer` nodes (one layer each).
**When *not* to use:** moving the player across the tiles → `godot-2d-movement`; general physics bodies/raycasts → `godot-physics`; procedural map *generation* algorithms → `procedural-gen`; level *design* practice → `level-design`.
1. **Add a `TileMapLayer` node** (one per visual/logical layer: background, walls, foreground). Each holds exactly one layer of tiles. 2. **Create or assign a `TileSet`** on the layer's `tile_set` property. Add an atlas source (a texture sliced into tiles) in the TileSet editor. Save the TileSet as an external `.tres` so multiple layers/levels reuse it. 3. **Add tile data in the TileSet editor:** physics layers (collision polygons), navigation layers, occlusion, and **custom data layers** (typed per-tile values like `damage` or `is_ladder`). 4. **Paint** in the TileMap bottom panel (Paint/Line/Rectangle/Bucket). For self- connecting tiles, define a **terrain set** and paint with Connect/Path mode. 5. **Enable per-layer collision/navigation** via the layer's `collision_enabled` / `navigation_enabled` properties. 6. **Read/write from code** with `local_to_map`, `set_cell`, `get_cell_source_id`, and `get_cell_tile_data(...).get_custom_data(...)`.
extends TileMapLayer
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.pressed:
# local_to_map expects local coords; convert from global first.
var cell := local_to_map(to_local(event.position))
var data := get_cell_tile_data(cell) # TileData or null
if data:
var dmg: int = data.get_custom_data("damage") # custom data layer
print("Cell %s deals %d damage" % [cell, dmg])# set_cell(coords, source_id, atlas_coords, alternative_tile = 0)
func place_wall(cell: Vector2i) -> void:
set_cell(cell, 0, Vector2i(2, 1)) # source 0, atlas tile at column 2, row 1
func dig(cell: Vector2i) -> void:
erase_cell(cell) # same as set_cell(cell, -1)
func clear_level() -> void:
clear() # remove every tile on this layer# Paint a filled area with terrain `terrain` of terrain set `terrain_set`;
# Godot picks the correct edge/corner tiles to connect them.
func fill_with_grass(cells: Array[Vector2i]) -> void:
var terrain_set := 0
var grass_terrain := 0
set_cells_terrain_connect(cells, terrain_set, grass_terrain, true)func find_spawns() -> Array[Vector2i]:
var spawns: Array[Vector2i] = []
for cell in get_used_cells():
var data := get_cell_tile_data(cell)
if data and data.get_custom_data("is_spawn"):
spawns.append(cell)
return spawnsgroup them under a parent `Node2D`. Old `TileMap` calls that took a `layer` argument (`set_cell(layer, ...)`) do not apply to `TileMapLayer`.
with `to_local(...)` first, or cells will be offset.
null-check before `get_custom_data`.
wrong type or referencing a non-existent layer name errors. Define the layer in the TileSet first.
results if the TileSet's terrain bitmask peering is incomplete.
immediately after `set_cell`, call `update_internals()` (expensive — avoid in loops).
physics layer with a polygon, and that the TileSet's physics layer mask matches your bodies.
bitmasks), scene tiles, Y-sorting, and runtime tile-data overrides (`_use_tile_data_runtime_update`), read `references/tileset-and-terrains.md`.
<img src="docs/assets/banner.png" width="820" alt="awesome-gamedev-agent-skills — game-dev skills for AI coding agents.
Repo: gamedev-skills/awesome-gamedev-agent-skills
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system…
Implement game audio practice — bus/mixer architecture and gain in decibels, ducking (sidechain), adaptive/dynamic music via layering and re-sequencing, SFX…
Build game cameras that feel good — 2D follow with a deadzone, look-ahead, smoothing, and level-bounds clamping; 3D third-person orbit with collision and…
Plan, generate, source, normalize, and validate cohesive visual game assets. Use for art direction, style bibles, sprites, tilesets, backgrounds, UI art,…
Build branching dialogue and narrative — a node/choice graph with conditions, variables, and localization hooks — and choose between authoring tools Ink and…
Design NPC and enemy decision-making with finite state machines, behavior trees, steering behaviors, and A* pathfinding — engine-neutral algorithms that pair…