Quick answer: GameMaker’s auto-tile picks the wrong tile when the auto-tile chart has a slot filled with the wrong piece of art, when you are painting with a freehand brush rather than the auto-tile brush, or when your art does not match the exact 16-tile or 47-tile template layout. Verify the brush, audit the chart, and re-slice your art against the template.

You finally finished painting a nice grass border tileset. You open the room editor, paint a few blobs of grass, and the edges are a mess — flat sides on corners, inside-corners where outside-corners should be, and a handful of tiles that are just plain wrong. Auto-tiling is one of GameMaker’s most useful features, but it relies on you describing your tile relationships precisely, and the system silently accepts any configuration — even a broken one.

How GameMaker Auto-Tile Works

Auto-tile is a lookup. GameMaker scans the eight neighbors of every tile position (or the four cardinals for 16-tile mode) and produces a bitmask describing which are “the same terrain.” It then uses that bitmask as an index into the auto-tile chart you filled out on the tileset asset. Whatever tile art you dragged into that slot is what gets painted.

Two implications follow: first, the chart must exactly mirror your art. If slot 23 has a tile that looks like slot 17’s art, any bitmask that resolves to 23 will paint the wrong-looking tile. Second, the chart only helps if you are actually using an auto-tile brush. Painting with a regular brush just places the single tile under the cursor — no lookup happens.

Check the Brush First

Open the room editor, click the tile layer you are painting on, and look at the brush panel. GameMaker shows the current brush as a small preview. If it is a single tile, you are freehand painting. Click the brush selector, switch to Asset Brushes, and pick the auto-tile brush you created on the tileset. Auto-tile brushes show a small chart icon in their preview — plain tile brushes do not.

When painting, drag across multiple cells rather than clicking single cells. Auto-tile re-evaluates neighbors on every cell you paint, so a single click may look wrong until you extend the shape. The bug is that a one-cell island has no neighbors, so it resolves to the “all corners” tile — which is often a tiny pebble or isolated shape that looks unlike the rest of the tileset.

Audit the Auto-Tile Chart

Open the tileset, click Auto Tile in the left sidebar, and look at the chart you built. For a 47-tile auto-tile you should see 47 labeled slots arranged in the standard GameMaker layout — center, straight edges, convex corners, concave corners, and so on. Each slot has a label like outer-top-left or horizontal-run. Hover any slot to see a preview of which neighbor pattern it represents.

Now walk through each slot and verify the art inside matches. The most common mistakes:

A fast way to sanity-check: paint a large rectangle of terrain in the room editor. A correct chart produces a clean rectangle with proper corners, straight edges, and uniform fill. A broken chart looks patchwork, with mismatches concentrated in specific corner or edge positions.

Match Art to the 47-Tile Template

The 47-tile template is an industry-standard layout. GameMaker expects your tile art to match it or to slot in manually via the chart. If your art was drawn for a different autotile system (RPG Maker’s 48-tile A layer, Tiled’s Wang tiles, or an ad-hoc set), some slots will have no valid tile, and you will see those missing configurations pick a neighboring slot’s art by accident.

Download the official GameMaker 47-tile template image, overlay it on your tileset, and check that each logical position has matching art. If not, either re-slice your tileset to match the template or drop to 16-tile mode. 16-tile requires only 16 pieces of art (one for each cardinal neighbor combination) and is much easier to author correctly, at the cost of missing inner-corner detail on concave shapes.

Runtime Diagnostics

When you need to debug a live tilemap, you can query the tile at any position and see exactly which tile index the autotile system chose. This helps pinpoint which chart slot is wrong.

/// oTileDebug - Draw event overlays every cell's tile index
var layer_id = layer_get_id("Tiles_Ground");
var tm = layer_tilemap_get_id(layer_id);
var cols = tilemap_get_width(tm);
var rows = tilemap_get_height(tm);
var cs = tilemap_get_tile_width(tm);

for (var gx = 0; gx < cols; gx++)
{
    for (var gy = 0; gy < rows; gy++)
    {
        var data = tilemap_get(tm, gx, gy);
        var idx  = tile_get_index(data);
        if (idx != 0)
        {
            draw_text(gx * cs + 2,
                      gy * cs + 2,
                      string(idx));
        }
    }
}

Run the room, move next to a wrong-looking tile, and read its index. Then open the tileset, click the tile at that index, and compare it to what should be at that position. If the art is wrong, move it in the chart. If the art is right but was chosen for the wrong neighbor pattern, the connection rule is wrong — swap the slot assignment.

“Auto-tile is a contract between the chart and the art. Break the contract in one slot and every painted rectangle tells you exactly where the break is.”

Related Issues

If your tiles render correctly but collision masks behave oddly after switching tiles, see Surface Lost After Alt-Tab — the cached tilemap surface rebuild path affects both rendering and collision. If you are painting to the wrong layer entirely, check Draw Event Not Firing.

Auto-tile chart is just a lookup table. Wrong slot = wrong tile — every time, reliably, reproducibly.