# External tilset set bug, and layer breaking when mixing tilesets

**URL:** <https://discourse.mapeditor.org/t/external-tilset-set-bug-and-layer-breaking-when-mixing-tilesets/7196>\
**Category:** Bugs\
**Created:** [January 8, 2025, 1:30pm UTC](https://discourse.mapeditor.org/t/external-tilset-set-bug-and-layer-breaking-when-mixing-tilesets/7196 "2025-01-08T13:30:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rudi\_Hammad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/rudi_hammad/32/3984_2.png) [@Rudi\_Hammad](https://discourse.mapeditor.org/u/Rudi_Hammad)\
**Post date:** [January 8, 2025, 1:30pm UTC](https://discourse.mapeditor.org/t/external-tilset-set-bug-and-layer-breaking-when-mixing-tilesets/7196/1 "2025-01-08T13:30:42Z")

</div>

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

> **[Two Critical bugs in tilemap, explained with videos. Urgent fix required. ·...](https://github.com/axmolengine/axmol/discussions/2315)**
>
> Hello, I have found what I consider two important bugs and it seems related to Axmol and not Tiled. The first one is that you can't add an external tiles (.tsx file) that isn't in the same path of ...

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

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [January 8, 2025, 1:40pm UTC](https://discourse.mapeditor.org/t/external-tilset-set-bug-and-layer-breaking-when-mixing-tilesets/7196/2 "2025-01-08T13:40:16Z")

</div>

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](https://github.com/mapeditor/tiled/issues/153) If you have some ideas on how the UX for this should go, feel free to contribute to the conversation there.

---

<div class="post-metadata">

**Author:** ![Rudi\_Hammad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/rudi_hammad/32/3984_2.png) [@Rudi\_Hammad](https://discourse.mapeditor.org/u/Rudi_Hammad)\
**Post date:** [January 8, 2025, 2:15pm UTC](https://discourse.mapeditor.org/t/external-tilset-set-bug-and-layer-breaking-when-mixing-tilesets/7196/3 "2025-01-08T14:15:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [January 8, 2025, 2:18pm UTC](https://discourse.mapeditor.org/t/external-tilset-set-bug-and-layer-breaking-when-mixing-tilesets/7196/4 "2025-01-08T14:18:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rudi\_Hammad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/rudi_hammad/32/3984_2.png) [@Rudi\_Hammad](https://discourse.mapeditor.org/u/Rudi_Hammad)\
**Post date:** [January 8, 2025, 4:05pm UTC](https://discourse.mapeditor.org/t/external-tilset-set-bug-and-layer-breaking-when-mixing-tilesets/7196/5 "2025-01-08T16:05:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [January 8, 2025, 4:12pm UTC](https://discourse.mapeditor.org/t/external-tilset-set-bug-and-layer-breaking-when-mixing-tilesets/7196/6 "2025-01-08T16:12:35Z")

</div>

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](https://github.com/eishiya/tiled-scripts/blob/main/MassReplaceTiles.js)

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](https://github.com/mapeditor/tiled/issues/2863)
