Forum rules - please read before posting.

AC causes scenes to load incredibly slowly

edited June 2018 in Technical Q&A
This is not a new issue, but after hearing a few complaints about loading time in my recently released game, it has come more to the forefront of my mind. Here's basically the issue:

I create a completely empty scene. I load into that scene from an actionlist in a different scene. The scene loads instantly of course because it's an empty scene.

But now I add AC into the empty scene (be pressing the with folders button). Having done nothing else, now when I go back and change to that scene it can take up to a minute to load it! Although more commonly it's between 7-14 seconds.

I exchanged my menu managers for the demo menu managers: same thing. Takes a crazy amount of time to load into an empty scene that just has the default things AC adds.

Is there a way to fix this?

Comments

  • edited June 2018
    What are your AC and Unity version numbers, and on what platform are you building to?  Is it in builds only, or the Editor as well?  Does anything immediately stick out in the Profiler?

    The "Performance and optimisation" chapter of the Manual covers tips for improving performance - have you been through them?

    Edit: Since you're reporting this occurs with the Demo Managers and a blank scene, does this occur if you do the same thing in a fresh project?  That'll help determine if this is an issue with your specific project or not.
  • edited June 2018
    Unity 2018.1.2f1
    AC 1.62.2

    I am building for computers, Windows and Linux. It doesn't matter if it is set to Windows or Linux, it happens in either case. It happens in builds as well as the editor both.

    In a brand new project using the demo managers, it does not slow down the loading quite as much but it does slow it down considerably to have AC in a scene, from completely instant scene change to about 2 seconds to load.

    I do believe I found the culprit in the Profiler. This is from my main project. Kickstarter OnAwake took over 65 seconds.


  • It's due to the Resources.LoadAll process - which'll increase in duration with the more assets you place in the Resources folder.

    Again, refer to the "Performance and optimisation" chapter of the Manual - in particular #3, which explains how to avoid LoadAll calls.
  • Following that guide in the manual has seemed to have sped it up quite a bit. The holdup now seems to be in MultiSceneChecker. I don't see anything in the manual that talks about this.

    image
  • I can't get any such processes to show on my end.  Again, is this occuring in a fresh project or just your own?

    What is listed in the "Show Related Objects" panel for these processes? (Example)

    The MultiSceneChecker's Start method doesn't directly call anything that relates to the above process - which is a little confusing.  However, we can try to find the true source of the issue by commenting it out selectively.

    If you find the Start method in MultiSceneChecker.cs, you'll find that it's only calling 4 methods:

    UnityVersionHandler.ObjectIsInActiveScene
    SceneSettings.OnStart
    PlayerMovement.OnStart
    MainCamera.OnStart

    Try commenting them out one-by-one, and see which one/combination removes the problem.  AC won't work properly during this time, of course, but it should get us a bit closer to the source.
  • Ok apparently it didn't like the fact that I only had a new empty prefab in my SaveableData/Prefabs folder so it was still calling a LoadAll in LevelStorage.cs.

    I put another prefab in there that actually has something in it, and it looks like that has solved the problem.
  • Interesting - by "empty" prefab, you mean just a single Transform component.  How about the other one - what exactly is on it?
  • I mean I just right clicked the folder and chose new->Prefab. It created a prefab called "New Prefab." It doesn't even seem to have a transform component on it, just nothing at all. And the box icon is white instead of blue.

    The other one I put in has a transform, a mesh filter, and a mesh renderer.
  • Hi. I had appeared same issue when I added Speech files in Resource folder. 
    Resources/Speech

    Do I have to create subfolder SaveableData/Audio to solve this problem?
  • Placing speech audio in Resources\SaveableData\Audio dont work
  • As the Manual states, the SaveableData/Audio file excludes speech audio.

    When auto-retrieving speech audio files (in Resources/Speech), the operation is done by exact filename, which is not intensive like the other case above.

    If you want to remove the need for a Resourced.Load call altogether, you can uncheck Auto-name speech audio files? in the Speech Manager and then assign files to lines directly further down.  The audio files can then be placed outside of the Resources directory.

    Try that step, even just to test.  If the problem persists, what is the state of the Profiler?
  • Yes. It works. Thank you!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.