Search Unity

Multiscene Loading

Discussion in 'FPS.Sample Game' started by yonek_idreams, Oct 25, 2018.

  1. yonek_idreams

    yonek_idreams

    Joined:
    Sep 10, 2014
    Posts:
    26
    Hi guys!

    How come that when I load "Level_01_Main" scene it loads "Level_01_Background" and "Level_01_Gameplay" automagicaly.
    I can't how it is done.
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    AggressiveMastery likes this.
  3. yonek_idreams

    yonek_idreams

    Joined:
    Sep 10, 2014
    Posts:
    26
  4. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    This question and answer is about FPS.Samle. Which loads additive scenes after loading first scene. And he ask how and where they loads, and I answer how (additive loading in SceneManager class) and where (in FPS.Sample code)
     
    Shorely likes this.
  5. AggressiveMastery

    AggressiveMastery

    Joined:
    Nov 19, 2018
    Posts:
    206
    Great detail here! Thank you @eizenhorn

    Additionally, as to WHY we load multiple scenes and not just one scene, from my research, it is to help stream in data instead of having to load large single scenes, as well as to organize your overall game. This is the direction needed, for mobile, but also helps everything games system, as it breaks up large chunks of details into smaller ones. It being YOU, or custom scripts you make/buy.

    So lets take an OPEN WORLD game for example, if you loaded a whole "world" like GTA5 has into a single scene in Unity, it would be huge, take forever to load(I am joking, it would not load*), and be a mess to work with. So you would instead, break GTA5's world down into smaller chunks, that are visible at different times (aka you only need to see the beach, when you are on the beach or can see it, otherwise it does not need to be loaded and so can be its own scene, that is de-spawned/unloaded to save resources.)

    In the CURRENT FPS sample, they took a lighter approach from what I see in their levels, and used 3 scenes to split up background, game-play, and environment for organization reason. Then layered these three scenes together for one level at runtime as Eizenhorn outlines, NO real 'resource saving' in the FPS sample implementation currently, but you can definitely configure it that way. The current FPS sample is built around "Quake I" type levels, which is AS FAR from open world as you can be.

    To change from Quake I levels, to GTA5 Open World levels, you would be best suited to split the open world up into chunks/scenes and stream them in as needed per LOD and POV of the player camera.

    I ran directly into the mutli-scene issue when loading all my assets into a single level, to see them all at once. Well, unity can only support something like 3-4GB per scene... I think due to being a 32bit variable?! Anyway, it is the wrong way to store things with the new sample (pooling, jobs, should be used) but it let me see that limits to a single scene, which definitely let me know that a whole world just wont fit in a single scene. Unless you use very simple models, keeping the size in GB down from the assets.

    Cheers, gl.
    Micah