Skip to content

LDtk Auto-Layer Rules from an Autotile Sheet

LDtk auto-layer rules are powerful but "prep-heavy". The Studio writes one rule per tile from the recognised terrain bits — checked against LDtk's JSON schema, its official loader and an independent re-run of the rules, but not opened in the LDtk editor.

Drop a tileset or autotile sheet (PNG)
Runs in your browser. Files are not uploaded.
Studio Tile workspace: a 47-tile sheet recognised as the GameMaker layout, with its terrain bits and a complete check
The real Studio with a CC0 asset (OpenGameArt).
Exports to
  • LDtkPartly verified· LDtk 1.5.3 schema + loader
  • 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

What it does

  • .ldtk (1.5.3) with an IntGrid value per terrain and one 3×3 rule per tile.
  • A sample level with autoLayerTiles already filled, so the result can be inspected.
  • Corner / dual-grid sets written with a half-tile tile offset.
  • PARTLY VERIFIED: schema + official QuickType loader + independent rule re-run equal to the exported tiles on 12 corpus sets.

How to do it

  1. Drop the tileset and apply its layout (or paint the bits).
  2. Read the Check panel and fill missing combinations.
  3. Export (Ctrl+E) and take the ldtk folder.
  4. Open the .ldtk in LDtk and paint the IntGrid layer.

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

Why only "partly verified"?

LDtk ships as an Electron app with no command line, so it was not opened in the app. The file passed LDtk's JSON schema and its official loader, and re-running the rules gave the exported tiles.

Can one sheet hold several terrains?

Yes: each terrain gets its own IntGrid value and its own rules.

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).