Tilemap Performance

Hey there! I was just wondering if anyone knew how the performance of tilemap objects was. As in, would it be any better to use a tilemap as apposed to a large png of the same size that i make in something like Aseprite or Photoshop.

Secondary question; what size would be considered the “upper limit” to stay in good practice? The Castlevania style example for the tilemaps uses a tilemap that is about 3000 pixels long. I would assume breaking that into chunks and setting the visibility based on distance would be more preferable than just one huge object.

The tilemap should be more performant, since the tilemap (as far as I understand) treats each tile as a single sprite. That sprite is reused if the same tile is at a different position. Therefore, each tile type is rendered only once by the GPU instead of all the tilemap image, and the tilemap size doesn’t change anything, as only the tile size contributes towards making the image huge. Normal images bigger than 500x500 are already not recommended for performance, and above 2000x2000 can cause issues on many devices. With the tilemap, you can create much larger worlds as a single object.

1 Like

Based on that im deffinatley switching to tilemaps! The current way im doing it (making everything small chunks and hiding them based on distance) just isnt sustainable at a larger scale. Thank you for your response!!

Fyi, hiding based on distance is useless anyways - GDevelop already hides object that are offscreen automatically.

1 Like

I didnt know it did that! I also disable particles and things like enemy AI if they are too far away. Ive noticed increaed performance from doing it.

Disabling Enemy AI will definitely help, as event logic processes every frame regardless if the object is visible or not.

I think particles probably have some impact since they’re still generating positional data (even if the positions aren’t being used by actual images)

1 Like