I’ll be honest, the DirectX version of Planitia has some frame rate problems that I just. Can’t. Resolve. I’ve tried everything, including profilers like Very Sleepy (excellent, by the way) but after a few minutes, the frame rate drops in half and nothing I do seems to be able to change that. This is one reason I’m rewriting the game practically from scratch (the other being conversion to OpenGL and cross-platformy goodness).
Right now the new Planitia is using a nice frame rate counter that I stole shamelessly from Jari Komppa‘s 2D OpenGL basecode. Instead of just displaying the current FPS, it displays the last 50 FPS values in a graph so spikes are very easy to see.
Which came in really handy when I was reimplementing the Earthquake god power. Earthquake deforms the terrain, which means that the vertices of the terrain mesh must be changed. Changing vertices in the video card’s graphics memory is a slow process, and one that most games try to avoid. Unfortunately, Planitia is built around terrain manipulation and thus this is one of the big problems of the project that I’ll have to solve (or, more likely, manage).
My initial naive solution was to update each vertex individually. It worked and didn’t hit the FPS counter too badly for basic terrain manipulation using the Flatten power. But Earthquake constantly changes a bunch of verts every update for as long as it is active, which was putting a lot of stress on that system. Fortunately, this showed up quite clearly on the FPS counter and profiler. I quickly found a way to optimize the vertex update and now both Earthquake and Flatten hardly hit the frame rate at all.
I’m hoping that with these additional tools and everything I’ve learned over the course of the project that I can avoid the fate of DirectX Planitia. I don’t see a big problem reimplementing the god powers or adding new functionality as long as I’m not manipulating a lot of vertices at once. In fact, the only thing about the project that really concerns me right now is multiplayer.
No using unity anymore?
Can’t you use geometry shaders or something? I’m rather clueless about graphics.
No, no Unity. I’ll learn more doing it myself.
And while I know my drawing in the DirectX version is sub-optimal, I don’t think it’s what is causing the frame rate issues. So no, geometry shaders wouldn’t help.
A good rousing game of Geometry Wars would, though.