Thursday, July 12, 2012
Making Alien Espionage
One of the nice things about creating small projects is that it gives you a chance to play around with new techniques and try out new things. This is especially the case when the game is a type of game that you normally don't create. For this episode I played around with a different way of handling animation. I also experimented with vehicle systems. Finally, I tried a new way of spawning enemies.
The animation subsystem for this game is table driven with canned clips. Normally I use animations centered around the current coordinates of the object being animated. This has the advantage that it is easy to move the object as you can simply use linear interpolation. With the canned animation the motion is part of the animation meaning that the animation plays through with the coordinates not changing until after the animation has completed.
Making the animation system much more complicated was the number of different sequences. To handle all the different transitions necessary without needing a huge number of animations, only the core animation segments are created. The transitions then stored as a table of sequences. Each segment in the transition then gets played in sequence. This approach works great for more complex character animations.
The elevators were an interesting challenge. My first thought on handling the elevators was to treat them as platforms. This lack of control simply did not feel right so I opted instead to treat the elevators as vehicles. Players "enter" the elevator by jumping or crouching while standing in front of the elevator. The player then exits the elevator by moving left or right. While inside the elevator jumping and crouching become the up/down controls.
Because the main theme of the game is about moving through a building infested with aliens, having aliens pop out of the doors seemed to be a really good way of handling the spawning of aliens. Each door has a set number of aliens (based on the level) that it can spawn. To prevent too many aliens from showing up, there is a per-floor limit (again based on level). Finally, I decided to make the spawning of aliens time based.
If I had more time, I would have created a number of towers. I would also consider making the player retrieve a number of cases by entering multiple doors and then return to the first floor to complete a level. If I ever revisit this game, I may make these enhancements.