Quick answer: Every tile in the terrain must have its peering bits painted. Pick the correct Terrain Mode — Match Corners and Sides is the most flexible. Re-paint after adding tiles.

A grass terrain set autotiles, but inner corners pick a wrong edge tile. The peering bits on some terrain tiles weren’t painted, so the matcher has no candidate.

Terrain Modes

For full grass/dirt transitions including inner corners, use Match Corners and Sides.

Paint Every Peering Bit

In the TileSet editor → Terrains tab: select the terrain, then paint the peering bits on each tile that belongs to it. A tile with missing bits is invisible to the autotiler for those configurations — it falls back to a wrong tile.

Complete the Tile Set

A full corners-and-sides terrain needs ~47 unique tiles to cover every neighbor combination. If your tileset art has fewer, some combinations have no valid tile — the autotiler picks the closest, which looks wrong.

Refresh After Edits

tilemap.set_cells_terrain_connect(0, cells, 0, 0)
tilemap.update_internals()

Use set_cells_terrain_connect to paint terrain-aware; it recomputes neighbors.

Verifying

Paint grass over dirt. Edges, outer corners, and inner corners all use the correct transition tiles. No mismatched seams.

“Autotiling is only as good as the peering bits. Paint every bit on every terrain tile.”

Use a reference 47-tile blob template when authoring terrain art — guarantees every neighbor combination has a tile.