How custom data layers works?

Godot Version

Godot 4.2

Question

Hi. Can you tell me why custom data layers is applied to all tiles of the same type? I want there to be 10 taps for each tile

Tiles in a TileSet are more like types of tiles. All tiles with the same identifiers (source_id, atlas_coords, alternative_tile) will share all their data including custom data layers. You need to implement your own way of keeping track of how many times you have tapped each tile. The simplest solution would be to create a dictionary (coords and number of taps).

1 Like

Won’t this have a big impact on performance?

I don’t know that much about performance but I highly doubt that simple dictionary inserts and lookups will have any noticeable effect on performance in this case at least. And of course, you could have sub-dictionaries based on different levels/chunks and/or TileMap layers.

Because the dictionary solution is so simple to implement, I think you should start with that and then later improve it if needed.


I did it) But I wanna have a big map like from game of Noita. But the dictionary will be really big with size = 1000000 tiles