playMaker

Author Topic: What's more efficient: Global Event or multiple fsm events???  (Read 1477 times)

autumnboy

  • Junior Playmaker
  • **
  • Posts: 73
Hi all, I have a question:

 I have a set of event outcomes in fsms that need to happen from when an action occurs. These actions are the result of a player's input. So its possible for the actions to happen within 5-10 seconds, which means events can be sent that often as well.

The outcome fsm's are obtained at runtime, so I'm currently sending global events for them to activate...But would it be more efficient if I stored them in an array in a 'fsm manager' fsm then send an event to the manager which would then explicitly send the corresponding event to the targeted fsm?

TDLR:
Which is more efficient sending global events or sending multiple events directly to fsms?


Cheers,
Josh

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: What's more efficient: Global Event or multiple fsm events???
« Reply #1 on: June 20, 2018, 04:20:00 AM »
Hi.
It really depends on your setup,how many events you need to send, how many fsm you have and so on.

In theory (i think) the Broadcast All will check every fsm.
So lets say you have 100 fsms and you need to trigger 5 fsms, then you approach with a 'fsm manager' might be better.

But i also think its hard to see if there are any performance differences there.


autumnboy

  • Junior Playmaker
  • **
  • Posts: 73
Re: What's more efficient: Global Event or multiple fsm events???
« Reply #2 on: June 20, 2018, 05:32:42 AM »
Hey Djaydino,
Thanks for the reply.

Okay cool, I sort of though broadcast all would have to do something to at least initiate a check to all fsm's so that would make sense.

Cheers,
Josh