Fire Particle System

Started by
10 comments, last by allingm 13 years, 2 months ago
Hi,

Im doing a particle system right now. Im using the one on the XNA website, no point reinventing the wheel. They give smoke and explosions. So im on to fire now.

What im wondering about is the general logic behind a fire. What would that be? (its a 2D game).

Cheers.
Advertisement
Starts hot at the ignition point and cools off as it gets further away (relatively). So choose the color you want for hot (blue/red/etc) and as the particles move away, change the color to a cooler color (yellow or whatever). You could always just look a a lit lighter (where I got blue from) or go outside and safely play with a small fire and observe what is happening.

Legal notice: I can not be held responsible for any damage to you, others around you, or property. Use at own risk! =)
my blog contains ramblings and what I am up to programming wise.

Starts hot at the ignition point and cools off as it gets further away (relatively). So choose the color you want for hot (blue/red/etc) and as the particles move away, change the color to a cooler color (yellow or whatever). You could always just look a a lit lighter (where I got blue from) or go outside and safely play with a small fire and observe what is happening.

Legal notice: I can not be held responsible for any damage to you, others around you, or property. Use at own risk! =)




So dont use a texture for the flame then?

so i start with yellow/blue in the middle, then they rise, after a certain time, fade to different colour, then keep rising and fade out. Sound about right?
In my time at Digipen, I wrote a 2d paritcle system...
It allowed the setting of lots of parameters, and we had a gui for it. It was basic, and written in OpenGL but I believe this screenshot should answer your questions...

There are two bars for each color component rgb, the top bar is the starting color, and the bottom is the ending color.


fireparticle.png

I hope that helps...

By making a gui it was easy to make all sorts of affects, snow, rain, spells, etc...
Here's another example.

niceparticleeffects3.png
Douglas Eugene Reisinger II
Projects/Profile Site
Good fire article:

GPU Gems: Chapter 6: Fire in the Vulcan Demo
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
That is actually a good idea.

What are them mod functions on the bottom? The Sin and Cos i assume are to add circular motion if needed. What are the X and Y ones? EDIT: you click X Mod to add sin/cos to the x axis, is it? and Y Mod to do it to the Y axis?

When you have the particle as you want, what then? Do you save it and then call it with a position or something?
Yea, our GUI design wasn't the greatest given our short timeline. But you toggled X Mod to enable the output of the position to be factored by a Sin function, and cosine respectively. Once it was how you liked it, you clicked on a number under Set To and clicked OK. You could then place a particle system on any tile in the editor, and it would render in game.
Douglas Eugene Reisinger II
Projects/Profile Site
How long did it take to knock that together?
We had a team of 4, one man worked on the map editor, and the rest of us did engine and game coding. I believe the whole map editor took like 4 - 6 months, it was a long time ago though. But considering the dude coded a gui from scratch and we had an animated tile system, with collision, pc and npc placement, items and particles, he did great! I wrote the particle system in about a week and tweaked it over the following three weeks. And then he incorporated it into the Map Editor.
Douglas Eugene Reisinger II
Projects/Profile Site
Additive blending is worth looking into. This is a pretty good page on the subject.

This topic is closed to new replies.

Advertisement