19
Tiles
meleki edited this page 2026-09-29 19:00:41 +02:00

Tiles

A tile is what a tilemap paints with. It is its own asset, not part of a map: the same grass is used by several maps, the same way a texture is worn by several sprites. Until #131 the asset was called autotile; a project still holding that type loses those assets on load (no migration, #137).

A tile is one of four kinds:

Kind Block Tiles it produces What it does
None (1x1) 1 tile 1 the picture as it is, repeated in every painted cell — the default
Floor (2x3) 2 tiles wide, 3 tall 47 an autotile: edges, convex corners and notches (inner corners)
Wall (2x2) 2 tiles wide, 2 tall 16 an autotile: edges and convex corners, no notches
Terrain (6x4) 6 tiles wide, 4 tall 47 an autotile in the layout of the common top-down sheets, see below

A plain tile (None) ignores its neighbours. The autotile kinds draw their own edges: paint a patch of grass onto a map and the borders towards everything else — the rounded corners, the straight edges, the notch where two edges meet — are picked per cell from one hand-drawn block.

The block

A block is a picture cut into quarter tiles. For a plain tile the block is the tile itself and its four quarters are drawn where they are. The two autotile kinds are the two shapes the classic RPG-Maker sheets use.

The bottom 2x2 tiles of either block are one fully bordered tile: its middle four quarters are the inside, the ring around them the borders and the convex corners. A floor block has one tile row more; its right tile holds the four notches — the piece for a corner whose two sides are joined but whose diagonal is not. The tile to the left of them is a lone tile, the same picture the four convex corners make, and it stays unused. A wall knows no diagonals, which is why it is a row shorter and has 16 tiles instead of 47.

The inside is taken turned by half a tile: the top-left corner of a drawn tile gets the quarter from the bottom right of the block's inside. That is not a detail — it is what makes two tiles next to each other continue the drawing, because the quarters that meet on screen are the ones that touch in the sheet. The borders behave normally, left on the left and top on top. The rule is the one of RPG Maker MZ (Tilemap.FLOOR_AUTOTILE_TABLE), and the tests check the editor against that table row by row.

Terrain

The terrain block is the layout many top-down tilesets use for ground, cliffs or stone patches:

 column   0           1-3                     4 | 5
 row 0    strip top   top-left, top, top-right    notch bottom right | notch bottom left
 row 1    strip mid   left, inside, right         notch top right    | notch top left
 row 2    strip end   bottom-left, bottom, ...    notches TL + BR    | notches TR + BL
 row 3    lone tile   strip left, middle, right   (unused)
  • Columns 0-3 hold one whole tile for each of the 16 ways the four sides can join: the bordered 3x3, a vertical and a horizontal strip, and the lone tile.
  • Columns 4-5 hold the notches. The 2x2 on top is a small hole seen from its four sides, so each of its tiles has one notch. Row 2 has the two diagonal pairs. The two tiles in row 3 are not used.
  • A tile the sheet draws is taken whole. A strip or a lone rock looks the way the artist drew it, even where it differs from the 3x3.
  • The rest is composed: an edge with a notch, or notches next to each other. It is the tile of its sides with the notch quarters put in. A notch also brings the quarter above or below it from the same notch tile, when that quarter would be plain inside. That is what keeps a cliff's notch whole: its wall reaches over the crossing into the quarter above. On flat ground that quarter is plain inside anyway, so nothing changes.
  • The inside is not turned by half a tile as in a floor block. The 3x3 is an ordinary nine-slice.

The tile size comes from the picture: the kind says how many tiles wide a block is, so a 96 px wide floor block means 48 px tiles and 24 px quarters, and a 48 px square picture is a 48 px plain tile. A plain tile only has to be square — an odd side is fine; an autotile block must split evenly into its quarters. There is no field for it — a second number could only ever disagree with the picture. What the tab does check is that the block has the shape its kind asks for; a picture that does not fit is kept and named, never silently dropped.

The asset

