PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

How are explosions done? in 2d

I am starting a new game, and it is going to need big explosions for a 2d side scroller game. Just wondering - how are explosions normally done? I would imagine you could get a series of bitmaps (would have to have alpha on the edges) and just run them as an animation. But how do you "draw up" the frames for animation? I have photoshop and can fancy effects with it - but how do you do each animation frame?

The sort of explosion I want is the really nice looking ones that fade away. Hope that makes sense. Any tips appreciated.
There are basically two ways:

1. You buy pro-quality explosion animations on CD. These are made in a dark room and are supplied as picture sequences and alpha map information. I bought several of those when I did 3D work. Unfortunately I don't have any URLs lying around, but you could try googling (just don't search for "buy explosions").

2. You create the explosions yourself using a 3D package such as 3DS Max or Lightwave ( such as described in http://www.angelfire.com/scifi/jasonhan ... rnulls.htm ).
I addition to what Johan said, you can also produce explosions with some video-compositing tools.
"Combustion 2.1" by Discreet, for example, offers the possibilty to create realistic looking explosions by using a very advanced particle system.
You can render those to a movie file and extract the single frames into one big image with a picture tool of your choice.

Have fun...
I would put together an explosion sprite/particle system with enough variables to control position, timing, size (zoom), amount of blending etc & then I would make a number of explosion sprites with code to control placing, growing & fading out.

You might also want to control the front/back positioning so that you can have explosions behind & in front of objects.

The sprites would just be a series of same sized frames drawn in paintshop pro.
Take your video camera out to the dump and blow something up. :-)

(That is a joke.)
Particle system alone doesn't work too well with 2d ( you would need a lot of cpu power to make it look good) but alpha blended animation of basic explosions combined with blowing up your sprite ( basically divide sprite into 4x4 squares and animate each one separately fading out with transparency blend as they fall apart) works pretty well.
Basically you are using canned animation of explosions combined with small parts of actual sprite being blown apart to give it a more authentic , custom touch.

You can see this approach in action in ZRaid ( http://www.warmi.net/images/zraid/game.avi ) - the game comes with the source code too..
looks like many more than 4 pieces per sprite in the video. Nice explosions.
Freeware explosion generator
http://www.geocities.com/starlinesinc/
good one Sean. I'm currently using a 3D explosion in ST3 but if I blend in a 2D one it may look more realistic.
http://www.wondertouch.com/default.asp

Particle illusion, not free, but quite good, I think it's the same engine as combustion.
Thanks for all the tips.

Johan: I have decided I want to go with something a bit more random than animation type effect - I am planning on having a range of explosion sizes. Thanks anyhow.

Conan: I've tried a palette based blur effect like typically used in fire effects - still have to tweak it a bit to get the exact effect I'm after though:

http://www.ducklets.com/Downloads/1.00/PocketPC/test1.exe
(Don't click near the edges as I don't have clipping on yet, and there's no exit - you will need to reset :))

warmi: Splitting up sprites is a good idea. I was going to have separate "explosion bits" sprites, but will give your idea a go. I had a look at the movie, and the explosion themsleves were pretty ordinary, but the splitting effect really worked well.

Mr X: Thanks for that. If it turns out I can't afford to waste cpu processing realtime explosions I may fall back to that.
It says that a component could not be found... Is there a DLL or something missing?
I must have compiled it for PPC2003