Page 1 of 2

RenderParticles upgrade

Posted: Sat Jan 03, 2015 12:27 pm
by rrTea
I think having an option to make particles shrink over their lifetime would in certain cases make them look much better. Maybe something as simple as having the equivalent of the already existing RenderParticles.AnimateAlpha property, but for "size" should do the trick?

Posted: Sat Jan 03, 2015 9:46 pm
by VilleK
Good idea. I'll add it in next update.

Posted: Mon Feb 02, 2015 6:22 am
by rrTea
Thanks so much for adding it! I already implemented it in my project and the particles now look even more erm, "particly"!

RenderParticles AnimateSpeed

Posted: Sun May 17, 2015 10:35 am
by rrTea
I was trying to replicate a fireworks effect I saw in GameCube version of Mr Driller and noticed that they also animate speed of their particles (the speed is decreasing with passing of time) which looks very good to me - is it possible to slow particles down in a similar way like their size and transparency?

Here is a reference video:
https://youtu.be/xn_jgbFPyBQ?t=12s
(each "particle" gets blown off by the explosion and then almost stops before starting to fall down).

Posted: Sun May 17, 2015 6:12 pm
by Rado1
I created fireworks in Karamball; see the screenshot. This effect was achieved by several models with RenderParticles... see the attached project which is part of the Karamball project. Maybe Kjell or Ville can give us some advice how to achieve it more efficiently (?)...

Posted: Sun May 17, 2015 11:52 pm
by rrTea
Here's a sketch of what I'm trying to achieve (attached). This one uses models for each particle, this is just to illustrate the point - of course I'd like to use RenderParticles instead.

I was unable to find the Mr Driller video I mentioned earlier, all the videos online are showing the game etc, but the fireworks effect can only be seen in a side "menu" of sorts and nobody uploaded that part. Their particles look a bit too good though, it's almost as if they were pre rendered or something.

Posted: Mon May 18, 2015 12:08 pm
by VilleK
I've now added a "AnimateSpeed" property. Try something like setting Speed to 10 and AnimateSpeed to -10.

http://www.zgameeditor.org/files/ZGameEditor_beta.zip

Posted: Tue May 19, 2015 12:25 am
by rrTea
I implemented it and it's really nice, the only thing that looks strange to me is that in my case (with Speed 3, SpeedRange 0.25 and AnimateSpeed -6) some particles can actually end up going "backwards" by the end of their lifetime, I assume this is because of the SpeedRange?

Edit: numbers

Posted: Tue May 19, 2015 9:18 am
by VilleK
I noticed that too, but I think that it can be a cool effect in some situations :)

Posted: Tue May 19, 2015 11:55 pm
by rrTea
I guess if somebody wants to use both SpeedRange and AnimateSpeed, the best thing to do is to instead overlay 5 or 10 RenderParticles components with fixed but slightly different (manually tweaked) Speed properties...

One thing I noticed is that RenderParticles ignores RenderSetColor even if the OnEmitExpression is completely empty, and the Alpha of the RenderParticles messes up the components following it... For example, in the attached file: just run it and click left mouse button once to see what it should look like (except for the "particles going backwards before they expire" effect), then go to Content / mod_fxParticles / OnRender / OnEmitExpression and delete the code, then move RenderParticles one position down (below the RenderSetColor). Now the particles are white and the rest of the effect doesn't use the Alpha from ExplosionTint.RenderSetColor component anymore?

Posted: Fri May 22, 2015 11:47 am
by rrTea
VilleK wrote:I noticed that too, but I think that it can be a cool effect in some situations :)
I tried to get used to it, but... After a bit of testing, I really think it falls squarely in the "glitch" category. The mistake is especially pronounced when the difference between Speed and SpeedRange is relatively big, say 2 and 0.5 combined with AnimateSpeed -4.0, the particles close to the center of explosion just go back to the centre boomerang style... As if there was a gravity point in the middle, pulling them back. Really weird effect, I'm attaching an example.

In the attached example try changing SpeedRange to 1 for even weirder effect.

Posted: Fri May 22, 2015 2:15 pm
by Kjell
Hi guys,

I have to agree with rrTea. A friction / resistance / drag property would make more sense in my opinion ( particles losing speed / energy over time ).

K

Posted: Fri May 22, 2015 4:17 pm
by VilleK
Yes, you've convinced me. I'll look into it.

Posted: Mon May 25, 2015 7:55 am
by VilleK
Ok, so now there is a "Damping" parameter to RenderParticles instead that is used to reduce the speed. Please try it out. Same download link as above.

Excellent!!!

Posted: Mon May 25, 2015 8:21 am
by rrTea
Yuhuu! It works - I'll use it for both fireworks and explosions!