Monthly Archives: March 2012

The Awesome Idiot

It is a strange facet of game programming that when everything works, you feel awesome, but when a bug arises, particularly one you have trouble fixing, you feel like an idiot. It’s hard not to be convinced that all other programmers in the industry would have no difficulty solving a given problem, and would look down on you for being so flummoxed.

I swear I did not wake up today looking for an excuse to use the word “flummoxed” in a post.

The bug in question this afternoon was that the game’s enemy airplanes could get themselves stuck in a corner of a map. The way their collision normally works is, when they hit a wall, I take into account their angle relative to the wall and give their angular velocity a boost towards the direction away from the wall.

Problems arise though when flying into a corner, because it’s possible for the airplane to bounce off of one wall, then hit the opposing corner wall before turning enough to be given an angular push away from the corner. Instead the angular push brings the airplane back into the corner and the airplane gets stuck.

My first approach to solving this issue didn’t work at all (the idiot phase of the process), and is probably not worth mentioning. I find it helpful when designing program logic to physically write down what is going wrong, and how things would behave if everything was going right. That led me to my solution, which was to implement a timer for each airplane that tracked how long ago it hit a wall.

Since it is highly unlikely an airplane would hit another wall within a couple seconds unless it were in a corner, I check the timer for that (the timer gets set to zero each time the airplane hits a wall). If the timer is under a limit of about 2 seconds when a wall is hit, I skip the normal angular velocity push, and instead give the airplane a push in whatever angular velocity it currently has. This causes the airplane to keep turning a single direction until it exits the corner.

It works great, and seeing it fixed made me feel awesome.

Of course, I realize any programmer with some AI skills could probably prevent the airplane from bumping into walls in the first place. So I’m back to feeling like an idiot. Damn.

Level Design

I’ve been in the midst of creating levels for our upcoming game, Dukes and Dirigibles.

It is an exciting process, but not without trepidation. I usually start each level with a theme in mind – maybe the level is focused on a particular style of layout, or heavy/light on certain enemies. Shortly after I start though I usually begin to fear that my idea for the level was all wrong, or at best unachievable. Maybe the level is too tight for the airships, maybe it’s too big and feels vacant, or maybe the flow just isn’t what I anticipated.

Pushing through this stage, however, leads me to enjoyable part. Once I accept what can and cannot be accomplished in a given play space I begin to move past seeing limitations and into seeing opportunities. At this point the personality of the level truly reveals itself and its construction suddenly seems easy. Well, maybe not easy. :)

Consistently I find myself thinking, “This is the best one yet!” A judgment based heavily in the moment, but not insincere. Which levels will pan out to be my (and/or the fans’) favorites, I cannot say. But it is encouraging that I become excited to see each new level in-play, and have yet to feel let down by the results.

-Jason

Too Many Games! June 15-17, 2012

Come meet the Backward pieS team at the Too Many Games convention, at the Greater Philadelphia Expo Center in Oaks PA. This will be an exciting opportunity to be one of the first to play our game Dukes and Dirigibles and to talk with the people behind making it.
The convention is also a great chance to catch up on the latest rage in the video game community. Spend the day having fun playing games and seeing sneak peaks of what local developers are working on. Show your support to the Philadelphia area game developers and Backward pieS.

We will be there from June 15-17, 2012. Stop by our booth!
For more info visit: http://www.toomanygames.com/