Tilemap quadrant_zize vs chunks performance

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Ohan

I have a top down game with tilemap size 500x500 running fine at 144fps, when ysort is enabled fps dropped to single digit. Tried different quadrant_size with no luck.

The docs says “Quadrant size is a tuning value, which means that the engine will draw and cull the tilemap in blocks” which I understand as built in chunk system. But when I split the map into smaller tilemaps with their own scene and set visible based on player’s vicinity fps rise back to 120.

I tested this approach on godot 3.5.1 and 4.0b6 and receive similar results. Can anyone explain this behavior?

:bust_in_silhouette: Reply From: Merlin1846

quadrant_size is for the engines culling similar to how 3d models when off-screen are not rendered to the screen but are still processed. Increasing this value will increase the amount of tiles in a quadrant. Overall unless individual tile render performance is a concern, which unless each tile is say ~1k res then it isn’t.

Splitting the map into chunks was a good call as this also allows you to automatically cull entities and more as well as allow unloaded chunks to be saved without effecting the main area. Generally, quadrant_size requires experimentation to tune.