Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity Level Streaming

Discussion in 'General Discussion' started by hippocoder, Mar 19, 2014.

  1. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I still am!
     
  2. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,614
    There's a simple way to do that already: Break your scene up into smaller ones and load each of them asynchronously.

    Doing that also gives you control over the order in which the objects get integrated, so that you can make sure that objects which reference other objects in their Awake() and Start() methods only get loaded after the objects that they are referencing.
     
    MadeFromPolygons likes this.
  3. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,509
    How do things go when there are fewer objects in the Scene?

    I'd love for Unity to just make the issue go away, but that number stands out to me as being... rather high, for just a single scene in an additively loaded world.

    I just took a look at a few scenes in a fairly large, and largely unoptimised game I'm working on. The whole loaded world is ~12k to ~20k loaded objects total, with individual scenes up to around 5k. While more objects will be added, by the time we're done I expect those numbers to be a fair bit lower than they are now. In particular, scenes with thousands of GOs are one of our primary optimisation targets precisely because of the large number of objects which can either be a) turned into instanced rendering lists or b) combined.

    Of course, those approaches will work for this game, other approaches would be needed for other projects.

    From memory, a few years ago when I looked into this, the bit which put me off was actually a texture loading hitch? Is that still a thing?
     
  4. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,862
    Also worth wondering whether this performance hiccup is happening in both editor and build. From memory scene loading in editor is a bit slower than a built game.
     
  5. Mariusz-Born7

    Mariusz-Born7

    Joined:
    Sep 4, 2015
    Posts:
    40
    It doesn't matter if 10k game objects is a lot or not. What matters is - the "integrate" part should not be done in one frame. Loading 10k empty cubes without textures, awake and start methods causes hiccup in a final build. In editor it freezes everything for over 1 second.
    On the side, I render over 20k game objects in my HDRP scenes using GPU instancing and material property blocks and I have constant 60FPS. The problem is loading the scenes. I would go the DOTS way, but it is all in preview what I don't like at all.