Skip to content

Godot Tileset Collision — Physics Polygons from Tile Alpha

Drawing a collision shape on each of 47 tiles in Godot's TileSet editor is slow, and one pixel off is enough for a character to snag on a seam. The Tile workspace traces the shape from each tile's alpha, lets you drag the points that are wrong, and hands Godot a physics layer built by its own import script.

Drop a tileset or autotile sheet (PNG)
Runs in your browser. Files are not uploaded.
Studio Tile workspace: a CC0 blob-47 tileset (16 px) with a collision polygon traced from the alpha of every tile
The real Studio with a CC0 asset (OpenGameArt).
Exports to
  • Godot 4 TileSetVerified· Godot 4.7.2
  • TiledVerified· Tiled 1.12.2
  • Unity 6 Rule TileVerified· Unity 6000.5.3f1 + 2D Tilemap Extras 8.0.3
  • LDtkPartly verified· LDtk 1.5.3 schema + loader

What it does

  • Three readings of a tile's alpha: Outline polygon follows the solid edge, Exact rectangles covers only the solid pixels with axis-aligned boxes, Box wraps everything in one rectangle.
  • Shapes live in tile pixels, snapped to whole pixels: drag a point, double-click an edge to add one, Alt+click to remove one. Every edit is one undo step.
  • Show shapes of every tile draws all polygons over the sheet at once, so a gap between two neighbouring tiles shows up before you export.
  • On export, the shapes you edited stay exactly as they are; the collision mode you pick fills in the tiles you never touched, from their alpha.
  • nerulio_tileset_import.gd adds one physics layer (collision layer 1, mask 1) and writes each polygon onto its tile, shifted by half a tile because Godot measures tile shapes from the tile centre.
  • Checked by reading the TileSet back in Godot 4.7.2: every polygon matched point for point — 49/49, 48/48 and 47/47 tiles on the corpus blob sets, 80/80 on a four-terrain dual-grid pack.

How to do it

  1. Drop the tileset and press Use this grid.
  2. Apply a layout or paint terrain bits; only tiles with bits can carry a shape.
  3. Press C, pick a tile, trace it as Outline polygon, Exact rectangles or Box, and drag any point that sits wrong.
  4. Open Export (Ctrl+E), tick Godot 4 and choose the collision mode for untouched tiles.
  5. In Godot, run nerulio_tileset_import.gd with File › Run and put the saved TileSet on a TileMapLayer.

Collision modes and what Godot receives

ModeShape writtenHolesGood for
Outline polygonThe traced outer edge along pixel borders, one polygon per solid islandFilled (outer loop only)Slopes, rounded ledges, irregular rock
Exact rectanglesA few axis-aligned rectangles that together cover exactly the solid pixelsStay openTiles with a gap, L shapes, notched platforms
BoxOne rectangle around every non-transparent pixelFilledFull blocks, crates, cheap physics
Only edited shapesYour hand-edited polygons; other tiles get noneAs you drew themSets where only a few tiles should collide
NoneNo physics layer at all—Decoration-only tilesets

A fully opaque tile becomes one tile-sized square under Box and Exact rectangles. A long outline is simplified until the tile holds at most 256 points.

Engine exports and how each was checked

"Verified" means the exported files were loaded by the real engine or tool on real CC0 assets and the result was compared with the source. Anything that was not loaded is labelled as such.

TargetFilesCheck
Godot 4 TileSetPNG · nerulio-tileset.json · nerulio_tileset_import.gdVerified Godot 4.7.2The included import script builds the TileSet with terrain peering bits; a map painted with set_cells_terrain_connect equals the Studio preview in every cell on 9 corpus sheets.
Tiled.tsx Wang set · sample.tmxVerified Tiled 1.12.2Tiled's own readers load every Wang ID as written and the sample map renders pixel-exact. The terrain brush itself was not driven.
Unity 6 Rule Tilenerulio-ruletile.json · Editor/NerulioRuleTileImporter.csVerified Unity 6000.5.3f1 + 2D Tilemap Extras 8.0.3Blob and side sets: a painted Tilemap shows the predicted sprite in every cell. Corner / dual-grid sets are not exported to Unity.
LDtk.ldtk (1.5.3) · rules · sample levelPartly verified LDtk 1.5.3 schema + loaderAccepted by the LDtk JSON schema and its official loader, and the rules re-run to the exported tiles; not opened in the LDtk app.

Evidence

Layouts identified from the pixels alone on the tile corpus: 4 blob-47 templates and 2 Wang templates with high confidence, a real 64 px cave tileset with medium confidence — every tile's bits right. Godot 4.7.2 painted every test cell exactly as the Studio predicted (485/485 per blob set, 251/251 on a 4-terrain dual-grid pack); Tiled 1.12.2 read every Wang ID back; Unity 6000.5 matched on every painted cell of the blob and side sets.

Limits

  • Tiled's terrain brush, the LDtk app and Godot's editor painter were not driven; the checks use the engines' readers and set_cells_terrain_connect.
  • Unity gets blob and side sets only; several terrains become several Rule Tiles with no transitions between them.
  • Isometric and hex tiles, animated tiles, occlusion and navigation layers are out of scope.
  • Suggesting bits without a known layout needs a reference "full" tile; on side-only path templates the guess can fail until you select it.

Questions

My character falls through the floor. Is the physics layer there?

The import script adds a physics layer only when at least one tile has a shape, and sets it to collision layer 1 and mask 1. Your body's collision mask has to include layer 1; if your project uses other layer numbers, change them on the TileSet after import.

Why does a tile with a hole come out fully solid?

Outline polygon keeps only the outer loop, and Godot treats the inside of every polygon as solid, so the hole fills in. Exact rectangles covers just the solid pixels, so the opening stays open.

Can I set one-way platforms or per-tile layers here?

No. The export writes one physics layer with plain polygons. One-way collision, extra layers and physics materials are set in Godot's TileSet editor once the set is imported.

Is collision also written for Unity, Tiled or LDtk?

No, collision goes to Godot only. The Unity Rule Tile, Tiled and LDtk exports carry the tiles and their rules without shapes, and tile collision inside Unity was not checked.

Is it free, and do I need an account?

Everything on these pages is free and works without an account. There is no watermark and no export that is held back.

Are my sprites uploaded?

No. The Studio decodes, packs and exports in this browser tab. Projects are autosaved in the browser (IndexedDB) and can be saved as a .nerulio file.

Does it need Aseprite or an engine plugin installed?

No. .aseprite files are read and written in the browser, and each engine bundle carries what that engine needs (for Godot, the import settings and scene; for Unity and the Godot TileSet, a small editor script).