playMaker

Author Topic: Your opinion: best practices  (Read 3249 times)

amaranth

  • Full Member
  • ***
  • Posts: 172
Your opinion: best practices
« on: August 03, 2012, 12:55:28 PM »
I'm starting to get quite comfortable with PlayMaker and have found many ways of performing the same action. Now I wonder, which ways work best for optimizing performance.

Here is something I'm wondering about:

Does disabling and enabling a FSM cause a "hiccup" the way adding and removing game objects does?

When an state has nothing in it, is the state ignored, or is it still constantly hit by the game loop?

What would you do if you hypothetically had 1000 FSMs that were called by other FSMs. Would you keep the 1000 FSMs disabled until needed or would you keep all 1000 running and waiting for input? I know this is an extreme case, but I'm curious which would make a smoother gameplay experience. Or maybe there is a simpler way that I'm overlooking?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Your opinion: best practices
« Reply #1 on: August 07, 2012, 10:00:48 AM »
Hi,

 not really done such stress test yet, but I would definitly avoid 1000 fsm on mobile devices... on desktop and web, I would suspect no real issues leaving all fsm enabled. One thing to avoid in your set up is to have the 1000 fsm running something int he game loop, that is all doing something, if they simply wait for an occasional event to occur and react, then fine.

A state with nothing in it will not impact on perfs, at least that's what I experiencing so far. What would impact is a gloal event called during the gameloop. If you have 10 20 100 of them, fine, 1000 would definitly start to be noticeable.

 Physics is likely the area where proper set up would make a huge difference in terms of perfs. for example DO NOT implement a TriggerStay or CollisionStay global events in these 1000's fsm.

 
 What are your 1000 fsm anyway? ennemies?

bye,

 Jean

amaranth

  • Full Member
  • ***
  • Posts: 172
Re: Your opinion: best practices
« Reply #2 on: August 07, 2012, 12:32:03 PM »
Thank you, Jean, this helped a lot!

I definitely won't have 1000 fsms, but I figured with that sort of number, it would be easier to test performance. :-)