Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: amaranth on August 10, 2012, 03:08:38 PM

Title: disabled FSMs causing terrible lag. why?
Post by: amaranth on August 10, 2012, 03:08:38 PM
[UPDATED]

I have 100 inventory slots in a menu.
Each slot is a button with 2 disabled FSMs attached to it.
In total, I have 200 disabled FSMs in the game.
Even though the FSMs are disabled, it causes terrible lag in the game.

A few things I've noticed:
-If game object slot is disabled, lag still persists.
-If FSMs attached to game object are disabled, lag still persists.
-If I remove the FSMs, lag goes away.

So..... is there a way to "hide" a disabled FSM so that it isn't being processed by PlayMaker? Even in disabled status, the FSM appears to still be called by PlayMaker.
Title: Re: performance, visibility, snappy menus > your thoughts
Post by: artician on August 10, 2012, 04:53:31 PM
I have not done what you're trying to do, but if I were to try and help my first question would be: what are you using for your GUI?  Built in Unity GUI?  NGUI?
Title: Re: performance, visibility, snappy menus > your thoughts
Post by: amaranth on August 10, 2012, 05:15:41 PM
NGUI
Title: Re: performance, visibility, snappy menus > your thoughts
Post by: artician on August 10, 2012, 05:36:18 PM
Have you tried the Set Camera Culling Mask action?  That, or disabling your GUI camera, but those also might not disable the GUI collision detection, which means you could potentially end up clicking on GUI widgets that are invisible to you. 

Let me know your results.
Title: Re: performance, visibility, snappy menus > your thoughts
Post by: amaranth on August 10, 2012, 07:04:23 PM
Yeah, already tried that. It cuts down draw calls which is great. I think I found the issue, and it's not what I originally thought it was.

Here's my new mystery:

So, it seems that even though an FSM is disabled, something somewhere is always calling it.
Title: Re: disabled FSMs causing terrible lag. why?
Post by: amaranth on August 11, 2012, 11:38:44 PM
Update! I discovered the lag only occurs when the PlayMaker editor window is open. If I switch to another tab that hides the window, the problem goes away.
Title: Re: disabled FSMs causing terrible lag. why?
Post by: artician on August 11, 2012, 11:41:51 PM
I definitely get horrible lag any time I am running the game with the FSM editor window open, or even just using the Unity with FSMs in the scene, and having the editor window open, sometimes performance gets super-crappy.

In your case however I had the impression that this was occuring in your builds as well.  No?

I'm glad it sounds like things are working out for you at least!
Title: Re: disabled FSMs causing terrible lag. why?
Post by: amaranth on August 12, 2012, 12:29:35 AM
I've only been recently testing in the game editor and was freaking out. I sent a bug report to Alex. If you've got the problem too, I would probably let him know. The more info he has, the easier it will be for him to track down the leak. (I think it must be a leak... or something crazy hogging memory!)