Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: MABManZ on February 25, 2012, 12:08:00 AM

Title: Massive performance drop when viewing variables in run-time
Post by: MABManZ on February 25, 2012, 12:08:00 AM
This actually has happened since upgrading to Unity 3.5. Whenever I try to read variables (local or global) during run-time, the game slows to a crawl. Makes de-bugging a real chore...

I'm assuming Playmaker 1.3 is not compatible with Unity 3.4 anymore, as performance in 3.5 is significantly worse across the board (at least on Android). Would like to just go back to Unity 3.4 but I don't think that's an option :(
Title: Re: Massive performance drop when viewing variables in run-time
Post by: Alex Chouls on February 25, 2012, 12:35:11 AM
Playmaker 1.3 is still compatible with 3.4. Didn't want to submit to the asset store with 3.5 until all the kinks have been worked out!

What do you mean by read variables? In the editor? In the unity inspector? Or in scripts?
Title: Re: Massive performance drop when viewing variables in run-time
Post by: MABManZ on February 25, 2012, 01:24:05 AM
The drop is when viewing variables in the Playmaker editor, both the local and global variable window cause a massive slowdown (goes from 60fps to 5fps).

Currently rolling back to Unity 3.4 to see if it helps
Title: Re: Massive performance drop when viewing variables in run-time
Post by: MABManZ on February 25, 2012, 03:03:13 AM
Confirmed this is only a problem on Unity 3.5...rolled back to 3.4.2f3 and everything is fine again (along with better framerate)
Title: Re: Massive performance drop when viewing variables in run-time
Post by: jeanfabre on February 27, 2012, 08:02:57 AM
Hi,

 Try turning Logging off and see if it improves.

 bye,

 Jean
Title: Re: Massive performance drop when viewing variables in run-time
Post by: qholmes on April 05, 2012, 11:50:52 AM
This is the issue that i am having right now.. or similar anyway.. Even having the Global variables tab in my layout even if it is not open kills my performance.. and i mean kills... 1 fps or less.. i can not debug anything like this..

I will try just having a local variable window open..

Hehh yep local variables too.. I am using a simplified layout right now as i need to do some debugging and i was still getting terrible performance and that was when i realized it was the global variables tab just in my layout.. I have it closed and i just opened up the local variables of a FSM and if i switched between Variables and State i could watch my project slow and speed up..

Q
Title: Re: Massive performance drop when viewing variables in run-time
Post by: qholmes on April 05, 2012, 11:55:04 AM
So if i turn off the globals tab then it is pretty good but i can still see a little slow down if i have the PM Editor selected but it is usable.. If i unselect that window then it is way better again..

I have the logging stuff turned off as far as i know..

Q
Title: Re: Massive performance drop when viewing variables in run-time
Post by: MABManZ on April 05, 2012, 02:30:19 PM
Yeah I never really got this fixed, turning off logging did not help.

I can view local variables with no problems using the "inspector" option, but viewing global variables in runtime is still near impossible
Title: Re: Massive performance drop when viewing variables in run-time
Post by: Alex Chouls on May 09, 2012, 12:39:24 PM
Is this any better in 1.3.3?
Title: Re: Massive performance drop when viewing variables in run-time
Post by: Groo Gadgets on June 20, 2012, 02:56:25 AM
Hey guys,

I was suffering from massive slow down in my game thanks to the variables window. The worst thing was I didn't realise it was the variables window so I went ahead and started reconstructing my game project.

I'm running a dual monitor setup and I narrowed the issue down to the global variables window being open on my second monitor. I can confirm that the slowdown persists when I have the variables window docked in my main unity window. One thing I can say though is it seems much slower if i'm viewing an FSM that has a lot of variables.

Alex, are you able to reproduce this slowdown on your machine?

