- Home /
Playable Loading Screen, does it make sense? Advanced loading screen
Hello folks,
I'm about to have a special kind of loading screen, where the Player is loaded into a scene to play around with its character, while some matchmaking instance is searching for other players and resources are being loaded.
That's the concept game design-wise which results in multiple questions...
1. The multiplayer game will switch through several scenes. How can I load all the required resources for those scenes. The scenes are preselected and not randomized. The game picks a couple of scenes from a larger set of scenes (Minigames).
2. Is it a good idea to have a loading screen which needs some scene objects and game logic to load? The loading screen is client side only and has no networking involved. I don't want to end up in a loading screen for the actual loading screen. Any clues how to achieve the desired functionality?
From a technical position, I want to achieve fast transitions between all the screens. Menu -> Loading Screen -> Game 1 -> Game 2 ....
Thanks for the help!
Answer by Namey5 · Oct 05, 2020 at 10:56 PM
The way to approach this is through additive async scene loading. To start off with, you'll want to have your menu and playable load scene both loaded, but the loading game inactive on the menu and vice-versa. From there, once you activate your loading screen you can start an async scene load in the background - if you want a quick transition between all your games you can do a similar thing and load all other scenes additively and activate them as the time comes. The Unity docs for these pages have some good examples on use, and it should be fairly simple to just combine them;
https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.LoadSceneAsync.html
https://docs.unity3d.com/ScriptReference/SceneManagement.LoadSceneMode.Additive.html
https://docs.unity3d.com/ScriptReference/AsyncOperation-allowSceneActivation.html
https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.SetActiveScene.html
You may encounter somewhat intrusive stuttering while the scenes load - that I'm not sure can be worked around, aside from only loading things one at a time.
Answer by Doompy_ · Oct 21, 2020 at 02:52 PM
Thanks for your help! I that's exactly what I was looking for