Gridwright Start for $1

GameMaker Autotile: Build a 47-Tile Set the Fast Way

How GameMaker auto tiles work: the tile set rules, the 47 and 16 tile templates, painting with the AutoTile tool, and making all 47 tiles from one template.

Autotile Builder at work
Autotile Builder at work: Complete autotile sets from a small template.

You drew a grass tile and a dirt tile, made a tile set in GameMaker, and started painting a path in the room. Every corner came out wrong. Dirt squares sit in the grass with hard edges, inner corners are missing, and every time you change the path you go back and fix ten tiles by hand. GameMaker can do that work for you with auto tiles, but only if you give it a full set of edge and corner pieces, and drawing 47 of them is the part nobody wants to do.

This guide covers how GameMaker's auto tiles work, the tile set rules that trip people up, how to fill the 47-tile template, and how to get all 47 tiles from one small drawing. You can try it here while you read: the Autotile Builder's free demo runs on its page.

What an auto tile does in GameMaker

An auto tile is a group of tiles that know which neighbour they belong next to. When you paint with it in the Room Editor, GameMaker looks at the cells around each tile you place and picks the piece that matches: an edge where grass meets dirt on one side, a corner where it meets on two, a full centre tile where it is surrounded. You paint a rough shape and the borders draw themselves.

Autotile Builder in use
Autotile Builder in use. Every tool runs in your browser, nothing to install.

For that to work, the auto tile needs one tile for every case it can meet. GameMaker gives you two templates:

  • 47 tiles. Every combination of sides and corners, including the small inner corners. The manual suggests it for side-on views and for top-down maps where walls need many connections.
  • 16 tiles. A smaller set with fewer joins. The manual suggests it for top-down maps and landscapes, and says neither choice is a hard rule.

The 47-tile set is the one that handles thin paths, single islands and diagonal turns without visible gaps, so it is the one this guide builds.

Set up the tile set first

A GameMaker tile set is one image cut into cells. You make a sprite from your tile sheet, then a Tile Set asset that points at that sprite. Three settings matter:

Autotile Builder in use
Autotile Builder in use. Every tool runs in your browser, nothing to install.
  1. Tile width and height. The base tile size defaults to 16 px square. Set it to your art's size before anything else.
  2. Offset and separation. If your sheet has a margin around the edge or a gap between tiles, enter it here. A sheet packed edge to edge needs both at 0.
  3. Output Border. GameMaker adds extra pixels around each tile when it stores the image, so tiles don't show thin cracks when they are drawn scaled. The default is 2. If you zoom the camera or scale the game, a larger value can help.

One rule surprises almost everyone: the top-left cell of a tile set must always be empty. GameMaker uses it as the eraser tile and ignores any pixels in it. If your sheet starts with a real tile in that corner, that tile is lost. Before you make the sprite, give the sheet an empty first cell. The simplest way is to widen the image by one tile on the left in any image editor and leave the new column transparent. The extra empty cells in that column do no harm.

Fill the 47-tile template

Open the tile set, then open the Autotile Editor from the Tile Set Editor. In the Templates area click the 47 tile button. GameMaker shows a template: light grey marks the outside edge and darker grey marks the fill.

Autotile Builder in use
Autotile Builder in use. Every tool runs in your browser, nothing to install.

Now you match your tiles to it. Click the first free cell of the template, then click the tile from your tile set on the left that has the same shape. Repeat for each cell. The source image doesn't have to follow any fixed order: you place each tile into its slot by hand, so a sheet laid out any way works. If you put a tile in the wrong slot, select the slot and choose the empty tile to clear it. Show Template overlays the template on your result, which makes a wrong corner easy to spot.

Matching 47 tiles goes quickly when the tiles are clean and complete. It goes slowly when you find out on slot 31 that you never drew the inner corner with grass on three sides.

Where the 47 tiles come from

