This week has been all about optimizations. Starlight Revolution has some pretty neat things going on under the hood, but the way they're implemented often starts out very inefficient. The goal is always to get the basic functionality in first, and then focus on making it run fast later. Sometimes, this focus on functionality first can also lead to bugs.

One of the recent changes I made had such a negative effect on framerate that I almost had a heart attack. For every laser in the scene, framerate was increasing exponentially. It took awhile to figure out, but what was happening was that each laser was being treated as a camera, rendering the entire scene from its perspective. The scene was only displayed on the screen once, when it drew from the real camera, so from the outside it looked like the game mysteriously slowed down every time a laser was fired. Not good.

Fixing this bug turned out to be simple, but it was humorous to see how such a small change could have such a large impact. It turned out that I'd accidentally gotten the laser game objects to act like cameras, causing the entire scene to be rerendered for every laser in existence.

Have your own funny videogame bug story to share? Feel free to chat with me about it on twitter @JeckDev or leave a comment below.

comments powered by Disqus