Game Design, Programming and running a one-man games business…

Making things explode (day two)

All I’ve worked on today is explosions, and not the sounds, just the graphics. The first part of the day was one of those moments that if 15 year old kids saw, they would think “Dang, I really need to do this for a living”. Basically I sat and drank tea whilst watching star wars : revenge of the sith space battles in slow motion. I’m sure a lot of people think all games development is like that.

In practice, it actually is real work, because I’m trying to achieve the impossible, which is to replicate ILM-rendered explosions that take hundreds of PC’s days, to run on a cheap laptop at 60fps. It’s clearly going to look crap by comparison, but I’m doing my best.

My initial thoughts with the game had been to use animated sprites. Basically, I had a particle engine that would throw together tons of particle effects, merge them, and save them out as a flipbook style group of images that get played back like a video clip. The plus side of this is that its really low CPU and GPU, because its just a few simple sprites. The downside is that it looks like crap. The problem is that a 64px by 64 px explosion (small!) that has 16 frames will be 256×256. to have 64 frames its 512×512. 64 frames is about 1 second, so that gives you a one second, always the same animation that is contained within 64 pixels.

If you need 4 varieties of that, thats a lot of texture for an indie downloadable game, and if you go to 128px explosions we reach 1024 square textures, and it all gets very inefficient.

The other solution is to optimise the crap out of your particle engine, and actually do the explosions in real time. That’s what I’m doing now, and it looks tons better, plus a bit of random fuzziness makes it different every time. And I can have bits of debris fly off over 128 pixels, which looks tons better. The problem is it involves drawing a lot of pixels, and a lot of verts, and doing tons of calculations for velocities, fading, shrinking etc. You need to avoid memory allocations, group together emmiters to minimize draw calls, blah blah. This is why it takes ages to get right. My current ‘big’ explosion has seperate emmiters layered to draw smoke, black smoke, big rubble, dust, flames, glowing bits, plumes of smoke and plume flares. They all combine in a single point to generate the final explosion.

Tomorow I’ll try and post a few screenshots, although it all looks much better when moving. I’m just waffling here so you appreciate it when you play the demo one day :D


3 thoughts on Making things explode (day two)

  1. I can’t tell for sure but I don’t think the explosions in Star Wars were computer generated. Especially in the big battle scenes, they might have used an approach like you’ve described: they filmed some real explosions and used that footage as a sprite. Even ILM has to work economically, you know.

Comments are currently closed.