Terrain icons not updated after tileset resize

I changed the size of my tileset image recently, and Tiled auto-updated the open maps, terrains, and animations as expected. However, the icons/default tile IDs for the terrain types were not updated, which means they now show incorrect tiles. In addition, Tiled does not provide any way to edit the preview tile for a terrain, the only way to edit them seems to be by editing the tileset data in a text editor.

Edit: Just noticed that stamps aren’t updated either. RIP my stamps.

Actually you can fix up those images by selecting the terrain type, and then right-clicking the tile you want to use as image and choosing “Set Terrain Image”. However, of course it should have updated these automatically and I’ll look into fixing that.

I’m so sorry about your stamps! I’ll see if it’s reasonably possible to also adjust those.

Unfortunately, this whole approach to attempt to update tile references is rather broken in the first place. It’s a lot of tricky code to update all the references, and in the process I forgot a few places. In addition, once the currently loaded references have been fixed up and the tileset is saved, Tiled will never ask again, which can leave maps that were not loaded at the time forever broken unless you do some tricks like undoing and redoing the change to the tileset with those maps loaded.

We can try to fix that latter problem by storing the expected column count in each map rather than in the tileset file. However, I think the real fix would be to abandon the approach of implicitly indexed tiles and instead explicitly define the rectangle of each tile in the set. Then, if the tileset is expanded, the new tiles could simply get new IDs without affecting the previous ones. In addition, it would be possible to adjust the position of a tile without requiring all maps to be adjusted. Finally, this will open the path towards supporting tiles of multiple sizes within the same tileset.

The main downside is that it’s a non-compatible change that would take a while to get supported by the various engines.

1 Like

That’s at least one issue down, but I’ll work towards killing this problem in general as outlined in this issue.

1 Like