Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

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

    1 vote(s)
    33.3%
  2. Put multiple levels in one scene

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

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

    1 vote(s)
    33.3%
  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)?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,871
    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.
     
  3. RidgeWare

    RidgeWare

    Joined:
    Apr 12, 2018
    Posts:
    65
    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
    Oghmium and Joe-Censored like this.