Search Unity

Need advice with levels transition in my game

Discussion in '2D' started by NoradZero, Oct 6, 2014.

?

Which solution ?

  1. 1

    0 vote(s)
    0.0%
  2. 2

    0 vote(s)
    0.0%
  3. 3

    2 vote(s)
    100.0%
  1. NoradZero

    NoradZero

    Joined:
    Apr 24, 2014
    Posts:
    95
    Hi,

    I can't decide myself about how to handle the levels in Unity. There seem to have many ways to handle it with pros and cons but i try to avoid choosing the wrong path so i will need some help.

    First, i am coming from some other engine.. what i was doing there is simply loading my levels dynamically from the Tiled editor. (Was parsing the
    Xml and instancing my objects) then when the player move to another level i was keeping specific objects to a custom persistance system and then destroying all
    the objects and the level and loading the next level. The way my game was working would enable me to go back and forth in the levels like in Metroid.

    I want to do something similar in Unity.. but i am exploring if other options are possible because i had to handle all the triggers load manually from another Xml file (since tiled was limited) and this quite a lots of job.

    So what should i do ?

    1- Do like i was doing before.
    2- Put all the levels in the same scene. (There can be more than 100 levels.. so i dunno if this is a good idea)
    3- 1 scene would equal 1 level. (But doing this would require me to have some kind of different kind of logic object loaded in all scene. This would still require me to use a kind of persistance system so objects persist between scenes)

    I wanted to use the 2D toolkit as level editor directly.. using the solution 3. So i would have a ScreenFader object in all my scenes and have a LevelManager object too that would contain a specific level script to handle the logic specific to that level which would inherit from the BaseLevelManager object. This BaseLevelManager would handle all the generic scene logic and both classes could have access to the other managers which are singletons (not seen in the scenes).

    What anyone think about this solution ?

    Thanks for your help!
     
    Last edited: Oct 6, 2014
  2. Limeoats

    Limeoats

    Joined:
    Aug 6, 2014
    Posts:
    104
    I see absolutely no reason why you wouldn't just use the editor in the Scene view in Unity and build your levels that way. Definitely 1 scene = 1 level. It's much cleaner that way, there's no real performance issue with loading scenes, and it just makes much more sense.
     
    BeefSupreme likes this.
  3. BeefSupreme

    BeefSupreme

    Joined:
    Aug 11, 2014
    Posts:
    279
    Doesn't get much more intuitive than that.
     
  4. NoradZero

    NoradZero

    Joined:
    Apr 24, 2014
    Posts:
    95
    Alright then this settle this thread! Will go with solution 3.. with a persistance system. Wait better than supporting an external editor if you ask me since i can handle the triggers in the Unity editor and have way more control on what gonna happen in the levels.

    Thanks you guys! ;)