Simon
Title: Re: Massive performance drop when viewing variables in run-time
Post by: balasco on June 22, 2012, 06:45:10 PM
Does any have a fix to this? Just adding a global variable now freezes the editor for about 10 seconds, frustrating when you need to add a couple hundred of them. I'm running the latest builds of unity and playmaker.
Title: Re: Massive performance drop when viewing variables in run-time
Post by: reedomatic on June 22, 2012, 09:32:33 PM
Yeah, I noticed I had slow down in the editor as well, but when I closed down the global variable window, everything seemed to run fine again.
Title: Re: Massive performance drop when viewing variables in run-time
Post by: balasco on June 23, 2012, 12:38:16 PM
Is there any other way of adding globals without having the window open?
Title: Re: Massive performance drop when viewing variables in run-time
Post by: jeanfabre on June 25, 2012, 01:23:39 AM
Hi,

 I don't think so.

how many globals do you have?

Bye,

 Jean
Title: Re: Massive performance drop when viewing variables in run-time
Post by: Red on June 25, 2012, 09:00:19 AM
If this is what i think it is... then i may have a workaround.

i think it's linked to when playmaker is open on the screen... so, if i'm testing a rather hefty game system and have the editor window open, it slows down (since unity has to handle running the game AND running the PM windows.)

one way that i've managed to do a workaround is to put non-playmaker tabs in the windows... so, for the editor i have the native console as well... if it slows down, i switch it to that and that frees up some speed. same with globals... put the particle-effect window on that. i also have the action list share the same space with the inspector (this also helps when i'm testing variables becaus ei can tell them to be visible in the inspector so that i can see what's going on.)

not 100% sure this is what you're facing though... so, if you know your computer's system specs, that could help point you/us in the right direction.
Title: Re: Massive performance drop when viewing variables in run-time
Post by: balasco on June 25, 2012, 11:00:17 AM
Hi,

 I don't think so.

how many globals do you have?

Bye,

 Jean

I have around 128 FSMs calling to each other with around four times that number of globals (and rising). I guess this is giving playmaker a pretty decent workout. Game runs fine though I should add, this isn't a run-time problem for me though, it's just become a general editor performance issue.

If this is what i think it is... then i may have a workaround.

i think it's linked to when playmaker is open on the screen... so, if i'm testing a rather hefty game system and have the editor window open, it slows down (since unity has to handle running the game AND running the PM windows.)

one way that i've managed to do a workaround is to put non-playmaker tabs in the windows... so, for the editor i have the native console as well... if it slows down, i switch it to that and that frees up some speed. same with globals... put the particle-effect window on that. i also have the action list share the same space with the inspector (this also helps when i'm testing variables becaus ei can tell them to be visible in the inspector so that i can see what's going on.)

not 100% sure this is what you're facing though... so, if you know your computer's system specs, that could help point you/us in the right direction.

My specific workaround was to make a 'dummy' scene with just the playmaker gui object and nothing else, that way I can add globals to that scene without any performance hit then return to my main scene to use them.

I'm running an Athlon II 64 x4 gaming rig, so I would't have thought specs would be an issue really. I really appreciate the help though guys, thank you.
Title: Re: Massive performance drop when viewing variables in run-time
Post by: Horror on June 27, 2012, 03:46:05 AM
Well I am kind of glad this is an issue with playMaker and not something that I have done. My project is relatively light weight, so I was beginning to worry I had implemented something really bad into my project.

I'm not sure if this is a related issue, but even when the game isn't running, my Inspector window runs at snail pace when scrolled. The playMaker window itself does not do this, though. Weird.
Title: Re: Massive performance drop when viewing variables in run-time
Post by: Jernau on June 27, 2012, 09:40:05 AM
I'm also having some performance problems within the editor, but in my case it's unlikely to be related to global variables (I only have four).

As my project has grown I've noticed that it takes longer to launch the game within the editor, FSM editing has become slower, and the in-editor game FPS has also dropped significantly (the built version of the game still runs very smoothly). Where the performance problem has become most painful is when editing FSMs: connecting events to states, naming FSMs, renaming variables have all started to slow to a crawl (take more than a second to react to input). Renaming a global event takes more than a minute on my powerful Windows PC (and surprisingly only around thirty seconds on my less powerful MacBook Pro).

