RenderParticles upgrade

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

RenderParticles upgrade

Post 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?
Last edited by rrTea on Sun May 17, 2015 10:26 am, edited 1 time in total.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Good idea. I'll add it in next update.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Post by rrTea »

Thanks so much for adding it! I already implemented it in my project and the particles now look even more erm, "particly"!
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

RenderParticles AnimateSpeed

Post 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).
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post 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 (?)...
Attachments
Fireworks in Karamball.
Fireworks in Karamball.
scr9_small.png (40.03 KiB) Viewed 20258 times
fireworks.zgeproj
project file
(4.26 KiB) Downloaded 642 times
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Post 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.
Attachments
explosion.zgeproj
Click Left Mouse Button!
(4.27 KiB) Downloaded 564 times
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post 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
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Post 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
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I noticed that too, but I think that it can be a cool effect in some situations :)
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Post 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?
Attachments
explosion 2.zgeproj
(2.82 KiB) Downloaded 461 times
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Post 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.
Attachments
explosion 2.zgeproj
Click left mouse button to trigger the effect. Keep an eye on what happens in the middle of explosion.
(2.91 KiB) Downloaded 472 times
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post 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
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Yes, you've convinced me. I'll look into it.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post 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.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Excellent!!!

Post by rrTea »

Yuhuu! It works - I'll use it for both fireworks and explosions!
Post Reply