New: 36 free tools for Unreal Engine and Unity developers.Try them →

What Is a 47-Tile Blob Tileset? Autotiling Explained

How autotiling works: the 8-neighbour bitmask, why 256 combinations become 47 tiles, and how to draw a tileset that connects in every shape.

In this article
  1. The idea: look at the neighbours
  2. The bitmask
  3. Why 256 becomes 47
  4. 16-tile vs 47-tile
  5. You do not have to draw 47 tiles
  6. Drawing tips for clean autotiles
  7. Using the bitmask in your own code
  8. Summary
  9. FAQ

Paint grass on a tilemap and it should just work: smooth edges where it meets dirt, rounded outer corners, neat inner corners, no seams. That is autotiling, and the most complete version of it uses a 47-tile "blob" tileset. Here is how it works and why the number is 47.

The idea: look at the neighbours

For each filled cell, the engine looks at the eight cells around it: north, north-east, east, south-east, south, south-west, west and north-west. Which of them are filled decides which tile to draw.

The bitmask

Each neighbour gets a bit value. Add up the values of the filled neighbours to get one number:

NeighbourBit
North1
North-east2
East4
South-east8
South16
South-west32
West64
North-west128

A cell with filled neighbours to the north and east gets 1 + 4 = 5. A cell surrounded on all sides gets 255. Eight bits means 256 possible combinations.

Why 256 becomes 47

Look at the north-east corner. If north or east is empty, the tile already shows an edge there, so whether the north-east cell is filled makes no visual difference. A corner only matters when both sides next to it are filled. In that case:

  • corner filled → the tile is solid in that corner,
  • corner empty → the tile needs an inner corner there.

When you drop the corner bits that do not matter, only 47 different tiles remain. That is the blob tileset.

16-tile vs 47-tile

Simpler systems only check the four sides (4 bits, 16 tiles). They are quick to draw but cannot show inner corners, so L-shapes and diagonal edges look blocky. The 47-tile set handles every shape, which is why it is popular for terrain, walls, water and paths.

You do not have to draw 47 tiles

Split each tile into four quarters. Each quarter depends only on three neighbours: one above or below, one to the side and the diagonal between them. That gives just five possible looks for a quarter:

  1. Outer corner
  2. Side edge
  3. Top or bottom edge
  4. Inner corner
  5. Fill

Draw those pieces once and every one of the 47 tiles can be assembled from them. A popular layout for those pieces is the RPG Maker A2 autotile template: 2 tiles wide and 3 tiles tall, with an isolated tile, a tile of inner corners, and a 2 × 2 patch with the outer corners, edges and fill.

The free Autotile Generator takes that template and builds the full 47-tile sheet, with a paintable preview so you can test it immediately. It also exports the bitmask lookup as JSON and a Unity Rule Tile builder script.

Drawing tips for clean autotiles

  • Use an even tile size (16, 32, 48, 64…) so quarters are equal.
  • Keep edges consistent where quarters meet in the middle of each tile, or seams will show.
  • Test big and small shapes: single tiles, one-tile-wide lines, L-shapes and large blobs.
  • Add variation later: once the 47 tiles work, add alternative fill tiles for less repetition.

Using the bitmask in your own code

If your engine has no built-in autotiling (for example Paper2D in Unreal), compute the mask yourself for each filled cell and use a lookup table from mask to tile index:

mask = 0
if filled(x, y+1):   mask += 1    // north
if filled(x+1, y+1): mask += 2    // north-east
if filled(x+1, y):   mask += 4    // east
...
tile = lookup[mask]               // 0..46

Remember that some engines count rows downward, so "north" may be y - 1. Update a cell and its eight neighbours whenever a tile changes.

Summary

  • Autotiling picks a tile from the 8 neighbours of each cell.
  • 256 combinations collapse to 47 because corners only matter next to two filled sides.
  • 47-tile sets handle inner corners; 16-tile sets do not.
  • Draw a small template of five quarter types and generate the rest.

Frequently asked questions

Why is a blob tileset 47 tiles and not 256?

A diagonal neighbour only changes the look when both orthogonal neighbours next to it are also filled. Ignoring diagonals that do not matter reduces the 256 combinations to 47 visually different tiles.

What is the difference between 16-tile and 47-tile autotiling?

16-tile (4-bit) autotiling only looks at the four sides, so it cannot draw inner corners properly. 47-tile (8-bit) autotiling also checks diagonals and handles inner corners, which looks much better for terrain.

Do I have to draw all 47 tiles by hand?

No. Each tile is made of four quarters, and each quarter only has five possible looks. Draw a small template with those pieces and a generator can assemble all 47 tiles.

Which engines support autotiling?

Unity has Rule Tiles in the 2D Tilemap Extras package. Godot has terrains. Unreal's Paper2D tile maps have no built-in autotiling, but you can apply the bitmask in your own Blueprint or C++ code.

  • #2d
  • #tilemaps
  • #pixel art
Written by Renish

Indie Unreal Engine developer and founder of Tvashta Studio. Builds the Shopping Simulator Kit plugin in UE5 C++ and the free tools on this site, and writes these guides from that work for Unreal Engine and Unity developers. More about the studio.

Related articles

All articles →