Tileset export scattering tile pieces all over the place


i’m using the 1.3 beta and the included new Tileset/Tilemap feature. My goal is to export my Tileset as a single .png to use in the Ldtk-Level-Editor. However i just cannot figure out how to export my tiles without scattering them all over the place. I tried to find a solution for this, but haven’t found anything :(… So basically i converted my layers to tileset layers and everything is looking good, but in the preview all the tile pieces are scattered all over the place and when i export (no matter the settings) i get a horizontal line or vertical line full of tileslices, which are difficult to puzzle back together…

Even worse: in Ldtk you cannot rearrange the slices, so i really cannot work with that result :(…
Am i missing something?

Aseprite view:

Imported Tileset in ldtk:

hi, Aparikk!
if i understand correctly, what you’re missing is that you don’t export the image in tilemap layer, you export tileset - a group of tiles you have on the left in the palette.
that is exported as a strip like any other sprite sheet and then used in map editor like ldtk to create levels. you don’t design whole levels in aseprite, just tiles. you can make mock up tests to see how the tiles work together, but the final level design is done in ldtk.

you can import whole design in single image as tileset into ldtk. then it’s easy to select whole tileset and just draw it with one click into the level. but the problem with that approach is the ldtk will not auto replace duplicates. each square in the grid will be unique tile, so not good. i guess you probably could use that as a background to help you to put the whole thing back together…

it should also be possible to write a script to export tilemap data directly into json, which is a format ldtk seems to use for its maps. some time ago david made this script: Are tilemaps/tilesets accessible via the Lua API yet?
it seems like it should be enough to convert this part from output:

 "tiles": [
              0, 1, 2, 3,
              4, 5, 5, 6,
              7, 5, 5, 8,
              9, 10, 11, 12

into ldtk file equivalent:

"gridTiles": [
     { "px": [0,0], "src": [0,0], "f": 0, "t": 0, "d": [0] },
     { "px": [10,0], "src": [10,0], "f": 0, "t": 1, "d": [1] },
     { "px": [20,0], "src": [20,0], "f": 0, "t": 2, "d": [2] },
     { "px": [30,30], "src": [120,0], "f": 0, "t": 3, "d": [12] }

i’ll leave it up to you to decide which is more tedious: to recreate the level from tiles, clean-up the sliced level image, edit the ldtk file and/or write a conversion script… :person_shrugging: