Why autotiling exists
A patch of grass on dirt isn't one tile repeated. It needs a top edge, a bottom edge, two sides, four outer corners and four inner corners where the dirt cuts back in. Placing those by hand means picking the right piece for every cell, and redoing the neighbours every time you change the shape. Autotiling makes the shape the only thing you think about.
You paint where the terrain is. The editor looks at the cells around each tile, works out which corners are covered, and swaps in the matching piece. Erase a cell and the edges around it re-join on their own.
How a 15-piece corner autotile works
TileMap Studio uses corner-based autotiling, also called Wang corner tiles. Each tile asks one question about each of its four corners: is this corner terrain or not? Four yes/no answers give 16 combinations. One of them is "no terrain at all", which is just the base ground, so a full set is 15 terrain pieces plus the base.
Number the corners and the layout becomes simple arithmetic: top-left is 1, top-right 2, bottom-left 4 and bottom-right 8. Add up the corners that are terrain and you have the tile's number, which is also its position in a 4×4 atlas, reading left to right, top to bottom.
- 0 base
- 1 top-left
- 2 top-right
- 3 top edge
- 4 bottom-left
- 5 left edge
- 6 diagonal
- 7 inner, bottom-right open
- 8 bottom-right
- 9 diagonal
- 10 right edge
- 11 inner, bottom-left open
- 12 bottom edge
- 13 inner, top-right open
- 14 inner, top-left open
- 15 full terrain
A tile with only the bottom-right corner covered is number 8: a small outer corner. Top-left plus top-right is 1 + 2 = 3: the top edge. Every corner covered is 15: solid grass.
The dual grid: why terrain sits half a tile off
Corner autotiles are drawn on a grid that is shifted half a tile up and left from the cells you paint. Each tile sits on the point where four painted cells meet, and its four corners show those four cells. This is called a dual grid, and it is why one painted cell becomes a smooth rounded blob instead of a hard square.
You never have to think about it in the editor. It matters when you take a map into an engine: the terrain
layer needs the same half-tile offset. TileMap Studio's Tiled export writes it for you as a
<tileoffset> on the tileset, and the Godot and
Unity guides show where to set it.
15, 16 or 47 tiles?
| Method | Looks at | Tiles | Good for |
|---|---|---|---|
| Corner (Wang corners) | 4 corners | 15 + base | Natural terrain: grass, sand, water, snow |
| Edge (Wang edges) | 4 edges | 16 | Paths, pipes, fences, roads |
| Blob | 8 neighbours | 47 | Walls and cliffs with one-tile-wide details |
The 15-piece corner set is the best value for most terrain: few tiles to draw, smooth inner and outer corners, and two terrains blend into each other cleanly. Its weakness is very thin shapes: a single painted cell always becomes a small rounded patch, never a one-pixel line.
Painting autotile terrain in TileMap Studio
- Open the editor. The starter SpriteLab grass-over-dirt atlas is loaded for you.
- Pick the Terrain tool (T), or click the atlas in the tileset panel.
- Drag on the map to paint grass. Shift-drag erases back to dirt.
- Use Fill (F) to flood a whole area with terrain, or "Fill base" on the atlas to lay dirt under everything.
Terrain goes on its own layer, so you can paint props and paths over it without the autotiler touching them. To use your own terrain, import a 4×4 atlas PNG and choose "Terrain atlas" when asked how to split it.
Where to get autotile tilesets
Draw one by following the diagram above, use the free starter set, or generate one: SpriteLab turns a text prompt like "mossy cobblestone over mud" into a 15-piece corner atlas in exactly this layout, with the base terrain blended underneath. It paints straight away here with the Terrain brush.
Questions
What is an autotile?
An autotile is a set of tiles drawn so that every possible edge and corner of a terrain has its own piece. An editor that understands the set can pick the right piece automatically as you paint.
How many tiles does an autotile set need?
It depends on the method. Corner-based (Wang) sets need 15 pieces plus an optional base, edge-based sets need 16, and "blob" sets that track all eight neighbours need 47. TileMap Studio uses the 15-piece corner layout.
What is the difference between 15-tile, 16-tile and 47-tile autotiles?
A 15-tile set looks at the four corners of each tile, which is enough for smooth terrain blobs with inner and outer corners. A 16-tile set looks at the four edges instead. A 47-tile blob set looks at all eight neighbours and can draw thin one-tile-wide shapes cleanly, at the cost of drawing three times as many tiles.
How do I make my own autotile tileset?
Draw a 4×4 grid of tiles where each cell number equals its corner bitmask (top-left 1, top-right 2, bottom-left 4, bottom-right 8), as in the diagram on this page. Or describe the terrain to SpriteLab's AI tileset generator, which outputs this exact layout.
Does Godot or Tiled support autotiling?
Yes. Godot 4 calls it terrains, inside a TileSet resource, and Tiled calls it terrain sets (Wang sets). Both support corner-based sets like the one TileMap Studio uses, though you have to set up the terrain rules in each tool.