the best way to make an explosion?

Started by
10 comments, last by markr 19 years, 7 months ago
hello, the game i'm currently working on is some kind of a flight sim. you can control your spacefighter (or whatever it is) with mouse and keyboard and the enemy is controlled by another human via network. my problem is: when i hit the enemy with my missile/shot (not sure what it will be when i'm finished. so far its only a colored box) it just disappears. but i would like to make something like an explosion when i hit it. what would be the best (fool-/n00bproof) approach to do this? should i take all the polygons of the spaceship explode them and just let them fly around for a while? but the textures are only visible on the outside so if i would take the ship apart i would have some pieces invisible and some visible. how do you ppl make explosions in 3d games? it doesnt have to look good because the whole game doesnt look very good so far but one should be able to identify it as an explosion. thx BiGFooT
Now get down on your hands and knees and start repeating "Open Source Good, M$ Evil", smacking your head against the pavement after each repetition. Once you have completed your training you may change your first name to GNU/, to show that you are free from the slavery of the closed source world. -Michalson
Advertisement
flightsim?

Have it give off some smoke (take a look at particle systems) and then just fall. Don't do an explosion. Overused. Just falling out of the sky is more original.
It'd be quite hard to "break" apart the polygons, especially if you're going to be using a mesh, as I suspect you might.

The easiest thing that would produce good results would be to make a particle system that would mimic the explosion: it would shoot off debris in all directions, then you could fade the alpha- and diffuse- values of your mesh materials to reddish-clear quickly to remove it from the screen when it's masked by the particles.

Search for "particle system", "materials" "alpha blending"... I believe the DX SDK has an entry on "explosions and effects" if you want to read that too.

But I agree with the smoke.... *ideally* you'd have some smokers and some exploders, but that may be beyond your ability. Try and see what works.

Mushu - trying to help those he doesn't know, with things he doesn't know.
Why won't he just go away? An question the universe may never have an answer to...
Quote:
Have it give off some smoke (take a look at particle systems) and then just fall. Don't do an explosion. Overused. Just falling out of the sky is more original.

sounds nice :) thx. i'll see if its within my abilities or if i should just let it fall down w/o smoke which would look stupid.
Quote:
that may be beyond your ability

yes, you are right :P
i'm really proud of what i finished but i should go for the simple stuff because i'm still a n00b in 3d stuff.
Quote:
DX SDK

OGL here :/ i decided to use ogl this time because... ummm... there was no reason to do it. i just felt like using something else this time. i used dx for some 2d stuff and it was very nice. but i wanted to try ogl as well.

thx for all the answers. i'll read some tutorials about particle systems.
BiGF00T
Now get down on your hands and knees and start repeating "Open Source Good, M$ Evil", smacking your head against the pavement after each repetition. Once you have completed your training you may change your first name to GNU/, to show that you are free from the slavery of the closed source world. -Michalson
:( i just realized that falling to the ground might need something like gravity. i cant just let it fall straight onto the ground. it should have the velocity from the moment when it was destroyed and it should fly into the ground like a parabola. i could just let it fly in the direction it was facing when it was destroyed set the y vector straight and decrease the height every few milliseconds until the ship hits the ground. then (assuming i have the ability to create smoke) i cover the whole thing in smoke and let it vanish into thin air.
do i need gravity? i already thought i could explain the physics of the ship with the excuse that it is a spaceship and not an ordinary plane :) you can stand still in the air like a helicopter or fly like a plane. vertical take-off is impossible though.
Now get down on your hands and knees and start repeating "Open Source Good, M$ Evil", smacking your head against the pavement after each repetition. Once you have completed your training you may change your first name to GNU/, to show that you are free from the slavery of the closed source world. -Michalson
If your 'dead' ship falls to the ground with a constant acceleration (eg: -y velocity increases at the same rate) then you will have effectively simulated gravity for that sequence. I am assuming you are asking if you need to simulate it within the game play itself?

You can also use the smoke particle system to simulate basic fire, throw in a load of rapidly moving particles with fairly small lifespans that fade from yellow to red (using additive blending) and you can make a decent looking explosion that would go well with the smoke. For added visuals you could throw in a shockwave - essentially a billboarded polygon or a basic flat ellipical shape with a shockwave texture and add a nice rapidly expanding/fading sphere at the explosion centre. Couple this with the smoke and particles flying off so the explosion envelops your model and you can hide the fact that you've just removed it from the scene.
making it super noobproof, why not just make the ship disappear like you're doing now, but add a few/many of the boxes you're currently using for your bullet/missle replace the now missing ship, moving in different directions until they leave the screen?

It won't look fantastic or anything, but it should symbolize an explosion to the player.
Quote:
You can also use the smoke particle system to simulate basic fire, throw in a load of rapidly moving particles with fairly small lifespans that fade from yellow to red (using additive blending) and you can make a decent looking explosion that would go well with the smoke. For added visuals you could throw in a shockwave - essentially a billboarded polygon or a basic flat ellipical shape with a shockwave texture and add a nice rapidly expanding/fading sphere at the explosion centre. Couple this with the smoke and particles flying off so the explosion envelops your model and you can hide the fact that you've just removed it from the scene.

yes, that was what i tried to explain with my crappy english.
Quote:
I am assuming you are asking if you need to simulate it within the game play itself?

exactly... i'm sure it would be better and more realistic if i would have the gravity all the time but i think its ok if i only simulate it when someone dies. the game is only a test for 3d programming and my first try with ogl. i dont expect it to look perfect. if i would simulate gravity all the time then the player would have to point the nose of the spaceship into the sky all the time only that he wouldnt crash. you couldnt fly through a canyon (i liked flying through canyons in comanche) and shoot on stuff in front of you because you'd crash. i think it'll be better to leave the game as it is and go with the simulate when someone is dead idea. the explanation would be that the antigrav generator fails when the spaceship is hit :) (i love science fiction. every unrealistic thing can be explained with advanced technology :))

Quote:
billboarded polygon or a basic flat ellipical shape with a shockwave texture and add a nice rapidly expanding/fading sphere at the explosion centre

...? i think i have to read lots of tutorials until i can do something like this. i'll be lucky if i can do some smoke. after i finished the smoke i'll try the explosion/shockwave etc stuff.
thanks for your ideas
Quote:
making it super noobproof, why not just make the ship disappear like you're doing now, but add a few/many of the boxes you're currently using for your bullet/missle replace the now missing ship, moving in different directions until they leave the screen?

that will be the option if i fail to make smoke :)
i'll first try to make some smoke and if i realize i'm too n00bish for it then i'll go with your idea. thx

BiGFooT
Now get down on your hands and knees and start repeating "Open Source Good, M$ Evil", smacking your head against the pavement after each repetition. Once you have completed your training you may change your first name to GNU/, to show that you are free from the slavery of the closed source world. -Michalson
ok, now i have something like a particle system running :)
the only problem is that the particles are 2d and only visible from one side :/
what is the solution to this problem? should i rotate them or should i make particle boxes?
Now get down on your hands and knees and start repeating "Open Source Good, M$ Evil", smacking your head against the pavement after each repetition. Once you have completed your training you may change your first name to GNU/, to show that you are free from the slavery of the closed source world. -Michalson
rotate them so that they are always facing the screen. It's not like anyone will be able to tell.

This topic is closed to new replies.

Advertisement