Frankey
Frankey

Reputation: 336

Godot - Confused Tilemap Quadrant Size

Recently my simple tilemap game has a performance drop when export to android, due to tilemap settings. My game details are as followed:

  1. tile size : 64 x 64
  2. display resolution : 1080 x 1920
  3. tilemap size : 30 x 14 tiles
  4. quadrant size : 16 (default)

When i set the quadrant size to 1, the game did run smoother in my android device.

However, I am having a difficulty in understanding the concept of quadrant size. From this godot tutorial page, it mentioned that: "Quadrant size is a tuning value, which means that the engine will draw and cull the tilemap in blocks of 16x16 tiles" (given quadrant size is 16) It make sense to me to say that the engine will draw 16 x 16 tiles and make the game visible to players.

But my question arise when my game is still fully draw (aka visible) after i set the quadrant size to 1? According to my understanding, quadrant_size of 1 will only makes the engine draw 1 x 1 tiles. Since one tile in my game has only 64 x 64 px, shouldn't only 64 x 64 px of my game world being draw and visible to players?

I also did reading about quadrant_size here, but still don't understand how to get a best quadrant size for my situation. Perhaps, i may have an incorrect concept of quadrant size in tilemap settings.

To summarize my question, what is quadrant size in tilemap and how to calculate the optimum quadrant size for any game settings?

Thank you for spending your precious time reading my question.

Upvotes: 1

Views: 5223

Answers (1)

Calinou
Calinou

Reputation: 949

quadrant_size is an internal optimization technique. Different values may be faster than others depending on the device and project -- there's no value that will be always faster or slower than another. If you're not running into performance issues, leave it at the default. If you do, try to tweak it starting from 1 (which has been known to improve performance on some devices).

It won't change what you see on your screen in any way.

Also, Godot 3.2.2 will support 2D batching which should greatly speed up TileMap rendering, especially on mobile devices.

Upvotes: 2

Related Questions