SPARKS

Blitz3D Forums/Blitz3D Beginners Area/SPARKS

Zeotrope(Posted 2008) [#1]
If you guys wanted to simulate sparks caused by bullet imapacts on metal objects such as vehicles etc, would you....


Use an animated sprite / particle sys?

Object based particles with gravity?

Any other approaches?


It's for an FPS, but I guess less is more? Couple the animated sprite with a light source?

I am simulating m16's and ak47's


Naughty Alien(Posted 2008) [#2]
Particle for sure with some random spreading so each time bullet collision happen it will not be obvious repeated same animation set..


Zeotrope(Posted 2008) [#3]
Hmmm...

Ok...My first thought would be to create say, 10 particles in one pass and then let them randomize and fall etc.

Would you light source the initial flash at particle creation? I am thinking of creating a low-glow light (red - yellow) to follow the falling sparks.

Would you have the sparks bounce off of the surface they strike?

Too many options! :)


GIB3D(Posted 2008) [#4]
I just thought of this, couldn't you take the X Y and Z velocity of the object just as it hits another object, then move the particles like

MoveEntity Particle,-X,-Y,-Z


to move them the opposite way that the object was moving?


Mortiis(Posted 2008) [#5]
Try those options and select the one which pleases you the most.


Zeotrope(Posted 2008) [#6]
I'd rather try what pleases others first; I have been looking at my code for 4 years now....I am tainted! :)

You know, you make a nice graphic/texture or object. It 'wows' you for a day or so....you show your non-interested wife / husband / dog / cat ....and they say "Ummmm yeah, that looks err...cool" [yep, my pets can speak]

After a while, it just looks like stuff....and this community scares me; PPL cant even place a gun in the left hand without 100 posts telling him "it's not the way to do it!!!"


Anyhow, I will try the easiest: Sprite based method to see if the effect is appropriate, but will need to look at actual particles that react with the terrain / walls etc. I have other requirments within my game that require non-sprite particles (rock debris / falling leaves / birds / fish)

@ Green Fire

Good idea, I used this with my grenades as they bounce off of the terrain.
(if the Greande heads at a 45 degree angle when it hits the ground,

it loses 1/3 of its forward speed due to friction.

it flips the fall angle 45 deg to -45 and then takes off a 1/3

Works ok. Not 'great' physics, but effective.


Ross C(Posted 2008) [#7]
Just watch out with particles as if you have a rapid firing gun, it may produce too many particles and slow your game down. Have a limit on the number of onscreen particles, or spark particles and stop producing them if that limit is exceeded.


Zeotrope(Posted 2008) [#8]
Yeah. Thats my major concern. I have a whole lot going on as it is- and I think im near the limit. (no object based LOD atm)


Mikel(Posted 2008) [#9]
I do that effect with Particle Candy. I just put the particle emitter where the bullet hits.

You can see what I am doing by downloading the alpha build of Hover Cube. If you shoot a green target cube then you get a small explosion with green particles that shoot off.

Download is in my sig. There are some screenshots in the Blitz Showcase.