/godot-dev:godot-tilemapfrom godot-dev
Builds Godot tile levels using TileMapLayer and TileSet with atlases, terrains, autotiling, physics and navigation layers. Includes a Python script to generate TileSet resources from sprite sheets.
Ships in godot-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Each layer is a TileMapLayer node sharing one TileSet; a level from data is a loop of
set_cell() calls. The tiles carry the collision, one-way flags and navigation, so a level
never draws them separately.
| The situation | Read |
|---|---|
A project on the old TileMap node; code that indexes layers by number | reference/tileset.md → "TileMap is the old node" |
A tile sheet arrives from the art pipeline and needs a TileSet | scripts/tileset_from_sheet.py, then reference/tileset.md → "Building a TileSet" |
| Solid, one-way, walkable tiles; custom data such as "surface" or "hazard" | reference/tileset.md → "What a tile carries" |
| Edges and corners that should pick themselves (autotiling) | reference/terrains.md |
| A level from text rows, JSON or a Tiled map | resources/level_from_data.gd, then reference/levels-from-data.md |
| "Which tile did the courier land on?"; a moving layer | reference/tileset.md → "The layer node at run time" |
| A body falls through tiles placed this frame; no path across fresh tiles | reference/levels-from-data.md → "After the cells are set" |
| The courier walks behind a chimney; layers draw in the wrong order | godot-2d-rendering → reference/draw-order.md |
| Light and shadow from tiles | godot-2d-rendering |
| Collision layers and masks, tunnelling, a ray that misses | godot-physics |
| The courier's motor on the tiles; one-way drop-through | godot-2d-controller |
| Drawing the tile art itself | codex-visual (game-assets) |
| Pixel-art import settings for the sheet | godot-2d-sprites |
The class reference's own description of TileMapLayer says TileMap is deprecated and that
several TileMapLayer nodes replace one TileMap. New levels use TileMapLayer, one node per
layer, siblings sharing one TileSet. Moving an old level is mechanical: drop the layer index
from every call and hold a node reference instead (the table in reference/tileset.md).
scripts/tileset_from_sheet.py writes the .tres text Godot's ResourceSaver writes for the
same TileSet, from the sheet's size alone: one atlas source over the grid, physics layer 0 with a
full-tile square on the solid tiles (one-way on the one-way ones), navigation layer 0 on the
walkable tiles, and any 4x4 block as a match-sides terrain.
python3 scripts/tileset_from_sheet.py art/rooftop_tiles.png --tile 16 --margin 1 --separation 1 \
--texture-path res://art/rooftop_tiles.png --out art/rooftop_tiles.tres \
--solid-block 0,0,4,4 --one-way 4,0 --walkable 5,0 --walkable 5,1 --terrain-sides 0,0=Roof
python3 scripts/tileset_from_sheet.py sheet.png --tile 16 --solid-all \
--texture-path res://art/sheet.png --out art/sheet_tiles.tres
python3 scripts/tileset_from_sheet.py --selftest
Cells are atlas X,Y, column and row from the top left; --solid, --one-way and --walkable
repeat, --solid-block X,Y,W,H marks a rectangle, --solid-all and --walkable-all mark every
tile, --tile-height makes tiles non-square. Exit 0 written, 1 a usage error or refused input (no
tile fits, a cell outside the grid, a terrain block past the edge), 3 the sheet is not a readable
PNG or the output cannot be written. Import the sheet before the .tres loads.
The same TileSet can be built at run time: resources/level_from_data.gd → atlas_tileset()
and add_side_terrain(). The selftest builds it both ways and compares every tile.
resources/level_from_data.gd (static functions; preload() it, no class_name):
| Function | Does |
|---|---|
atlas_tileset(texture, tile_size, solid, one_way, walkable, margins, separation) | a TileSet with atlas source 0, physics layer 0, navigation layer 0 |
add_side_terrain(tile_set, block, name) | a 4x4 block becomes a match-sides terrain; returns its set |
fill_rows(layer, rows, legend, origin) | one character per cell; terrain cells painted together afterwards |
fill_json(layer, text, tiled_layer) | {"legend", "rows"} or a Tiled map; -1 for anything else |
tiled_layer_names(data), fill_tiled(layer, data, layer_name, sources) | Tiled tile layers in drawing order; CSV data, flip bits to transform flags |
--selftest writes a sheet, checks the command line's exits, then imports a throwaway project
outside the repository and runs it headless: the written TileSet loads with the right grid,
margins and terrain; 24 of 24 tiles match the run-time build; a text level sets the expected cells
and the terrain picks the expected edge tiles; the JSON level matches it; a Tiled map gives the
expected atlas coords and flip flags, through fill_json() too, while base64 data, an unknown
layer and an external tileset set nothing; a body stands on a solid tile and another on a one-way
tile; the collision names the layer and the cell under the contact point; a path goes round a
wall of non-walkable tiles. Any engine or script error in the import or the run fails it. It
needs Godot (--godot PATH or GODOT_BIN) and exits 3 without one.
TileSet, many layers. Ground, trim, one-way ledges and decoration are sibling
TileMapLayer nodes on the same TileSet; a second TileSet per layer splits the physics
and terrain setup in two.set_cells_terrain_connect() call
per terrain..tres written by the script goes into version control with
the command that wrote it, so the next sheet is one command.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub tipoli5890/game-studio --plugin godot-dev28 skills in this plugin
/godot-2d-controllerMove a 2D character in Godot: CharacterBody2D jump, coyote time, jump buffer, slopes, one-way and moving platforms, top-down movement./godot-2d-renderingGodot 2D look: draw order, z_index and y-sort, CanvasLayer, 2D lights and shadows, canvas shaders, Parallax2D, pixel-perfect scaling./godot-2d-rigA layered 2D character into Godot: rig2d.json to Skeleton2D, Bone2D and weighted Polygon2D parts, cut-out animation, 2D IK.