playMaker

Author Topic: Performance in Playmaker (Trigger event, Every Frame, Changed etc)  (Read 2732 times)

DennisJensen

  • Junior Playmaker
  • **
  • Posts: 84
    • View Profile
Hi Forum,

So as a newbie, I could love some facts/tips on how much different actions are influencing performance.

Every Frame:
I know it's okay to use, but maybe not all the time. Instead of checking every frame I could use "changed float", but I'm not sure if it's better performance wise?

Trigger event:
How often does it check? is it like everyframe or does it only check when the rigid body moves?

Other tips on what takes more performance and a alternative would be really cool.
 
Game Designer, CEO, Artist
http://2ndStudio.com

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: Performance in Playmaker (Trigger event, Every Frame, Changed etc)
« Reply #1 on: July 21, 2014, 08:05:33 PM »
Do not under any circumstance use OnTriggerStay.

And try and avoid using Unity GUI elements.

600

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
    • Car and Traffic Playmaker assets
Re: Performance in Playmaker (Trigger event, Every Frame, Changed etc)
« Reply #2 on: July 22, 2014, 12:03:01 AM »
Hello,

- About every frame actions vs "changed", I understand they all are every frame, but some have option to switch that off, like Bool Test etc.

- In other posts I read there are heavy actions like "find gameObject", maybe there are more?

- OnTriggerStay, there are lots of topics that this shouldnt be used, but I have a question.
If I use it like for 0,2 sec does that take lots of performance…?
I use it when Player enter a trigger, trigger waits for exit, but if another player enters and exit, trigger checks with OnTriggerStay for 0,2 sec if there are other players in zone and goes to another state. Is that OK?

Seeing these type of topics gets me thinking, maybe its a good idea to collect these "heavy / notRecomended / useWithCaution" actions in a sticky post with tips?
Most part the performance is in your hands how you make the app/game, but these "tricky" things is good to know.

DennisJensen

  • Junior Playmaker
  • **
  • Posts: 84
    • View Profile
Re: Performance in Playmaker (Trigger event, Every Frame, Changed etc)
« Reply #3 on: July 22, 2014, 12:54:21 AM »
jess84:
Wow okay, thats nice to know because I use it some places.

I learned the GUI thing the hard way  :-\

600:
Yeah I totally agree it would be really nice with a sticky that has kind of a overview, especially for mobile games.
Game Designer, CEO, Artist
http://2ndStudio.com

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: Performance in Playmaker (Trigger event, Every Frame, Changed etc)
« Reply #4 on: July 22, 2014, 07:00:29 AM »
@600
I initially just used it permanently, then I thought about doing something similar to what you're doing - but the performance was still bad. I then switched to just using Trigger Enter/Exit and bools that flipped instead - and the performance difference was amazing.  I would highly recommend using bools to know whether each player is in/out of your trigger, and then doing Bool All True / None True to figure out what you need.

600

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
    • Car and Traffic Playmaker assets
Re: Performance in Playmaker (Trigger event, Every Frame, Changed etc)
« Reply #5 on: July 22, 2014, 07:34:29 AM »
Thanks jess84 for tips.
Now I will redesign those places,
If one player exit I could disable and enable the trigger to catch the player still inside (if there are one) with OnEnter.