Build a Tiled level map from a prompt

Updated 2026-11-28 · Tiled MCP Pro 1.1.0

This guide shows a workflow that gets good levels out of an AI in Tiled: let it look at the tileset first, agree on layers, describe the level in plain words, let the terrain tools handle edges, then render and fix. It assumes the setup is done and the server runs in full mode.

1. Start from a tileset the AI can see

The model cannot guess which tile ID is a wall corner. Give it the tileset and let it look:

Create a 48x32 orthogonal map with 16 px tiles. Add the tileset
C:/assets/tiny_dungeon/tilemap_packed.png as "dungeon".
Call get_tileset_preview for "dungeon" and list which IDs are
floors, walls, doors and decorations.

get_tileset_preview returns the tileset image together with a grid of tile IDs, so the model can match what it sees to IDs. If the tileset has a .tsx with terrain sets, add the .tsx instead of the bare image: the AI can then use place_wang_terrain.

Pixel-art dungeon rendered from Tiled
Kenney's Tiny Dungeon (CC0) is a good first tileset: 16 px tiles, clear walls and floors. This is its sample map rendered through the extension.

2. Plan the layers

Ask for a layer plan before any tiles are placed. A common split:

LayerTypeContent
GroundtileFloor, grass, water.
WallstileWalls and cliffs; often what your engine uses for collision.
DecortileProps that sit on top: tables, torches, rugs.
ObjectsobjectSpawn points, doors, chests, triggers, camera bounds.

Tools: add_tile_layer, add_object_layer, add_group_layer, reorder_layer, set_layer_property (opacity, lock, offset, parallax).

3. Describe the level

Describe the layout like you would to a level designer: rooms, connections, landmarks, sizes in tiles. Asking for a short ASCII sketch first works well, because you can correct it before tiles are placed.

Level 1 of a dungeon crawler, 48x32 tiles:
- entrance hall at the bottom center, 10x6
- a long corridor north to a 4-way junction
- west: a library room with bookshelves; east: a flooded room
- north: the boss room, 14x10, two pillars
Sketch it as ASCII first (# wall, . floor, ~ water, D door),
wait for my OK, then build it.

4. Floors and walls with terrain tools

For large areas, fill_rect and set_tiles_batch are fast. For anything with edges (walls, shorelines, cliffs) let the terrain tools choose the pieces:

Details and a bitmask cheat sheet: auto-tiling with Smart Tiles and Wang sets.

5. Objects and properties

Gameplay data belongs on the object layer, with a class and custom properties your engine reads:

On Objects add: a point "player_spawn" in the entrance hall;
rectangle objects of class "door" on every doorway with property
locked=false; a tile object chest in the library with property
loot="key_boss". Set the map property "music" to "dungeon_01".

Tools: add_object (rectangle, ellipse, point, polygon, polyline, text, tile), update_object, set_property, set_properties_batch, set_map_property. Properties can target the map, a layer, an object or a tile.

6. Render, check, iterate

Ask the AI to look at its result rather than trust it:

Render the map to C:/maps/level1.png with return_image, and list
anything that looks wrong (gaps in walls, doors into walls,
unreachable rooms). Then run validate_map and fix the issues.

render_map_to_image renders the whole map to a PNG without a dialog; with return_image: true the picture also comes back to the model. validate_map reports empty layers, unused tilesets and missing images. get_semantic_map gives a compact text view that is cheap to re-read after each change. Save with save_map when you are happy, and keep the file under version control.

Stone dungeon rooms rendered from Tiled
A development test map rendered with render_map_to_image. Tiles: Screaming Brain Studios (CC0).

Tips for bigger maps

Get Tiled MCP Pro
$10 once on itch.io, free updates.

itch.io · $10

More guides