Sunday, December 13, 2009

A twisted firestarter.

I want to talk a bit about the code behind the flamethrower in Annihilation. Cleansing flame is one of the staple weapons to use when purging the land of the undead, and as such, I felt it important to get it right. There's nothing worse than a dull, unsatisfying flamethrower - if it doesn't look right, or if it's weak and useless, it ruins the whole feel of it, so I decided to spend that little bit of extra effort to ensure that our players' cravings for burnination would not go unfulfilled.

Like all the effects in Annihilation, I wanted the flamethrower to be very dynamic, and the best way I've found to achieve this is to construct it out of lots of particles. The framerate sometimes finds this disagreeable, but I think the effect is awesome enough to be worth the slight dip in speed seen when lots of things are burning.


The flamer shoots a stream of napalm, made up of lots of small pieces of fire aimed directly out from the player. If the player has turned, the fire particle angles itself to face towards the last fired, making it appear as if the flamer is shooting one continuous stream of fire. The particles don't always perfectly connect, but then again fire is somewhat chaotic in nature anyway. I think the end result is quite fitting, especially when in motion: