Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Explosion and special effects demo

Author
Message
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 24th Jan 2004 23:26 Edited at: 20th Nov 2004 05:40
Here is a demo of explosions, smoke, debris, shockwaves, and flares for all of you. Many people have been asking how to create 3D explosions, and this is the best way.

The file is about 1MB, with lots of media. There is a DB Classic and DB Pro version, pretty identical. I just couldn't get dark ghosting to work in the DB Pro version, so I disabled the smoke. Maybe this is a bug...

Here are a couple screenshots of the demo:




Just ask if you have any questions about the code. It is not commented the best, but I started from scratch last night, so I know what everything does.

You might not want to use the media in any games you are going to sell. The ship was made by Banshee studios, the explosions are from the explosion generator, and the flare light is from some company that decided not to make a game in mid-progress. I created the shockwave texture, and the smoke texture is from the DB tank demo (I think).

But the code is all mine

Here is the link to the program:

http://www.stormwave.net/bolt/Explosions/Explosion.zip

And the updated source:

http://www.stormwave.net/bolt/Explosions/ExplosionClassic.dba
http://www.stormwave.net/bolt/Explosions/ExplosionPro.dba

Hope you like it and that it helps some of you out with explosions and special effects.

Xander Moser - Bolt Software - Firewall
Ub3rS0ldAt Patriot of War
20
Years of Service
User Offline
Joined: 8th Dec 2003
Location: United States! Support the Soldiers!
Posted: 25th Jan 2004 02:33
File? Where?


.:Leader of BoX-Softare Gaming Company:.
Dostej
21
Years of Service
User Offline
Joined: 21st Jan 2003
Location: Switzerland
Posted: 26th Jan 2004 14:30
Yep, I cant find the files...

GALACTIC X - A very early demo is now available - comments very welcome - http://www.angelfire.com/droid/galacticx/
also my IDE - jaPROe and some snippets
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 26th Jan 2004 19:28 Edited at: 26th Jan 2004 19:36
Oh my gosh, I am stupid. I forgot to give you guys the link

Here is the link:

http://www.dbspot.com/bolt/Explosion.zip

Man do I feel stupid, sorry guys. Please download it and try it out. Ask me any questions you may have.

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 26th Jan 2004 20:38
Very cool

"They misunderestimated us" - George Bush
"The box said 'Requires Windows 95 or better'. So I installed LINUX. "

Formerly David89.
The Dark Padawan
21
Years of Service
User Offline
Joined: 5th Aug 2003
Location: USA!
Posted: 26th Jan 2004 23:33
I'm sure it is really cool but I keep getting the page cannot be displayed

"Nintendo GameCube is the best"
I used to be the Dark Padawan
UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 27th Jan 2004 03:51
Yes it was a very cool game you could modify it and made it a "dont let the aliens land" type of game =)

Soon to have a Asus motherboard with 64 bit CPU and the works weeeee!
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 27th Jan 2004 15:36
Another quality effort Bolt! Well done sir!

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
Marvey
22
Years of Service
User Offline
Joined: 15th Oct 2002
Location:
Posted: 27th Jan 2004 19:18
Yup loved it!
DEANO
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United States
Posted: 28th Jan 2004 03:11
very cool!

"When I examine myself and my methods of thought, I come to the conclusion that the gift of fantasy has meant more than my talent for absorbing positive knowledge."
-ALBERT EINSTEIN
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 28th Jan 2004 03:36
Thanks, but I didn't make this to be a game, I made it to help people make good effects in their games. I am glad you guys liked it, does anyone have any questions on it?

Try it again Digital Boy, I just tried both links (in both of my posts) and they worked fine.

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 28th Jan 2004 07:03
Bolt - I'll have some questions once i get advanced enough to read and understand all the code even though it is commented.

Soon to have a Asus motherboard with 64 bit CPU and the works weeeee!
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 28th Jan 2004 19:30
I will comment one better and upload the source code again so less experienced people can understand it.

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 28th Jan 2004 22:59
One of the best snippets I've seen so far. Very nice, and well enough commented to get me started on some cool effects.

This is very much appreciated Bolt.



A book? I hate book. Book is stupid.
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 7th Feb 2004 04:27 Edited at: 7th Feb 2004 04:31
I have modified the code with more comments. Beginners should be able to get a little more out of it.

Has anyone used this in a program yet?

[href]http://www.dbspot.com/bolt/Explosion Classic.dba[/href]

[href]http://www.dbspot.com/bolt/Explosion Pro.dba[/href]

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Dostej
21
Years of Service
User Offline
Joined: 21st Jan 2003
Location: Switzerland
Posted: 8th Feb 2004 18:49
No, but i looked at the demo and tried to understnad how you did this. But I will use it (at least as a starting point) for my game.

GALACTIC X - A very early demo is now available - comments very welcome - http://www.angelfire.com/droid/galacticx/
also my IDE - jaPROe and some snippets and tools
DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 9th Feb 2004 15:37
Hey dude!!!! cool demo you've got here!! just what I was needing for my F-16 flight sim, real and cool explosions!! whoa, I definitivedly gonna use it in my game, that's for sure! . I only tested the classic demo 'cause I don't have DBPro, but anyway it's REAL cool!!! cool work my friend!

I only noticed something...the flares...they look cool but sometimes they look like....a glass....I can see the borders of the plane...I know that's DBClassic...

Anyway the demo is EXPLOSIVEDLY COOL!!!!!!!!!!!!!!!!!

Oh and...cool flare... I wonder how I can make one in 3DSMAX...

::·· Intel Pentium II 300 Mhz, Sound Blaster AWE 32, 5 Gb HD, SiS 8 Mb video card, Windows 98 and 64 Mb RAM ··::
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 10th Feb 2004 03:30
You can see the borders of the plane of the flare object? I will look into it...

Glad you like it, if there are any specific questions, just ask.

The flares are a little bit sci-fi, they can be disables for a more conventional explosion.

Actually, the DB Classic version looks better than Pro. I didn't get the dark ghosted smoke working in Pro, I forgot about the 5 different ghosting modes in Pro, I will fix that later.

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Terabyte
21
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 10th Feb 2004 14:12
yeah... slightly off the topic from explosions... but

fps#=screen fps()
speed#=60.0/fps#

does that keep everything moveing at the same speed.. so if you get fps slowdown. the object will speed up to compensate? even though they may be a bit jumpy?..am i right...or am i talking out my pipe

thx

The following threads and their accompanying sound tracks are protected by copyright and any broadcast public diffusion, copying and edditing are etc... etc.. you may not complain about my Typo's
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 11th Feb 2004 04:57
TeraByte- Yes, you are completely correct. I use this method in all of my programs. Then I set sync rate to 0. It allows any frame rate possible, while running everything at the same speed on all computers. Thanks for bringing that up.

Everything that is done (moving objects, increasing frames) is multiplied by this value to keep everything the same on all computers.

The only reason I don't do this:
speed#=60.0/screen fps()
is because if you use the command screen fps() more than once in a loop in DBPro, it gets bigger and bigger

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 11th Feb 2004 10:12
it might be worth mentioning that the "screen fps()" command doesn't seem to be super acurate, and also doesn't update as often as you might like. you can use the timer() command to determine the current fps for a slightly more accurate solution.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia Ti4200 AGP 8x 128MB
DBasic Khan
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: Alpha Quadrent, Sector 1,1 SOL SYS
Posted: 12th Feb 2004 21:05
bolt u r my hero!
Im gonna use these concepts in my game for sure (space shooter game like rouge squadron). I got how the shock wave works but im haveing difficulty decifering the smoke, could you explain how it works for me?
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 14th Feb 2004 03:36
DBasic Khan :

Sure, this is basically how the smoke is done:
It is quite similar to the shockwaves. A plane is textured with a texture and stretched out and faded.

The major differences between the shockwaves and the smoke are:
-Smoke has multiple textures that are applied in sequence. The variable smokef#() is used to keep track of the texture to be used on the smoke.
-Smoke is dark ghosted
-Smoke is pointed at the camera to appear 3D

Anything else I can help with?

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
DBasic Khan
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: Alpha Quadrent, Sector 1,1 SOL SYS
Posted: 17th Feb 2004 20:16
i think i got it, thanks bolt, i sat down with it friday and took it apart peice by pice and im pretty confident with it now
sorry i took so long to respond, the internet was down here at school and i dont check my stuff at home
DBasic Khan
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: Alpha Quadrent, Sector 1,1 SOL SYS
Posted: 17th Feb 2004 20:27
sorry got another question
i see how the smoke plain is resizing but r there multiple plains? because it appears that there are several plains that are appearing there, or is that the same plain?
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 17th Feb 2004 20:37
No problem;

Each puff of smoke is a dark ghosted plain. Every 2/10 of a second a new smoke object is found, unhidden, and placed at the position of the ship, you should be able to find that part of the code.

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
DBasic Khan
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: Alpha Quadrent, Sector 1,1 SOL SYS
Posted: 19th Feb 2004 20:14
yes i c, now it makes ALOT more sense. I did c that part, i just was having troble decifreing it because there was so many variables that i didnt know. Again Thanks a million, this stuff will help greatly!
The Dark Padawan
21
Years of Service
User Offline
Joined: 5th Aug 2003
Location: USA!
Posted: 21st Feb 2004 18:14
I got it to work and it is awesome!!
Awesome graphics bolt

"Nintendo GameCube is the best"
I used to be the Dark Padawan
DracoFireDragon
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location:
Posted: 22nd Feb 2004 05:09
I tinkered around with the code and have made a little 'shrapnel' generator for any Misc. explosions or shattering materials...

every few seconds in this code it uses all the triangles it can to make a little triangle explosion..

Use the arrow keys to change the Sin/Cos Angles it uses to toss the triangles in a general direction...
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 23rd Feb 2004 05:33
That is great, I am glad that others are learning from my code.

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 7th Mar 2004 07:08
Hey Bolt! how're you?

Hey you know...I really liked that Explosion and Special Effects code snippet. I tried to adapt it to fit in my game but it didn't worked so I'm doing it in my way (taking your code as a guide ) but I've got a question to ask: ¿how did you manage to do not get the "boxy sprite" thing?, Everytime I make a ghosted object with a transparent texture (like the explosions) it looks like if the transparent color get white and it looks VERY bad!...I'll add a screenshot later if you don't understand what I'm trying to say, ok?

Thanks in advance

Current Projects: F-16 Gold Wings
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 7th Mar 2004 20:48
The only thing I can think of right now is that the color that you are trying to use as the transparent color is not pure black. The color that will appear transparent on a ghosted object is black (not dark ghosting, which is applied with a flag on the end of the ghost object command).

Check your images to see what color is in the background.

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 8th Mar 2004 02:10
For now I'm using the explosion images you included in the zip file, of course I'll add my own explosion images...anyway the color is 0,0,0

Current Projects: F-16 Gold Wings
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 13th Mar 2004 23:20
Check the images that you are using for your own ghosted objects. Make sure their background color is pure black. Are you using Pro or Classic? There are multiple ghosting modes available in Pro by using a flag after the ghosting command. Take off the flag for standard ghosting:

ghost object on objectnum

If you make a little program and include the media with it I can tell you why it doesn't work. Just email it to me or upload to the internet if you have an account.

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 24th Mar 2004 06:37 Edited at: 24th Mar 2004 06:54
HEY! Where did my file go! The explosion.zip file is missing from my account!

I am re-uploading it now...

Okay, I have finished uploading the file:

[/href]http://www.dbspot.com/bolt/Explosion.zip[href]

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Cyberflame
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: Im not sure....
Posted: 24th Mar 2004 22:21
Is this how you did it in firewall. (congrats on getting you program on the front cover)

DANGIT NEO, YOU CHANGED THE CODE AND NOW THE MATRIX WONT TEXTURE RIGHT.
The Dark Padawan
21
Years of Service
User Offline
Joined: 5th Aug 2003
Location: USA!
Posted: 25th Mar 2004 01:39
I tinkerd with the code and made the ships ducks
and instead of exlposin waves and smoke its feathers and guts!
It is kind of violent that way though

"Nintendo GameCube is the best"
I used to be the Dark Padawan
ALPHA ZERO PRODUCTIONS
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Mom ! I forgot where we live !
Posted: 25th Mar 2004 04:21
the link http://www.dbspot.com/bolt/Explosion.zip does not work

Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 25th Mar 2004 06:05
Cyberflame: yes, this is the exact method I used for Firewall.

Digital boy: that is the best way to learn, change the code and graphics and see how it works. Good job.

Alpha Zero: click on the link at the top of the page, or copy and paste the address into you address bar. I just tried it and it works. Must be a typo on your part.

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 30th Mar 2004 01:17
cool! but i need a explosion effect that well... explodes the thing completly, instead of exploding it then letting it fall to the ground and then totaly exploding it...

i haven't had much time to look at your code yet so maybe i'll be able to adapt it to do what i want (i'm going to make a 3D RTS like a mix between homeworld and starwars... after my current project-3D PakPerson)

ooh ooh i got this great idea master yoda we could make a game! and the game's story line would be...
"Your wife is death. How? NO idea. But it is murder. REVENGE!!!!!!!!!"
Tapewormz
22
Years of Service
User Offline
Joined: 15th Sep 2002
Location: Winnipeg, Mantoba, Canada
Posted: 18th Jul 2004 07:57
Thanks for posting this Bolt. It sure helps guide me.

Quote: " Timesoft - Your wife is death. How? NO idea.
But it is murder. REVENGE!!!!!!!!!"

Hands down the funniest synopsis for a game ever. All your base are belong to us!
The Dark Padawan
21
Years of Service
User Offline
Joined: 5th Aug 2003
Location: USA!
Posted: 20th Jul 2004 07:00
How is this thread still running? Hasn't been nearly 2 months?
OWELL

"Nintendo GameCube is the best"
"I'm back! and Darker than ever!!!"
PantheR RIP
21
Years of Service
User Offline
Joined: 7th Jul 2003
Location:
Posted: 21st Jul 2004 03:34
Ehhhh... In 5.5 smoke doesn't appear =( Tried to change ghosting and light params but useless...
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 26th Jul 2004 14:37
Yeah, I had to remove smoke in the DB Pro version, I never got the dark ghosting down in Pro, since I still use Classic...

How were you able to respond, Tapewormz Last time I checked, no one could reply because it was too old...that funny...

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 26th Jul 2004 15:19
That time when the forums went down June 23rd or something, after they came up you could post on anything!



A book? I hate book. Book is stupid.
(Formerly known as Yellow)
Mx5 kris
20
Years of Service
User Offline
Joined: 9th Oct 2004
Location:
Posted: 8th Nov 2004 13:02
No worky....dbspot gone....

This is only the beggining...
The end is ony the beggining...
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 9th Nov 2004 00:28 Edited at: 20th Nov 2004 05:39
Talk about reviving a dead post...

I will upload the files to my new server in a little bit...

I fixed the links at the top post...

Xander Moser - Bolt Software - Firewall
darkdomy
21
Years of Service
User Offline
Joined: 6th Apr 2003
Location: Italy
Posted: 12th Nov 2004 20:25
hello Bolt

very good samples ,


vote:

fps: very power of executions

base samples 100% easy very professional samples


hello Bolt , attend others samples

Anxiously awaiting BlueGUI v2

it informs to me when and ended BlueGUI v2
X Trade
20
Years of Service
User Offline
Joined: 19th Feb 2004
Location: near bristol, UK
Posted: 13th Nov 2004 01:49
this looks great, im just about to download it, so excuse me if im asking about things there are already there... but...

what if there is no ground? in a pure spaceflight game, i have seen some very interesting ways of making something explode. the most interesting way i have tried to reproduce is in IWAR-2, where the ship continues to coast at the speed it was going, and as that happens there are seccondary explosions, (all of the explosions travel at the same speed as the ship too) which tend to knock the ship and roll/yaw it (vector movement for the ship of course). there are usually 3 or 4 of these explosions before the entire ship explodes in a large explosion leaving nothing more than a few pieces of shrapnel...
nethertheless this may be very useful to me and i appreciate it, but i really am trying for sometihng similar to the above

www.AoFP.tk

Login to post a reply

Server time is: 2024-11-23 18:51:21
Your offset time is: 2024-11-23 18:51:21