+ → Tile makes an empty one, of kind None. What it holds:

  • Pictures — one block per animation step, in the order they run. A picture is either a texture (a file that holds nothing but the one block), a frame of a texture (one block cut out of a sheet that holds many), a vector drawing, which the strip offers like any other picture — it has no frames, so it is always the whole canvas —, or pixel art, whole or one of its frames. Cutting frames is the Textures tab, by hand or with Slice… where the sheet is a regular grid.
  • Kind — None (1x1), Floor (2x3), Wall (2x2) or Terrain (6x4). Chosen, not guessed: a sheet whose rows alternate between the two shapes (Outside_A4 in RPG Maker) would be read wrong either way, and the choice is one click.
  • Frames per second and Playback (Loop or Ping-pong) — how the pictures run. One picture is a still tile whatever they say; three, as in an animated water sheet, are three steps. Ping-pong turns on the last picture, so 0 1 2 1 rather than 0 1 2 2 1.
  • Solid — off by default. A solid tile blocks movement wherever it is painted, on every map and every layer (#132); see Tilemaps.
  • One-way (from above) — off by default. A solid tile with it on blocks only from above: a platform one jumps through from below (#155); see Tilemaps.
  • One-way angle — 45 by default, 0 to 90, shown while One-way is on. How far a contact may lean from straight up and still land on the tile (#159).
  • Friction and Bounciness — 0.5 and 0 by default, shown while Solid is on. The surface a cell offers to what meets it, mixed like two colliders' (#193); see Physics.
  • Collision scale — 1 by default. How big a solid cell blocks against its square, drawn in or out only on the sides without a blocking neighbour (#140); see Tilemaps.
  • Sort offset — 0 by default, a whole number of rows from -16 to 16. On a layer sorted by Y a cell of this tile is sorted as if it stood that many rows further down (#228): a treetop at 1 sorts with the trunk below it. See Tilemaps.
  • A tile whose picture is a frame with collision outlines blocks with them instead of its square (#141) — an autotile with its outlines cut into the same quarters as its picture; see Tilemaps.

Kind, rate, playback, the solid switch, the collision scale and the sort offset are ordinary properties, so the inspector shows them like any other asset's — undo, defaults and the gold mark for a non-default value come for free.

The tab

  • Each tile opens in a tab of its own. The picker in the header chooses the kind, Fit frames the board. The readout on the right says kind, tile size, pictures, rate and how many tiles the block produces — or not usable yet with the reason written under the board.
  • The board shows every tile the block can produce, captioned with the neighbours that ask for it: NESW-nw is "joined on all four sides, with a notch towards the north-west", · is a lone tile. The caption stands in two lines, the joined sides above and the notched corners below. All captions share one size, and they stay sharp at any zoom. Once a tile is too small on screen for them to be read, they are left out.
  • Next to the grid a sample map is composed from the same quarters. It is a ring with a hole and a step, and below it paths one tile wide: a tunnel leaving the ring, straights both ways, bends, T-junctions, a crossing and a dead end. This is where one sees whether the edges really continue across tile borders. In a wide tab the map stands beside the grid, in a tall one below it. Fit picks whichever draws the tiles larger.
  • For a plain tile the grid is the one tile and the sample map shows it repeated. Both run the animation at the set rate.
  • A drag pans the board; nothing on it is edited. The wheel zooms in the same steps as the Scene view (12.5 % to 2400 %, counted in screen pixels), so every pixel of a tile is drawn equally wide.
  • Fit picks the largest of these steps at which the whole board fits the tab. Until you pan or zoom by hand, the board fits itself again when the tab is resized or the tiles change size.
  • The picture list on the right is the animation: + Picture adds a texture or a frame, Remove takes the selected one out, and dragging a row to another place reorders the steps. Every one of those is an undo step.

Where they are placed

A tile is never placed by itself: it is laid down by a tilemap, which is the asset that carries a grid of cells and is placed in a scene. Two different tiles do not join each other there — each autotile closes against everything else, as the RPG-Maker sheets are drawn.

Deleting a tile that is painted on a map empties its cells in the same step (#268). The delete dialog says how many cells on how many tilemaps, and Ctrl+Z brings the tile and its cells back together. A brush still holding the deleted tile paints nothing and asks for a tile.

A cell can still name a tile the project does not have, in an older file or one edited by hand. It is empty for everything that looks at the map: it is not drawn, it does not block, Tile at reads it as empty and Fill fills across it. Only Pick says what it is. The file keeps it until the cell is painted over or erased.