Byteron/floating-islands

TileMap Highlights

Closed this issue · 2 comments

Using TileMaps for all the highlighting will improve performance a lot because 1. add_child() / remove_child() is more costly than set_cell() and rendering hundreds, if not thousands of separate sprite nodes also has a much higher impact than rendering a single tilemap with hundreds or thousands of tiles set.

  • buildables
  • tile selector
T4g1 commented
  1. We are talking about 64x64 nodes
  2. On what do you base that assumption? Can you make a benchmark of what would be the difference?

I believe the engine is using quadtree/octree (or some other space management algorithm) to handle scene so amount of nodes at the screen is really all that matters here

Still, it would surely make a difference but is it a big enough difference to be noticeable?

There are severy FPS drops when

  1. placing a unit - probably the buildable tiles
  2. when removing a building active + moving the mouse. Probably inside an input(event) function