Game Development Asked by Homo Sapiens on December 29, 2021
In the game Limbo for example, the whole 2-3 hours of gameplay takes place in one continuous world. The player navigates from one area to another seamlessly, with no obvious loading or transitions.
It looks like the whole game world (ie. all the ground sprites and every puzzle) is always active on and off camera. Is that feasible?
How can I make a large world like this without overwhelming the player’s device with all the content that needs to be loaded?
Modern hardware is powerful and platformers are often pretty lightweight, so keeping the whole game world for a 2-3 hour game in one single scene might not be as infeasible as it might seem. So I would recommend you to just start building your game in one scene until you actually notice problems with low framerate or excessive RAM use... or if you have multiple level designers and need to enable them to work on different parts of the game world in parallel.
When you actually do have the problem, then there are a couple things you can do:
LoadSceneMode.Additive
(as in the answer by Xamtouo)Answered by Philipp on December 29, 2021
Well, basic setup of desired configuration can be achieved quite easily in Unity.
SceneManager
class has nice methods: LoadSceneAsync and UnloadSceneAsync. They are loading/unloading scenes in the background and provide convenient callbacks when scene loading is complete; you can initialize more than one scene like this:
SceneManager.LoadSceneAsync("DesiredSceneName", LoadSceneMode.Additive);
This way already loaded scene stays untouched and the second scene is loaded in additive mode. If there are more than one scene initialized, all GameObjects from all scenes are displayed. You have options to Merge Scenes or to Move GameObject from one Scene to another. DontDestroyOnLoad is also nice for objects continuously traveling between scenes.
So the game world is split into different scenes, which are loaded in background and seamlessly linked together. How to arrange scenes loading/unloading is up to you:
Another important note is that additive scenes might overlap each other, so you'll need to offset objects on each scene or write a script which places scene gameobjects in required location.
(For example, there is popular trick: move all UI to separate scene in additive mode to keep other scenes as clean as possible; UI must not be destroyed when scene is changed after all)
Answered by Xamtos on December 29, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP