playMaker

Author Topic: Large startup slowdown in editor mode  (Read 4880 times)

turkeypotpie

  • Playmaker Newbie
  • *
  • Posts: 22
Large startup slowdown in editor mode
« on: December 21, 2012, 06:34:33 AM »
If I have 200-300 objects with FSMs, it takes 15-20 secs for my project to start in the editor.  This is with fairly simple FSMs.

Is this normal?  I tried unchecking all PlayMaker options to see if that would help, but it didn't.

Anyone else have this problem?

turkeypotpie

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Large startup slowdown in editor mode
« Reply #1 on: December 29, 2012, 11:04:19 PM »
I'm going to bump this because I see this problem being quite detrimental to what is otherwise a pretty nice product.

... But waiting so long for your game to start could severely hurt your iteration time.  For me, it takes ~15 ms to instantiate an empty FSM when starting my game in the editor.  If your game uses PlayMaker for many objects in the scene, I would consider PlayMaker an extremely risky choice for your project.

 The FSM instantiation time in a build isn't as bad, but could still use improvement.  It's about 1ms for an empty FSM, but can go up to over 10ms if the FSM is complicated.  This could hurt your load times quite badly if there are several FSMs in your scene.

My numbers are on a ~3 year old PC.  Your results may vary ...

FractalCore

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 100
Re: Large startup slowdown in editor mode
« Reply #2 on: December 30, 2012, 06:40:56 AM »
From the sound of it, I had similar problems about a year ago. My project was just a small test level. But I cloned about 20 enemies around that were completely Playmaker driven. Got the same slow down where adding a new state took a second or so. Then clicking any state or clicking to pan around the graph view had the same slight delay. I fixed it by deleting out all the enemies and making a simple spawn box that brought each one in at run time. So shifting the load of Playmaker assets from the scene into prefabs as much as possible might be something to try. If you haven't already.

This probably won't help you much if you have a complex level. But I thought I'd share the pain. Haven't noticed it since then however. But I maybe haven't pushed Playmaker since then either. My computer at the time was a 7 year old Core 2 Duo, my brand new one is LOT quicker. Be nice if Unity was 64bit, I imagine :)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Large startup slowdown in editor mode
« Reply #3 on: December 30, 2012, 10:14:10 AM »
Hi turkeypotpie.

Can you send me your project? I tried making some stress test scenes but didn't  see this level of slowdown.

Also can you submit a bug (PlayMaker > Submit Bug Report) so we can get system info.

Thanks!
Alex

turkeypotpie

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Large startup slowdown in editor mode
« Reply #4 on: December 30, 2012, 01:03:48 PM »
Cool.  Thanks for the response.  I was able to create the slowdown with a simple side project:

1.  Create a cube.
2.  Add 3 empty FSMs
3.  Create a prefab for the new cube thing.
4.  Create 128 instances of the prefab in the scene.
5.  Run scene

It takes about 6 seconds for this to start up in the unity editor, which yields an instantiation time of:
6000 / 128 / 3 = 16 ms

Interestingly, if I remove all the cubes from the scene, but create those 128 instances programmatically, after startup, then it's a lot faster, closer to that of an actual build.

I tried a workaround where I put the FSMs in a separate prefab, and instantiated them as a child of my cube prefab after the program started.  This yielded better startup times, but now it takes a long time to stop my program ... 

As I mentioned before, I tried fiddling around with the PlayMaker options and didn't see too much change in the results, even after turning all the options off.

I've just submitted an empty bug which should give you my system info.

Hope this helps :)


Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Large startup slowdown in editor mode
« Reply #5 on: December 30, 2012, 10:04:12 PM »
So there's definitely something weird going on.

My findings so far:

  • Unity 4 startup slowdown is more than twice Unity 3.4.2
  • The Unity editor will load the stress test scene quickly, but it causes a big slowdown if you press play with it open. E.g., if you make a start scene that just loads the test scene the editor plays quickly.
  • It doesn't seem to matter if the Playmaker editor is open or not.
  • The Unity profiler does not show any info on the startup sequence :(

Anyway, I think I need to ask some Unity guys what's going on here!

Not sure if the startup scene is a useful workaround while I look into this...

Cheers,
Alex



turkeypotpie

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Large startup slowdown in editor mode
« Reply #6 on: December 31, 2012, 12:11:02 AM »
Yeah I'm seeing similar behavior to you:

If I load my test scene from another scene, it runs a lot faster.

Very, very strange. 



Anyway, I don't have a huge number of objects in the scene at the moment, so it's not too bad right now.  But I'm planning on adding quite a few more, so this could certainly get worse in the future.

IFLGameStudio

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Large startup slowdown in editor mode
« Reply #7 on: January 12, 2014, 01:34:26 PM »
I hate to necro this thread, but...

Has this issue been resolved? I'm experiencing a long delay (8-10 seconds) when using Playmaker versus using the script equivalent (<1 second). Searched this forum quite a bit and couldn't find any mention of a resolution other than loading via another scene, as mentioned earlier in this thread.

IFLGameStudio

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Large startup slowdown in editor mode
« Reply #8 on: January 18, 2014, 08:11:35 PM »
bump... would be nice to know I'm doing something wrong or if it's just the way that Playmaker is.

Martin-Vaupell

  • Junior Playmaker
  • **
  • Posts: 70
  • Creating CarbonDiOxide
    • Evisystems
Re: Large startup slowdown in editor mode
« Reply #9 on: January 19, 2014, 09:14:09 AM »

Similar behavior, but i thought it was normal.
After an actual pc build the gameplay itself does not have this delay,
only in the Editor.

Just testet my current open project, the delay there is 8 secs,

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Large startup slowdown in editor mode
« Reply #10 on: January 21, 2014, 07:02:00 AM »
Hi,

 Do you have lots of prefabs in your project?

Bye,

 Jean