How to handle levels

Updated on August 20, 2018 in [D] Game Dev. gossip
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on August 15, 2018


I’m making a top-down 2d game in Unity3D for Android-based smartphones. Currently I have two scenes – a preloader and the game itself with all the stuff I need packed into one scene file. Also there is a very simple game-state-manager in my scene and the game objects (prefabs) would be instantiated from level to level based on a random pattern.

My question now is: Is it better to script all the levels within one scene-file or should I seperate them into unique scene-files? I’m just asking because basically the levels are very similar to each one – only the background and the sprites are different. Is there a problem with memory management if I use one scene only?

  • Liked by
1 on August 15, 2018

If your levels are basically the same thing, then it would be fine to keep them as one, and just swap out things like backgrounds via scripts.

Only if functionally the scenes differ (like one has low gravity, or different controls) do you really need to change scenes. That being said though, you could still do it if you find it easier to work with them as separate scenes.

Memory management wouldn’t affect this, unless you have a ton of DontDestroyOnLoad objects that aren’t singletons. Otherwise, nothing (except static values) from one scene would carry over to any other.

on August 20, 2018

Thank you very much for your reply. I think I will use one scene only since I just swap some sprites and backgrounds only.

Show more replies
  • Liked by