Yesterday I added over 1000 (one thousand) moving point lights to the terrain. On the PC this was fine. The scene partitioning used by my forward rendering setup uses a lot of CPU time though, so on the XBOX this performed abysmally — it took something like 10ms to update all of the point lights in the scene partitioner — not including calculating their positions. (And remember, we only have around 16-20ms per frame to do all updating.)
Since this was so slow, and I want to associate a point light with most enemies, I’ve been optimizing the partitioning a bit without making any very drastic changes.
Since there’s only about a month left, I decided that the smart thing to do is just to reduce the size of the terrain, and reduce the number of lights, in order to get everything done. Once it’s all working, I’ll consider revising the partitioning system to support a larger world again, and add more lights.
Below is the current state of things:
After optimizations, this runs at about twice the speed that it did yesterday.
Struggling to get things working fast enough on the XBOX CPU (which provides me with roughly 10% of my PCs processing power) has been slowing me down a lot. Things that I keep expecting to be more than efficient enough, turn out to be twice as slow as what’s really feasible.
The image above has only 270 point lights spread out across the terrain (the little blue particles, only about 30 are visible), but runs at about 65FPS on the XBOX, limited by the CPU. That should hopefully be enough for the state of the game at the competition deadline. Far more lights, and a much bigger world is possible — but it’s not looking like I’ll have time for more than this before June 14th.