This is a fun little game I’ve been working on part-time with friend and local artist Paul Conway (see DoomCube and The Darkside Detective), with audio provided by Thomas O’Boyle (see Thomas’ Website). The seeds of the game actually came from a GameJam-winning game I made with Paul over a weekend last November.
Demon Pit is a hardcore first person shooter (FPS) of the “Arena Shooter” sub-genre – essentially, an oldschool arcade game where it’s all about skill, reflexes, and learning the pre-scripted enemy patterns. We’ve been making great progress over the summer since we’ve been co-locating one day a week to work on this. Paul has a detailed eye for this game genre (it’s one he’s into), as well as for all things artistic, so this translates to precise instructions for me to implement.
I’ve been using Unity3D for a few years now (and lecturing it to my 3rd year undergrads since last year), so I’m quite adept at structuring things and I’ve learned what to do and what not to do. I’ve learned to hate the horrible archaic garbage collector which Unity clings to, which turns strings in particular into minefields which can stutter your framerates. But it’s generally an excellent game engine.
Demon Pit adds a couple of new features to the FPS Arena Shooter genre – first, we have walls which move up and down during the game, which creates a constantly changing, small and claustrophobic arena. Second, we have a “grappling hook” mechanic whereby you can transport rapidly between a number of “portals” around the arena. I see this as an equivalent to the “teleport” mechanism which games such as Defender and Asteroids had – basically, an escape/panic-button. The grappling hook is more controlled and subtle than this though, and moving swiftly around between the portals while getting in some crafty mid-air shots is a very useful tactic.
Some of the enemies fly, and we have different behaviours here – some are blocked by the walls while other tend to swoop around and over them, diving at you from above. Other enemies are on foot, and one of the technical things I’m quite pleased with is the A* pathfinding implementation which runs multi-threaded and deals with the constantly changing arena. I’ve been teaching the A* algorithm to my 2nd year undergrads for the past few years, and it’s something I’ve also worked on previously (see this blogpost and academic paper from 2011).
Another small feature which I’m pleased with is the enemy deployment patterns. Enemies spawn from the centre of the arena and follow one of several visually-impressive procedurally-generated formations such as “Fountain” or “Vortex”. To get these high-speed formations working precisely, I control the enemies kinematically while they’re in formation, and then switch them to normal physics-engine control when they break rank. While in formation I log their current and previous position, which means when switching to normal physics control I can calculate and apply the correct initial velocity to make the transition seamless.
The audio is coming along nicely too (great work from Thomas), and we’ve put in some play-synchonised music, for example an extra-crunchy guitar track which moves forward in the mix during the spawning of a new wave of enemies.