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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Is it possible in Unity to pre-load scenes and assets all in one go?

Discussion in 'Scripting' started by Lethn, Apr 25, 2018.

  1. Lethn

    Lethn

    Joined:
    May 18, 2015
    Posts:
    1,583
    In big games like Ashes of Singularity but even in old ones like Startopia they have this weird thing they're capable of where they seem to load up the entire game right at the beginning and pretty much instantly switch scenes or load up the game. I actually quite like this idea because this means depending on the game if there's a lot of scene switching involved you won't have to sit at loading screens a lot, the downside is that you have to load it all up right at the beginning but on quite powerful computers I imagine it wouldn't be that annoying depending on how big the game is.

    Is this even possible in Unity? Would be nice to have some information on it.
     
  2. Cynikal

    Cynikal

    Joined:
    Oct 29, 2012
    Posts:
    122
    In a lot of bigger games (the ones that atleast posted dev articles), they basically async load the next scene that they predict you're going to use next.

    So, for a level based game, about 3/4 through the level, start to load the next scene. For a MMO of sorts, detect the closest portal, and start to preload that.

    I know with some games, they basically make the mini scenes all in one big scene, and just move the camera around.

    Multiple options to go with, just get creative with it.
     
    angrypenguin likes this.
  3. Lethn

    Lethn

    Joined:
    May 18, 2015
    Posts:
    1,583
    Thanks, that's interesting, yeah with games like Everquest and whatnot or even EVE Online it's fairly obvious what's going on and with MMORPGs generally. back in the day games like Everquest were divided up into 'zones' and I think some online games even put their areas onto different servers entirely so that they can handle lots of players.

    What if though it's something like Planetside 2? Even though you have got stuff like that going on they allow the option of you to travel to any hotspot out there how does that work? Ahh, nevermind I just worked it out myself taking a look at the async documentation.

    https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.LoadSceneAsync.html

    It would just depend on the mouse click, so I'd put an if statement for a button on a map then I would use LoadSceneAsync to bring up the level in question, nice! Thanks for the help, it's interesting with how experienced I've gotten now even after only two years once I look a the documentation after chatting with people it becomes a lot easier to implement a game mechanic I'm thinking of.

    This pretty much gave me and idea on how to implement world maps too.