Jaconir

Bitmask Autotile: How to Build Seamless Tile Maps Automatically

March 10, 2026
8 min read

Anyone who has manually placed tiles in a game editor knows the tedium — picking the right corner tile, the right edge tile, the right inner corner for every single terrain transition. Bitmask autotiling solves this entirely. You paint terrain with a single tile type and the engine automatically selects the correct variant based on which neighbouring cells are filled. This guide explains how bitmask autotiling works, how to structure your tile art, and how to set it up with the free browser-based Jaconir Bitmask Autotile Generator.

What Is Bitmask Autotiling?

A bitmask is a binary representation of a tile's neighbourhood. Each of the 8 surrounding cells (top-left, top, top-right, left, right, bottom-left, bottom, bottom-right) is either filled (1) or empty (0). The combination of these 8 bits produces a number from 0 to 255, and each unique number maps to a specific tile variant that visually fits that neighbourhood.

In practice this means:

  • A tile surrounded on all sides = full interior tile
  • A tile with nothing above = top edge tile
  • A tile with nothing above-left but filled everywhere else = inner corner tile
  • A lone tile = isolated tile variant

Instead of placing each variant manually, the autotile system reads the bitmask and places the correct art automatically as you paint.

The Two Standard Autotile Formats

47-Tile Format (Full Bitmask)

The full bitmask considers all 8 neighbours, producing 256 possible combinations. Many combinations are visually identical (mirrored or rotated), so in practice you need 47 unique tile variants to cover all meaningful cases. This is the format used by Godot's autotile system and most modern tile engines.

The 47 tiles cover every possible combination of filled/empty neighbours that produces a visually distinct result. It produces the smoothest, most natural-looking terrain with proper inner corners and diagonal handling.

16-Tile Format (Simplified Bitmask)

The simplified format only considers the 4 cardinal neighbours (top, right, bottom, left), ignoring diagonals. This produces 16 combinations — far easier to draw. The tradeoff is no inner corners, which gives terrain a blockier appearance. Used by RPG Maker and some older engines.

For pixel art styles or games with a tile-grid aesthetic, the 16-tile format is often the right choice. For natural terrain (grass, water, sand), the 47-tile format looks significantly better.

How to Set Up a Bitmask Autotile — Step by Step

Step 1: Design Your Base Tile

Draw the fully surrounded interior tile first — this is your base terrain with no edges visible. Every other variant is derived from this by adding edge art, corners, and transitions. Keep the interior tile tileable — it should look seamless when repeated.

Step 2: Generate the Tile Layout

Open Jaconir Bitmask Autotile Generator and select your format (47-tile or 16-tile). The tool generates a template showing every required tile variant with the bitmask value labelled. Use this as the reference layout for your tile art — draw each variant in the correct position.

Step 3: Draw All Variants

Work through the variants systematically. For each one, the bitmask label tells you which neighbours are filled — draw the tile to match. Tip: draw all edge variants first, then corners, then isolated tiles. The inner corner tiles (where a diagonal is empty but all cardinals are filled) are the trickiest to get right visually.

Step 4: Export and Import to Your Engine

Export the complete tileset as a single PNG. Then configure the autotile in your engine using the bitmask values.

Setting Up Autotile in Godot

Godot supports bitmask autotiling natively in both Godot 3 (TileSet) and Godot 4 (TileMap with terrain sets).

Godot 4 (recommended):

  1. Open the TileSet editor and add your autotile texture
  2. Go to the Terrains tab and create a new terrain set
  3. Set the terrain mode to "Match Corners and Sides" (47-tile) or "Match Sides" (16-tile)
  4. Paint each tile variant with the correct terrain bit combination
  5. In TileMap, select the terrain and paint — Godot handles variant selection automatically

Godot 3:

  1. In TileSet, set the tile type to Autotile
  2. Set the autotile bitmask type (3×3 for 47-tile, 2×2 for 16-tile)
  3. Use the Bitmask mode in the TileSet editor to assign bitmask values to each tile variant

Setting Up Autotile in RPG Maker

RPG Maker uses the 16-tile format natively, laid out in a specific A-tile format. Your 16 variants must be arranged in the exact order RPG Maker expects — the Bitmask Autotile Generator can export in RPG Maker-compatible layout directly.

Common Autotile Mistakes

  • Wrong variant order in the tileset: The engine reads variants by position. If your tile art doesn't match the expected layout, wrong tiles appear. Use a generator template as your reference.
  • Missing inner corner tiles: Inner corners are the most commonly forgotten variants. Without them, concave terrain edges look broken.
  • Not testing in isolation: Always test your autotile with a single painted cell, then expand — isolated tile problems are caught immediately this way.
  • Ignoring diagonal bitmasks: In the 47-tile format, diagonals matter. A tile with all cardinals filled but top-left empty is a different variant than fully surrounded.

FAQ

Do I need 47 tiles or 16?

Use 47-tile for organic terrain (grass, water, lava) where inner corners matter visually. Use 16-tile for structured environments (dungeon walls, city blocks) where the blocky look fits the aesthetic or you want to minimise art work.

Can I use autotile for walls, not just floors?

Yes — autotile works for any terrain type. Wall autotiling is very common in dungeon games. The setup is identical, the art just depicts walls instead of floor transitions.

How does the bitmask number map to tile variants?

Each bit represents one neighbour. Top-left=1, Top=2, Top-right=4, Left=8, Right=16, Bottom-left=32, Bottom=64, Bottom-right=128. Sum the values of all filled neighbours to get the bitmask. The generator handles this mapping automatically.

Conclusion

Bitmask autotiling is one of the most impactful tools in a 2D game developer's workflow. Once configured, painting terrain becomes instant — no manual variant selection, no wrong tiles, no edge-fixing. The upfront art investment of 16 or 47 variants pays back on every map you build.

Generate your autotile template: Jaconir Bitmask Autotile Generator →