Search Unity

Editor Freeze

Discussion in 'Editor & General Support' started by silentslack, Sep 23, 2017.

  1. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    266
    Hi,

    I have been experiencing this issue for quite some time now. The editor will freeze up completely requiring a force close when loading/unloading scenes.

    Observations:
    - More complex scene are more likely to freeze the editor.
    - For some scenes the freeze will not occur every time, for others it happens 99% of the time.
    - It does not freeze or cause any problems in build.

    This is really affecting our productivity as we either have to preload our many scenes in the hierarchy before playing or have to build each time to run a test :(

    Our project is pretty sizeable (50GB). How can we get this solved?

    Thanks, Jake
     
  2. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,897
    The number of GameObjects and Components in a Scene have a significant impact on the time the editor needs to open and save a scene, as well as entering and leaving play-mode.

    I did various tests a while ago, the results can be seen here:
    https://forum.unity.com/threads/5-6...e-of-open-savescene-and-enterplaymode.447500/

    The conclusion is that the Unity editor does not scale with complex scenes. Where "complex" refers to the number of Objects in such scene.

    Unity confirmed the problem, but nothing happened since then:
    https://issuetracker.unity3d.com/issues/non-linear-editor-performance-of-savescene-and-enterplaymode

    While I was trying to find a workaround to manage really complex scenes, I tried to split that scene into several hundreds smaller scenes and load/unload those smaller scenes on demand in the editor.

    This actually did work, but I ran into another issue with Unity. That is the editor does not support async-loading:
    https://issuetracker.unity3d.com/is...-the-loading-scenes-with-a-lot-of-gameobjects

    The result was few milliseconds freezes while navigating the scene view and a new scene needed to be loaded. This caused the scene camera to go completely crazy for example, not usable in production.


    I doubt they're going to fix either of these issues anytime soon, if ever at all.
     
    Last edited: Sep 23, 2017
  3. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    266
    @Peter77 thank you so much for this input into this problem. I have to say this makes me sad :(

    This is causing such a disruption to our development. I've already split my scenes into subscenes (Static, Dynamic, Audio, Lighting etc.) but still I get freezes. It looks like its from the Static scene as we have many foliage assets. From my experience it seems tied to the number of GameObjects you have in the scene.

    Is there any other workarounds you are aware of other than building the project?
     
  4. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,897
    Unfortunately I don't.

    My ultimate conclusion was, after doing all those tests how one can achieve huge worlds, to use an engine that would better fit those requirements.
     
  5. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    266
    I seemed to have solved this by using SceneLoad.LoadScene (rather than async) when running in Editor:

    Code (CSharp):
    1. #if UNITY_EDITOR
    2.                 SceneManager.LoadScene(subScenes[i].GetSubSceneName(), LoadSceneMode.Additive);
    3. #else
    4.                 AsyncOperation aSync = SceneManager.LoadSceneAsync(subScenes[i].GetSubSceneName(), LoadSceneMode.Additive);
    5.                 subSceneLoadOps.Add(aSync);
    6. #endif
     
    WildStyle69 likes this.