playMaker

Author Topic: [SOLVED] is "broadcast all" heavy in terms of computation?  (Read 2663 times)

Megisto

  • Playmaker Newbie
  • *
  • Posts: 28
[SOLVED] is "broadcast all" heavy in terms of computation?
« on: April 29, 2012, 02:51:36 PM »
Sorry, i am asking lot of questions in this days, but i have a few time to spend learning playmaker and i want to take advantage :)

I am playing with the managers concept.
My FSM's talks each other using global events and "Send Event" action.
I found comfortable to use "broadcast all" for this purpose.

Now i have a doubt: my managers are stored each one in different empty game objects, parented to the game object who use it.
As "broadcast all" send events to all the FSM in the scene maybe this will be very expensive in terms of computation when i'll have many entitites in my game.

I'd like to know if "broadcast event" is so smart to ignore the FSM who don't share that Global Event or it will check any entities anyway. And in this case how this can be expensive.

The alternative solution would be to send event to a specific object and hits children. Is it possible?
« Last Edit: May 01, 2012, 01:51:03 AM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: is "broadcast all" heavy in terms of computation?
« Reply #1 on: April 30, 2012, 12:51:30 AM »
Broadcast All is more expensive than sending an event to a single FSM, but unless you have a very large number of FSMs in your scene, or are doing it a lot and/or very often (e.g. every frame), it shouldn't be a problem. I would test a typical scenario, maybe doubling the entity count to be safe. Remember to test a release build on the target platform since there is overhead in the editor.

Megisto

  • Playmaker Newbie
  • *
  • Posts: 28
Re: is "broadcast all" heavy in terms of computation?
« Reply #2 on: April 30, 2012, 06:57:31 PM »
Ok, thank you.