Search Unity

Multiple levels for casual games

Discussion in 'Editor & General Support' started by Oghmium, Apr 9, 2019.

?

How do you organize level system in simple games?

  1. Save each level as a scene

    8 vote(s)
    25.0%
  2. Put multiple levels in one scene

    3 vote(s)
    9.4%
  3. Save each level as a prefab

    18 vote(s)
    56.3%
  4. I have my own genious way and want to describe it in comments

    3 vote(s)
    9.4%
  1. Oghmium

    Oghmium

    Joined:
    Mar 24, 2017
    Posts:
    4
    Hi everyone! I want to suggest my approach to multiple level creation for casual games. It works fine if your levels are not very complicated. I am creating this thread because after quick searching in Google I haven't find this approach. It is simple: save each level as a prefab. You won't have to save each level as a scene. Each time you need to load new level, you should destroy the old one (if it exists) and instantiate a new one. So what do you think of it? Maybe you know some other ways to organize level system (except the obvious saving as different scenes)?
     
    hopetolive likes this.
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I think it depends on your game's design. Creating multiple prefabs or multiple scenes for different levels can be problematic when you have common functionality across levels you need to change.

    In general I'm a fan of having a single scene with all common functionality (things like the UI and certain core game systems), and then either instantiating level specific prefabs or additive loading level scenes for the other stuff unique to that level.
     
    hopetolive likes this.
  3. RidgeWare

    RidgeWare

    Joined:
    Apr 12, 2018
    Posts:
    67
    I like the clarity of using separate scenes for different levels (or in my case, dungeon locations).

    Sure, it means effectively duplicating some identical functional Gameobjects from prefabs, but it flows really nicely when mixed in with clear serialization. Plus it's so much easier I find to 'set the scene up' when it's a fresh, new scene - as opposed to one scene + loading assets/instantiating/resetting all sorts of things. I personally find that all a bit messy in comparison (although I'm maybe not looking at it quite as perfectly as I could).

    To be honest, I've often been a bit surprised there isn't more documentation/guidance on this area. I know some say it depends on the circumstances which way is best, but it still feels like a stab in the dark sometimes.

    There's a lot of advice on the individual detailed stuff, but there seems to be a bit of a vacuum from Unity when it comes to how best to approach the broader aspects of multi-scene projects in general. I've looked through all the tutorials, and they're all about functional things.
     
    Last edited: Apr 9, 2019