Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Making multiple levels for a 2D game

Discussion in 'Editor & General Support' started by APenguin, Aug 7, 2014.

  1. APenguin

    APenguin

    Joined:
    Jan 9, 2014
    Posts:
    12
    In the games industry, how do the developers make multiple levels for a 2D game, for example cut the rope or angry birds.

    I have been wondering this for quite some time and i don't know how this is done in the games industry. I know about making many scenes and having each one as a level, but to me that technique seems like it will take up a lot of memory, especially for a game that will be on the mobile.

    In the games industry is that how it is done? Or is there another technique i don't know about.

    Thanks
    APenguin
     
  2. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Usually you just have one scene for "game" and have custom built level editor to create and save them in custom format. When level is loaded runtime you just create the scene based on data.
     
    APenguin likes this.
  3. APenguin

    APenguin

    Joined:
    Jan 9, 2014
    Posts:
    12
    Using one scene makes a lot of sense :). Are there any level editors which you recommend to use for unity? or in general any recommended level editors? Or do i have to make my own. :) Thanks

    edit: Also just to get myself on a correct understanding. When you say create the scene based on data, do you mean just load the level designed into the scene at runtime?
     
    Last edited: Aug 7, 2014
  4. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Usually the level editor is self made for the game so there is no generic editor unless you want to use Unity itself. Unity itself saves a lot of stuff in scenes but you could create simple scripts to export unity scene as your custom format by looping all the game related objects and storing only the data needed to re-create the level runtime.

    For Angry birds you could check these to get rough idea whats stored for level


    http://www.battlefieldsingleplayer.com/apachethunder/angrybirds/

    http://talk.maemo.org/showthread.php?p=862659
     
  5. APenguin

    APenguin

    Joined:
    Jan 9, 2014
    Posts:
    12
    That first link helped me understand a lot :) I think i could create my own level editor in that sense.

    However i am not entirely clear what you meant by exporting my unity scene as a custom format.

    Do you mean creating a scene using the editor in unity or with my own editor, then exporting or saving that scene as a file which unity reads, such as YAML, then loading that file at runtime. So for example the game would check which level has been chosen, i.e level 57, then load that particular level into the scene.
     
  6. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Well the Unity scene to your custom level format was just example if you don't want to roll out your custom editor but what ever way to create your level files you choose the key thing is to have one "game" scene which you pass the number or filename of you level and then parse on start and create level setup based on it.
     
    APenguin likes this.
  7. APenguin

    APenguin

    Joined:
    Jan 9, 2014
    Posts:
    12
    Thanks. You have really helped :) I will do some more research on how to save a scene as a text file, or YAML file, and then load that file into the scene on start()