Search Unity

Help Wanted How to load and unload a Openworld Area?

Discussion in 'General Graphics' started by LetmeDwight, Feb 14, 2021.

  1. LetmeDwight

    LetmeDwight

    Joined:
    Apr 9, 2020
    Posts:
    105
    I would like to do an open world where the player can enter certain houses, but can also roam through forests without having to have a black screen and loading bar through a scene change.
    So all things like houses, forests, rivers, lakes should be on the same area in the unity Scene. But so that this doesn't become a performance hell, I already know that it won't be feasible if I don't unload certain areas. e.g. if the player is where, everything should always be visible and loaded within 50 meters. Everything outside of the 50 meters should not be calculated in order to save performance. Is there something you can suggest to me and link from Youtube?
     
  2. ambid17

    ambid17

    Joined:
    Jun 28, 2017
    Posts:
    6
    I believe you're looking for "additive scene loading"
     
  3. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    3,053
    Fibonaccov likes this.
  4. LetmeDwight

    LetmeDwight

    Joined:
    Apr 9, 2020
    Posts:
    105
    Can I also use a on large area of terrain with trees and houses standing on them? And how exactly should scene streaming work? Do I have to create thousands of scenes for every little chunk to be loaded in the world? If so, that doesn't sound easy at all!
     
  5. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    3,053
    There's really no easy way to do what you want.

    With additive scene editing, though, there's really not much difference at all between editing one big scene and editing several smaller scenes that are open at once. The only problem you might have is with large objects, like a terrain, that are larger than a chunk. In that case, you'd either have to divide your terrain up into smaller terrains, or create a system where you have a hierarchy of chunk sizes (where one or two terrains stay loaded, but smaller details page in and out). I don't really use Unity terrains so I've not really had this problem.

    Also, you may have to experiment with your chunk size. You don't want to make your scenes too big, because then they'll take a long time to load, but you don't want to make your scenes too small either, because that situation will present performance problems of it's own. Also, if you have an SSD, your experience will probably be different than some one running your game on an HDD.

    THere are tools like World Streamer on the asset store that will programmatically break-down your large scene in to smaller ones. So that's one possibility.

    Edit: I should mentioned that I haven't actually use World Streamer so this is not a recommendation, necessarily. I'm just pointing out that it does exist. A while back I did read through the manual to see how it worked, though.
     
    Last edited: Feb 17, 2021
    LetmeDwight likes this.
  6. LetmeDwight

    LetmeDwight

    Joined:
    Apr 9, 2020
    Posts:
    105
    My game world should be 4000x2500 meters in total. The terrains with which I fill this out consist of many smaller terrains that are 50 x 100 meters...

    As far as I can, I will try to optimize my game with Unity Jobs when it comes to processing several things at the same time on several CPU cores.
     
unityunity