Search Unity

Unity can't handle big .scene files so well...

Discussion in 'General Graphics' started by astracat111, May 19, 2019.

  1. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    483
    I think this is a flaw in my own design, I have about 15 scenes in my game, all of which with the exception of a single one are < 30MB big. Then there's this town scene that's 200MB. This is due to grouping of game objects, and setting everything to static, which from what I understand stores the geometry inside of the .scene file itself?

    Unity doesn't seemed designed to handle this big a scene either, as on my Intel 8th Gen, SSD with Nvidia 1050 Ti laptop it takes about 10-20 seconds to load, while the other scenes take less than 2 seconds.

    For larger scenes I'm going to take a shot in the dark and say that streaming game objects in is the best bet? I'm just going to uncombine the game objects and try to make use of more culling instead as a quick solution.
     
  2. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    784
  3. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    483
    @dadude123 not for this to turn into an informercial for ECS or anything but like...

    Doesn't ECS require more complex programming?
     
  4. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    784
    For a real game, yeah definitely.

    Some will say "its so much easier" but that only goes for the most simple example cases (OOP is popular for a very good reason...).

    But the good thing is, you don't have to buy into the dumb "pure ecs" nonsense!
    You don't have to completely reprogram your whole game as entity-component-systems.

    You can get insane speed-ups by converting a few critical things to ecs.

    For example in our game we only converted 3 relatively isolated systems to ECS and got tremendous performance increases. It's awesome! And 99% of the game is still classical GameObjects and MonoBehaviours (since there's no reason to move it to ECS).

    In your case, you'd probably want to take a good look at the ideas of the megacities video I linked.
    Splitting stuff into sub-scenes and agressive lodding (HLOD is a must) will get you very far.


    So yeah, "more complex", sure, but IMHO definitely not prohibitive.
    You can convert the important stuff (the things you know will profit from it) to ECS and reap great benefits.
     
    SugoiDev likes this.
  5. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    483
    @dadude123 So can ECS speed up some Update() methods I've got basically? One of the key parts that's been slowing me down in that my main NPCs have like 5 Update() methods and I've got to look through at what exactly slows them down.
     
  6. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    689
    Sounds like you might need to spend some time with the existing profiling tools. They should be able to pinpoint exactly what function in what file is spending the most time.
     
    xVergilx likes this.
  7. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    1,658
    Always profile first, blame later.

    Depending on the type of bottleneck there's different solutions.