Search Unity

Performance issues while decomposing large game object

Discussion in 'Prefabs' started by DougRichardson, Oct 11, 2018.

  1. DougRichardson

    DougRichardson

    Joined:
    Oct 7, 2017
    Posts:
    74
    I'm going through the process of moving some scene objects into a prefab. I started by creating an empty "map" and then dragging all of the level geometry into it, and then dragging that "map" empty to create a prefab.

    I then planned to turn most of the nested game objects into nested prefabs, which is what I'm in the process of doing now.

    The problem I'm facing is that dragging a nested game object out of my "map" prefab is very slow. Each prefab I attempt to create this way takes about 2 minutes.

    I tried to Profile the editor when this happens, but dragging the nested game object into the project hierarchy puts unity into a non responsive state while it's happening, and the profiler doesn't update.

    Any ideas on how to prefabify my objects in a less painful way and/or how to profile the editor in this situation?

    I'm on 2018.3.0b5.
     
  2. I'm just curious: how many GOs embedded into each other? And why is it useful to include all of the level geometry in one prefab? Are you planning to use the entire level multiple times? Or what is your logic behind this move?
     
  3. DougRichardson

    DougRichardson

    Joined:
    Oct 7, 2017
    Posts:
    74
    The idea was to use prefabs like we might have used multi-scenes before: level designer can work in one level using some custom objects and then I could drag and drop the geometry prefab into a different scene.

    That said, I'm really just trying to find efficient ways to use the new prefab system, so if this is a bad idea or there's a better one, I'd love to hear it.
     
  4. DougRichardson

    DougRichardson

    Joined:
    Oct 7, 2017
    Posts:
    74
    Oh, and to answer you other question, I didn't count them but there was a lot. It was a ProBuilder constructed greybox level, so there was a lot of unoptimized meshes and game objects floating around.
     
  5. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    639
    Some optimizations will soon be landing in the beta.

    I have seen people work with prefabs with deep nesting and tons of variants where modifying a leaf prefabs would make the editor unusable for hours .... not good. This been reduced few minutes now, but we are working on making it even faster.

    I don't think any of the optimizations have landed in the beta yet so there is a good change you will experience significant improvements.