FEEL FREE TO MAKE AND MONETIZE PARANAUTICAL ACTIVITY VIDEOS

Well, That Was Fun!

by Mike

Today marked the first day of development for our super exciting new game, which I’ve been looking forward to. I have been planning a major overhaul of the engine (we call her Lexi). My goal was to clean up all my old rendering protocols, and implement some sweet multithreading for performance reasons. I had seriously underestimated the complexity of this.

I was hoping I could just say

"CPU1, render stuff. Big 2, hop on that physics engine!"

However, there are issues with reading/writing the same data from different threads at the same time, which means it’s more like

"CPU1, wait for everyone to be done so you can have a turn reading the model location data. Big 2, don’t you dare touch that physics engine while Mr.3 is calculating lighting or I swear I’ll crash this whole program!” 

Also, SDL will not let you check for user input in anything but the main thread it was initialized in, and OpenGL won’t let you render in any thread other than the main thread it was created in. Not only did this cause some confusion that lead to a life saving Google search, but it also forced me to put user input in my rendering thread. That’s no fun! :(

It took a few hours of planning, and a sexy diagram on my whiteboard, but I’ve got all my threads running in perfect harmony, and an astonishing performance boost with such a simple implementation thus far. By astonishing, I mean before these optomizations, rendering one 20K poly terrain would run at 60FPS, now I can render 4 of them with over 60FPS. 

This is really my favorite part of making games. I love to learn new tricks and see how they improve my games, and how I can apply them in cool and interesting ways.

edited by T

blog comments powered by Disqus