Rich Knieriem, Lead Developer
This week’s entry is about lasers. That’s right, lasers. Why? Because SPOILER ALERT, lasers are in our game…and why wouldn’t they be? Sci-Fi without lasers is like sex without the other person. It just isn’t the same. Also it’s a lot quicker, but that’s not really relevant to this analogy. If our little sci-fi game is ever going to make it big, it’ll need its very own lasers.
Movies and video games have featured laser beams, laser blasters, and — well actually, maybe there’s really only those two types of lasers to begin with: the spitting, rapid-fire blasters that go “PEW PEW!” and the constant beam of energy that goes “NERRRRRRRRRRRRRR”. For my first attempt at lasers in Armour on the Wastes, I opted to implement the “PEW PEW!” blaster-type laser.
Why you ask?
Because! This basically turned the laser into just green fucking bullets, and also because I’m lazy as fuck. However, the lead designer was not happy with this choice, claiming that our “laser” was just a re-skinned machine gun. Not willing to argue my point, I decided to try his style out and implement the “constant beam” type laser into our game.
This is the story of that hell.
In programming, there are two types of developers: those that refuse to use other people’s code, and those with jobs. If you haven’t figured it out by now, I’m the latter. So before attempting to make my own lasers, I first searched the internet for a helpful guru who could do my work for me.
After a few beers I came across a tutorial showing how to easily do hit scan lasers – in other words, how to make a laser that would emit from a source gun and instantly hit a wall or target without any projectile travel time.
“PERFECT,” I thought to myself, tempting fate. “Let’s toss this into the engine and see what happens.” When the green laser shot out of my tank and connected with the wall instantaneously, I was ecstatic. “IT WORKS! I’m amazing…wait…what?…60%?!” Of course, there was a downside to the code I had retrieved from the depths of the internet. The mystery code had managed to jump my processor from 6% to 60% usage. With all of the other content we need to implement into the game, this kind of resource usage was obviously unfeasible. So with the easy option out of the picture, I was now forced to design my own laser logic.
After a few afternoons of work, I managed to get my new laser system working. It functioned similarly to the solution I had found online, but didn’t require as many constant checks on where the laser was supposed to be or what it was supposed to hit, saving a boatload of processor power. Better yet, I ended up adding a few new features that help set Armour on the Wastes apart.
Performance was great, the new laser looked amazing, and most importantly it was also fun to use, but I still had one problem. The laser only worked for the player. For the full game, computer driven players would also need to be able to shoot laser weapons. I figured, “how hard could that be?” “Let’s just give all of the computer tanks lasers and see what happens.”
There are no words for what took place next on my screen…it haunts me to this day. Chaos and mayhem don’t even begin to describe the horror. It was many days before the lasers were up to our exacting standards.* After all this, I’m confident that people can now use lasers in AOTW without breaking the game or breaking their spirits, which is a definite plus.
The dark days of the Laser Project ™ © ® may now be behind us, but we must never forget what kind of struggle it took to get us to where our game is at today. In truth, the struggle was only about a week, bust still…it was mildly annoying. Now I just have to finish the AI…
* Defined by “meh…looks good enough for now.”