In fact, the overall editor performance is significantly worse on my Windows machine than on my MacBook Pro, even though my Windows PC has more powerful hardware. Though I should be clear that the performance is still uncomfortably slow on the MacBook Pro.

One potential issue that I've noticed is that old events that I've renamed are still remembered by playMaker. I changed my event naming scheme a while ago and mass re-named all of my events (around 100) from lower-case to upper-case (and starting using event categories with the "CATEGORY / EVENT" pattern). However, when I try to select a global event for a transition, the old lower-case events also appear in the list, even though they don't appear in the Global Events window.

I've turned off real-time error checking, but it doesn't seem to make a significant difference to editor performance. I haven't played with hiding the various playMaker editor windows, as others in this thread have suggested, I'll give that a go tonight.

The things that might be unusual with my project are: I make heavy use of Prefabs to generate my game (both game-board and game-pieces), and I don't use global variables - instead passing variables between FSMs using Send Event. I also favor FSMs with many small, well named, States that only have a few Actions each - rather than fewer States with more Actions in each.

Each of my game-tile Prefabs has four FSMs (and three more on it's child Trigger), but the full game-board has sixty-six game-tiles. Each of my game-pieces has around twenty FSMs (and perhaps ten more on their various child Triggers), and I have six game-pieces on the game-board. Perhaps playMaker is not designed to cope with that many FSMs running at the same time?

I have scaled down to a "development" game-board with just nineteen game-tiles (still with six game-pieces), but it didn't drastically improve editor performance.

Any ideas how I can increase performance? Do I need to rethink my FSM and State-heavy design approach?
Title: Re: Massive performance drop when viewing variables in run-time
Post by: Horror on June 27, 2012, 09:59:10 AM
I've been adding a lot of extra variables and actions tonight (no extra FSMs) and it definitely feels like it's getting more sluggish than it was before. I'm generating a ragdoll at runtime, so this is requiring quite a few actions to setup.
Title: Re: Massive performance drop when viewing variables in run-time
Post by: Alex Chouls on June 27, 2012, 10:29:36 AM
I would love to get my hands on some of these projects that are slow in the editor. That will really help identify the problems. If you have a project that's slow in the editor and can share it, please email it to me with repro steps (things that are slow in the editor), and I'll investigate. Also file a bug report referencing the project so I can get your system info. Or just include system info in the email (playmaker version, unity version, hardware specs, build platform).

Thanks!
Alex
Title: Re: Massive performance drop when viewing variables in run-time
Post by: Jernau on June 27, 2012, 10:43:44 AM
I would love to get my hands on some of these projects that are slow in the editor. That will really help identify the problems.
That's great! I can zip-up my project and send it to you. Hopefully I'll have time to do it tonight (Central European Time), otherwise it'll be tomorrow.
Title: Re: Massive performance drop when viewing variables in run-time
Post by: Jernau on June 29, 2012, 05:19:25 AM
Alex, I sent you my project via e-mail yesterday, but I forgot to include my system info. I've just submitted a bug report from my MacBook Pro, so you should be able to see my OS X system info from that.

My Windows PC system info is:
playMaker 1.4.2
Unity 3.5.1f2
Intel i7 920 @ 3.5 GHz
6 GB RAM
AMD Radeon 4870
Title: Re: Massive performance drop when viewing variables in run-time
Post by: Alex Chouls on July 02, 2012, 06:44:56 PM
Don't know if this is a factor in this case, but we recently figured out that if the Unity project is in Dropbox it really slows down editing in the Global Variables Window. Maybe there is some file locking fight between Dropbox and Unity when trying to access the PlayMakerGlobals.asset.

Is your project in Dropbox? Or maybe under version control?