External tilset set bug, and layer breaking when mixing tilesets

Hello,
first of all, I don’t think the problem is cause by Tiled, but rather by Axmol.
First bug is that using a tileset that isn’t in the same path than the tilemap cause
a crash. The first two video of the link bellow explains it in details

And the seconde issue, is that if I but in the same layer, tiles comming from different tileset, the images render breaks. You can see that in the third video.

Again, think the issue comes from how axmol integrates Tiled, but I thought about asking here just in case.

Thanks

Those both indeed sound like Axmol issues, nothing to do with Tiled.

The restriction that a layer can only use one tileset at most is a very common one, as a common method of rendering tile layers is as a textured mesh, and that requires the tiles to be in the same texture. Mixing tilesets would require either rendering a separate mesh per tileset, or engine-side texture atlasing to put all the tiles into a single texture, or pre-rendering each layer to a texture. None of these is a trivial change and all have significant downsides.
There is an open feature request for Tiled to allow restricting layers to a single tileset to make working with such engines easier: Option to restrict layer to a single tileset · Issue #153 · mapeditor/tiled · GitHub If you have some ideas on how the UX for this should go, feel free to contribute to the conversation there.

ok cool thanks. I wasn’t aware of that thread. I guess I can leave with that limitation.
I’ll just have to carefully plan the tileset layer. So that’s not a problem.
The first one is, but as I mentioned, it’s likely to be related to axmol.

An alternative to carefully planning your layers is to combine all your tilesets into a single giant tileset xP It might be less convenient to find tiles in such a tileset, though.

Yes, I think I’ll simply try to establish a core design. For instance, a tileset just for the floor, another one just for the walls, another for props, etc…
By the way, what I do to prevent my tiles to changing the ids when expanding the tileset image, is to keep the width constant and only grow in height.
I work with 24x24 tiles, so I use a 240x96 tileset image. Whenever I need to add more tiles, I simply increase the height at the bottom.
I am not sure if there is a better way, but it works well for me.

That’s the only way if you’re using “Based on Tileset Image” tilesets. Tiles in those are numbered going left to right, top to bottom, so to avoid tiles being renumbered, you need to keep the width constant. Changing the width would require rearranging the tiles in the image so they have the same IDs, which would be rather annoying to do.

When I need to change the width of a tileset, I create a new Tileset with the wider version and then use the Mass Replace Tiles script to make my existing maps use the new Tileset and its different tile arrangement instead of the old tiles: tiled-scripts/MassReplaceTiles.js at main · eishiya/tiled-scripts · GitHub

There are plans to add a new Tileset type that associates each tile ID with a specific subrect of the tileset image and thus would keep IDs consistent even when resized, but it will be some time before that’s implemented, and even more time before engines start supporting it. Avoid renumbering tiles when image width changes · Issue #2863 · mapeditor/tiled · GitHub

1 Like