Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Broken Stylus on August 16, 2019, 10:47:58 AM

Title: Performance : 'event' vs 'go to'
Post by: Broken Stylus on August 16, 2019, 10:47:58 AM
Assuming you don't need to pass any data through an event, which one works faster in Playmaker, to communicate between different game objects or between two FSMs on the same object?
Send event or Go to actions?
Title: Re: Performance : 'event' vs 'go to'
Post by: Thore on August 16, 2019, 05:42:20 PM
I have the feeling you worry about the wrong things  :) but I am curious to learn what you mean by "Go To" actions. What are they?
Title: Re: Performance : 'event' vs 'go to'
Post by: LordHorusNL on August 16, 2019, 06:38:42 PM
Are you talking about the Goto State actions?

There shouldn't be much of a difference in performance i would think.

But seeing that the Event System is the backbone of unity, this should really be your default means of communicating between FSM's and GameObjects.

I don't really use Goto State between FSM's because it just seems more messy than Send Event, but that's just me.
Title: Re: Performance : 'event' vs 'go to'
Post by: djaydino on August 18, 2019, 08:46:11 AM
Hi.
Go to state is perfectly fine to use and can be easier to use in some cases.
Performance should be on par (or so small of a difference that you would need 100.000 of these actions working at the same time to see a difference)
Title: Re: Performance : 'event' vs 'go to'
Post by: Broken Stylus on August 18, 2019, 02:42:19 PM
Okay, I was just being curious. I rarely use this goto action but it's an interesting way to drive a FSM to a specific point too without cluttering the events database.
Title: Re: Performance : 'event' vs 'go to'
Post by: djaydino on August 18, 2019, 04:48:09 PM
Hi.
Just a extra :

With animation events you can use 'Set State' which seems to work better than send event.
Title: Re: Performance : 'event' vs 'go to'
Post by: jeanfabre on August 19, 2019, 02:26:37 AM

But seeing that the Event System is the backbone of unity, this should really be your default means of communicating between FSM's and GameObjects.


The two event systems are totally different, so perfs are not linked.

Bye,

 Jean
Title: Re: Performance : 'event' vs 'go to'
Post by: jeanfabre on August 19, 2019, 02:28:35 AM
Hi,

 Goto will probably have an edge in perfs because it's a direct order to go to a specific state.

But still, to got to that state, the algorythm has to iterate the list of states in the fsm, and to send and event is also iterating through the state and checking if it has this event as a global event to enter.

So in the end, go with what feels right for you, both are fine.

Bye,

 Jean