all about the particles....

Monkey Forums/Monkey Programming/all about the particles....

Paul - Taiphoz(Posted 2013) [#1]
I would like to talk about particles .

if you were to make or use a particle module , what would you be looking for in terms of functionality, what's the one thing that you would NEED from such a system.

At the moment I am throwing particles at my screen and just letting the particle class handle them, but I now need to write myself an emitter class so I have some more control over where they spawn from, and this got me thinking about particle systems as a whole.

so would love to hear what you guys think, would you use a third party module to manage your particles or would you always tend to write your own, would an open source particle system be of value to anyone ?


Uncle(Posted 2013) [#2]
If the particle system was easy enough to use, and plugs directly into other libraries out there then I would be interested.

In terms of functionality / needs I would say Particle Candy used to have pretty much everything I needed except the editor. However I think the editor is a must - Timeline FX has a pretty sweet editor.


Tri|Ga|De(Posted 2013) [#3]
I have ParticleDesigner from 71Squared and would love to be able to use that in Monkey.


MikeHart(Posted 2013) [#4]
TriGaDe, fE will support PD soon :-)


Paul - Taiphoz(Posted 2013) [#5]
I'm gona start on it , but I won't be doing an IDE for it it's not a type of programming that I enjoy sadly.

If I make it open source then an editor is something some o e better it could possibly do , as for features iv not used any of those tools so I'm afraid those examples don't really help me , I might check them out tho.


muddy_shoes(Posted 2013) [#6]
I intuitively think of particles in a model where emitters are particles too. Unfortunately this seems to not be the way most of the systems out there work. If anyone knows of a particle editor (with preview) that works in that way I'd love to hear about it.


Paul - Taiphoz(Posted 2013) [#7]
My initial thoughts are to create a Master Emitter, that entity will then hold child particles, and child emitters.

which means I should be able to update all particles and emitters by calling update on the emitter class, that will then cycle through each emitter, which in turn will cycle through each particle attached to that emitter.

I as I said have not really used other systems , I'v always just coded my own little particle class's or types , so this is all a bit of an experiment, at the end of the way what I really want is a no fuss, easy to use function system where I can call one update , and a single create/load to get particles flying around the screen.

if I can get a rough working model up , I will probably open source it and get some of the smarter more efficiency minded people to poke around it.


Paul - Taiphoz(Posted 2013) [#8]
Been thinking about what you said overnight muddy, care to elaborate more on what you meant by the particle could be an emitter as well ?

when I thought about it more, I was thinking each particle could have a field/property called emmit:true/false if its true then the code would then look to see if its got any particles in its particle list, and if yes then update them if its also an emitter it would also then update its emit method but I was thinking that could get a little messy.

did you have something else in mind ?


Difference(Posted 2013) [#9]
Just saw this: Argyne - Superemitter particle system http://monkeycoder.co.nz/Community/posts.php?topic=5255


muddy_shoes(Posted 2013) [#10]
I haven't looked at Argyne's code but I imagine it's the sort of thing I mean. Emitters can be treated as particles, with velocity etc. and also can emit other emitters. This allows the construction of composite effects like fireworks.

However, it's really not the rendering lib I care about (I already have a working particle system). I'm looking for an editor that works that way as I don't much fancy writing one.


wiebow(Posted 2013) [#11]
Emitters emitting particles or emitters: that is the approach I used in my ParticleMAX module. I do not have the code online but I can send it to you if you want to.

http://wiebo.wordpress.com/2009/06/21/spawner-spawns-spawner-spawns-spawner/

I was also creating an editor for it but I got sidetracked somewhere :) as often happens.

http://wiebo.wordpress.com/2009/02/10/particle-engine-up-and-running-in-the-editor/


muddy_shoes(Posted 2013) [#12]
I'm not a Blitz user, so the code wouldn't be of much use to me. Thanks for the offer though. Looks like you made a good start.


peterigz(Posted 2013) [#13]
The Structure I like to use is Effect -> Emitter -> Particle, where effect can control global aspects of all the emitters it has; useful for controlling things about the whole effect at runtime. The emitter describes exactly how the particles are spawned and how they behave, and the particle keeps track of its current state and of course can itself contain other effects with emitters and so on.

And to keep everything neat and tidy a particle manager class can maintain the whole process to simplify implementation within whatever game/app your making.


Paul - Taiphoz(Posted 2013) [#14]
that effect emitter setup is essentially what I am thinking with your effect being what I call my Master Emitter, which will allow me to have as muddy commented above firework type effects where the master emits a child emitter (the rocket) which emits sparks and smoke, and then at altitude it would emit a new emitter which would in turn emit the bang and any tertiary emitters for secondary bangs.

I am actually doing fireworks as the effect as I think it perfectly demonstrates this nesting of emitters and particles inside each other.

That editor looks kinda cool , you should port that code over to monkey, we cant have enough particle systems its one thing just about every game will use at some point or another.


wiebow(Posted 2013) [#15]
@muddy shoes: easily ported :)

@Taiphoz: Sorry, I'm not really using Monkey atm.


Nobuyuki(Posted 2013) [#16]
The things I look for in a particle engine is the ease of use, flexibility, and cost. I'm usually a miser, so most engines I haven't really looked into much because the effects and features didn't impress me for the price.

In terms of features, anything that can create multi-stage emissions easily and readily is good in my opinion. Most seem to approach this by using some sort of a timeline, but there are some which use super-emitters instead of or in addition to that, which is pretty cool.

When choosing a particle engine, you gotta see them all as pretty much somewhat complicated finite state machines (think OpenGL 1). What am I going to be able to do with this thing? Will it do everything that I want it to do? How do I create the patterns -- with code? A GUI editor? Some sort of IDE hybrid?

I always used to write my own little hard-coded bursts for whatever job I needed, but when progressing to something more generic, I found out that it's quite a large undertaking. I think that having a clearly-documented, and very expressively definable open source library for particles would be a boon, but again; finite state machines. There's probably never going to be a quintessential one of those, and everyone's gonna want one that does certain things a certain way for convenience, or their thought process is simply locked into a certain design pattern which tells them that a different way would be better.

It's my hope that the system I'm designing will catch on, and people will eventually help extend it for me. I plan on writing a small editor for it eventually, to make it easier to use and generate code with, but that will come later. Right now, it's extensible enough for my own needs. Emitters which are also particles can drill down n-levels deep for as complex an effect as need be; there are a few events that can probably be added (such as when reaching certain percentages of ttl like 1.0) to stretch this out a little further for user convenience, but otherwise I imagine most of the limitations will come from extending the tweenable values available and the lack of easing. (Right now you have to extend an emitter of your own to modify extended values manually from outside the particle itself.)

If you're interested, you can take a peek here: http://www.monkeycoder.co.nz/Community/posts.php?topic=5255