Some way to mitigate the need for empty tiles deletion?

Hello!
I’m looking for a way to not clean up manually those pesky empty tiles every time i’m using a selection to paint tiles. By empty I mean tiles containing zero pixels.
These tiles are containing pixels in the shot below, yes :sweat_smile: but you know, they will be officially empty after cleaning the house!

1 Like

Tiled has no built-in way to detect empty tiles and remove them. Alternatives:

  • If you know which tiles are empty and there are only a few layers, you can use the Select Same Tile tool to select them, and then delete.
  • If there are too many tiles to do that, you can use Automapping to replace all of them with Empty (no tile). The downside to this is you’d need a rule for each such tile, for each layer it can be in. If you tend to use a lot of layers or tend to vary the layer names from map to map, that’s a problem.
  • Scripting. You can write a script that iterates all the tile layers in a map and clears any empty tile. This will perform best if you analyse the tileset(s) beforehand and mark the empty tiles, instead of checking at runtime every time. This analysis can be automated via scripting as well, of course.

I personally try to sidestep this issue by not painting such tiles to my maps in the first place. I pack my tilesets tightly so there aren’t many transparent tiles, and the transparent tiles are marked with a colour so I easily notice when I use one accidentally. When painting complex shapes like your mountains, I exclude the transparent tiles (this can be made quick by using saved stamps instead of grabbing them from the tilesets every time).

2 Likes

Thank you eishiya, I like reading your detailed explanations and advices!
I’ll try the Select Same Tile tool, and I’ll use more stamps to get “cleaner” selection as you suggested :+1:t4:

1 Like