How do you organize levels?

Discussion in 'Programming' started by breakmt, Jul 11, 2019 at 9:33 AM.

  1. breakmt

    breakmt Member

    Joined:
    Sep 13, 2016
    Posts:
    168
    Hello, dear game developers! :)
    I think about how to better organize level rooms in Game Maker... I make quest game, but this is not really important. For example, I have room with some controller objects, layers structure etc Now I need to create new level. What to do? Clone previous one and modify it? It seems to be not very good way.

    I thought to use parent-child system, but sadly I found it very buggy and I just afraid to use it :(

    I'm very curious how you do it!
     
  2. Phil Strahl

    Phil Strahl Member

    Joined:
    Jul 3, 2016
    Posts:
    373
    Depends on how many rooms you need. If it's around a dozen, the duplicate-then-modify method would be best because you have a fast turnaround and should something in your code change (it always will), then it's not too time consuming to manually change the affected rooms.

    If you need more (or even much more) rooms, I'd have just one empty room that's already set up in terms of layers and create everything that's inside it from data. This is a lot of work, of course, essentially you'd code your own level editor, then write those levels to JSON files and then have your game interpret it an populate the levels accordingly.
     
  3. breakmt

    breakmt Member

    Joined:
    Sep 13, 2016
    Posts:
    168
    Hi, thanks for answer! I think there will be 20-30 rooms, maybe a little more... To be honest, I decided to try parent-child room system, cause I like OOP organization. One side note - I can't make groups inside parent room (ex. "House" with rooms "Kitchen", "Hall" etc) and there will be just:
    - Level
    -- HouseKitchen
    -- HouseHall
    -- ShopSection1
    -- ShopSection2
    Which is not really great, but I guess I can live with it.
    I really hope that there will be no serious bugs, cause I already found one (not very big one) after using this feature for 2 minutes :( It feels like nobody uses this room parent-child feature.... Why?
     
  4. Phil Strahl

    Phil Strahl Member

    Joined:
    Jul 3, 2016
    Posts:
    373
    Probably because it feels buggy and unpredictable how changes ripple through. At least that's why I stay away from it
     
  5. curato

    curato Member

    Joined:
    Jun 30, 2016
    Posts:
    219
    I usually have a persistent manager object that manages settings and makes sure any gui objects are created and anything else that would consistent between different rooms.
     
    Phil Strahl likes this.
  6. breakmt

    breakmt Member

    Joined:
    Sep 13, 2016
    Posts:
    168
    In that manager object do you also create all layers that you need?
     
  7. curato

    curato Member

    Joined:
    Jun 30, 2016
    Posts:
    219
    I don't, but I guess you could use layer_create to make the layers you want.
     
  8. c023-DeV

    c023-DeV Member

    Joined:
    Nov 23, 2016
    Posts:
    53
    I use the parent-child features but mainly to have the same layer set up in all rooms, works fine for me. If I want to add more layers then I do this in the parent room. I've also added a few objects added to the parent room for organizing additional level setup, backgrounds and FX.

    Also I create additional FX layers via code (layer_create in the level setup object) and also create references to the existing layers to spawn things.
     
    breakmt likes this.
  9. breakmt

    breakmt Member

    Joined:
    Sep 13, 2016
    Posts:
    168
    Yes, but I can't use this layers in room editor...

    I will go the same road. I guess one bug I saw was because I tried to make a room to be child of parent room and some data were mix or something like that...
     
  10. c023-DeV

    c023-DeV Member

    Joined:
    Nov 23, 2016
    Posts:
    53
    Yeah, do some experimenting first to see in what order things work. I played around with a few workflows until I knew what I need and what works for me.
    It takes a bit to get used to but it does work as long as you figured out the dependencies.
     
    breakmt likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice