Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

joutlaw

2D Particle Engine FX & Algorithms

This topic is 5758 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I asked this same question in another forum and didn''t have much luck so I''ll try here too. I have a pretty simple and basic particle engine in my library and now I am interested in making some FX with it like: (1) Lightning (2) Laser Beams (3) Fireballs My library/engine is 2D DirectDraw/Direct X based. Does anyone have any suggestions, articles, algorithms, tutorials they could point me to? Thanks in advance - J

Share this post


Link to post
Share on other sites
Advertisement
I don''t there is something like articles or algos. Suggestions maybe. My only suggestion is: fiddle with the different values a bit and try things out. The best way to do this is to make a particle editor (pretty easy if you know win32 programming) but you can also just alter you code each time. Another idea is to pick someone else''s particle editor and use that one for testing, since most particles have about the same member variabeles to create the effects (like life, speed, etc.)

Share this post


Link to post
Share on other sites
They key is to have a huge range of options for your particles - but obviously the more versatile thestem thower it will be.

For instance if you can create particles with zero velocity that are long and thin with an animated gif on them using your system - creating a simple lightening bolt or laser beam would be very easy.

Give the particles life stages - ie start middle and end each phase with its own lifespan = then you can fade them up - animate them and then fade them down and shrink them after a certain time (or anything else).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Well creating good looking particle effects in 2d becomes more of a challenge than it''s 3d counterpart. The majority of particle effects take advantage of the alpha transparency that you can achieve through 3d hardware in 2d you need to do this all in software, which means slower rendering times and less particles you can have on the screen at one time.

As for algo''s themselves I don''t think there is any standard algo that exists for these types of effects. But I can give you a general idea of how to do it.

1) Lightning can be modeled with particles by using a tree like structure. If you look at something as simple as a Binary Tree you can see from afar that it looks similar to a branch of lightning. You can randomly generate a tree structure with in parameters and use this to determine where the branches in the structure are, then it''s a matter of linking the branches togeather with a bunch of particles with a tad bit of "jiggle" to them.

2) Laserbeams aren''t exactly what I''d call particle material because these are typically very long polygons with alpha at it''s ends so that it blends there are no algo''s for this as a laser can technically shoot off to infinity as it is a beam of light. So it all depends on how you want it modeled.

3) Fireballs are more along the particle object range. You''d set a bunch of particles to dispurse in a circular range they''d be white at this point, as the particles age you''d transition the colors to red/orange/yellow and finally to black and let these dying particles slow down so that they form a trail. All the while spawining new particles at the center of the object. You''d probably want to create 2 particle systems so that you can get a halo effect around the fireball as well.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!