Month: December 2013

DK2 Continues to Corrupt

So! Last night I’m playing Dungeon Keeper 2 when my younger daughter walks in.

(Longtime fans of this blog will be sensing deja vu right about now.)

After explaining the concept of the game and showing her the gameplay, she became fascinated by the “dungeon construction” aspect of the game.

(On a side note, I need to start working on Star Kittens, for crying out loud.)

While she was playing I asked if the voice of the Evil Mentor sounded familiar “No…” she said. “Have you ever seen Peppa Pig?”

She got it. “That’s Peppa’s dad’s voice! Except evil!”

My daughter, master of pattern recognition.


Planitia Update 51: Slowly but Surely

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.