This is the real cost of auto tiling. Each of the 47 tiles is a different mix of edges and corners, and they all have to meet each other exactly: the edge on one tile must continue into the next without a step, and the inner corners must line up with the outer ones. Drawn by hand, that is a long afternoon per terrain, and a single misplaced pixel shows up as a seam every time that pair of tiles touches.

Christmas Village
Christmas Village: 16x16 top-down Christmas village: snow autotiles, lit houses, Santa, elves, reindeer, workshop, UI. One of the 150 packs in Gridwright.

The Autotile Builder builds the set from a small template instead: a 3x3 island, or the compact 2x3 layout, at any tile size from 8 to 128 px. It builds every one of the 47 tiles from quarters of that template, so every edge continues and every corner meets, and it paints a map you can edit or randomise.

Its seam check looks at every place two cells of a terrain meet and marks breaks in red with a name, such as an edge that does not repeat. You see the problem before you have filled a single template slot in GameMaker, and you fix it once in the template, not in 47 tiles.

The JSON saved next to the atlas lists each tile's neighbour mask in order, 8 tiles to a row, so you know which sides and corners every tile connects on. That turns the matching step in the Autotile Editor into reading, not guessing.

Your game, looking finished

Every Gridwright asset pack, made to fit together, and all 44 tools for the fiddly work, with every new release, for $17 a month. Try it in your own game first: 3 days for $1 with every tool and up to 10 packs. Cancel any time.

Start: 3 days for $1 See everything it includes

Paint with it in the Room Editor

With the auto tile filled, painting is the easy part:

Tower Defense Kit
Tower Defense Kit: Top-down TD kit: 8 towers x 3 levels that turn in 16 directions, 10 enemies, effects, roads, UI. One of the 150 packs in Gridwright.
  1. Add a Tile layer to your room and give it your tile set.
  2. At the top of the Room Editor, choose the AutoTile tool.
  3. Pick your terrain from the Autotile Libraries tab and paint.

As you paint, each tile changes to match the tiles around it. If you pick an ordinary tile instead of an auto tile, the tool switches back to the pencil, so check the tool if the borders stop drawing themselves.

The edge of the room is a choice too. By default GameMaker treats the room's border as empty, so a terrain that runs off the edge gets an edge drawn along the border. The Open Or Closed Edges button in the Autotile Editor changes that, which is what you want for ground that should continue past the screen.

Animated terrain

Water and lava often animate. GameMaker's tile sets support animated tiles, with two rules: an animation must be a power of two long (2, 4, 8 or 16 frames), and the frame speed (FPS) is shared by the whole tile set. Plan your frames to that count. In the full edition, the Autotile Builder can animate a terrain over 2 or 3 frames; for GameMaker, use 2 so the count fits.

Changing tiles from code

Auto tiling happens in the editor. At run time you work with tile maps through GML: tilemap_get reads the tile data in a cell, tilemap_set writes it, and tile_set_index changes which tile a tile data value points to. A digging or building game uses these to change the map while it runs. If you change tiles from code, you choose the right piece yourself, so keep the neighbour pattern from the builder's JSON at hand: it tells you which tile fits each combination of neighbours.

What the free demo gives you

The demo on the tool's page does everything for one terrain and one frame and saves the 47-tile blob atlas as a PNG with its JSON, which is all GameMaker needs for one auto tile. The full edition adds 16-tile sets, several terrains in one atlas, 2 to 3 frame animation, and ready files for Godot 4, Tiled and RPG Maker.

Checklist

  • Tile width and height match your art, with offset and separation set for your sheet.
  • The top-left cell of the tile set is empty.
  • All 47 template slots are filled, with Show Template on to check the corners.
  • The seam check shows no gaps before you import.
  • Animated terrain uses 2, 4, 8 or 16 frames.
  • Room edges set to open or closed the way your map needs.

Get those right and every path, cliff and pond you paint in GameMaker draws its own borders. Try the Autotile Builder with one terrain and see the full set before you draw the rest.