Hello everyone,
My game is a modified version of the go board game. It displays a matrix of 32*32 tiles on which units move. Among others, there is a type of unit that mark the tiles it runs on.
The problem is that displaying 1024 independant tiles is not that easy. To display the matrix, I use a big quad with a grid texture (this was the first attempt at keeping a good frame rate), but now that my units are moving on it, I need to display the ‘marking’ they place on tiles. For that I use a 150*150 texture, but the frame rate drops too much, too quickly (from 17ms a frame to 50ms after ~320 tiles have been marked).
here is a screen of a run with pstats, frame time and graphic memory used.
Drwr suggested me to put the tile nodes into a quadtree-like structure. I tried that without success fps-wise, since every tiles are displayed anyway.
I also tried flattenStrong-ing the tile nodes’s parent, but even if the frame rate is indeed better, tile nodes coordinates are set to their parents, and I can’t use them to move my units along the matrix.
the fix, would be to keep another matrix of node for unit moves.
Last possible solution I tried was to use a rigid body combiner, but it seems tiles are not able to update their texture anymore: at first they are all hidden as expected, then as soon as one of them is assigned a new texture and called show(), every nodes get visible and show the default texture (not even the one asked for).
my questions are:
1- are rbc designed to handle texture change ?
2- is there another way to possibly solve my problem (other than zooming in so that only n tiles are displayed at once)
3- any other advice in mind ?