What is the best way to create a multi-level game on GD?

Hi, guys! Please don’t laugh on me, I’m a newbie and my question can sound silly to some of yours…

Well, I am about to create a multi-level game, but I’m facing a lot of doubts.

Well… I am willing to do separate levels, each one on it’s proper Scene.

But… can I program something like a “Game Engine” (to manage player movements, score management, power ups, etc) and link it to the separate scenes (to avoid redundance, of course).

And yes, I’m aware of “External Events”, but I really can’t understand how can I use it on my project.

Thank you in advance, and sorry for my broken english!

Take your time to open every examples files provided : i dont remember wich one, but one is using a single empty scene, the game engine is in an external event, and 3 level are available in external layouts. i think it’s one of the platforms games example.

I’m sure it exists, and it’s exactly everything you described as needed.

Of course you can, you have just mentioned External Events, that’s the way to go :slight_smile:

By using external events, you can create all the events you need, and you can simply Link the events in the scenes event list.

To use external events is simple. Just create an external event, name it whatever you want. Normally I name it after what is the purpose of the event, for example player control, weather control, enemies control, vehicle control, pick ups. Normally I put everything in to separated external events to keep it organised. And then you can just simply Link the external event you wish to use in each scene by clicking on the top Add → Link option while the events tab of the scene is selected.

There is multiple ways to make a multi-level game.

  1. The most obvious way is what you have just mentioned, to use separated scenes for each level and simply change the scenes whenever need to.

  2. You can also use External Layouts to make multi-level game. In this case, you need only one scene and you can load in to the scene whatever layout you want. Layout is basically a level design that you can load in to your scene. Personally I don’t like to use external layouts for complete levels because I did experienced all kind of problems. Personally I don’t recommend using it for complete levels, but it is very useful to load static level parts for example a random layout of two boxes in different positions so it can look different each time the player plays.

  3. Finally, if you want, you can save everything in to files and just load everything from files. This is probably the most complicated way. Originally I was doing it to make it possible to move between interiors and exteriors in my game without using tons of scenes and layers and avoid restarting the scene every time I was moving between interiors and exteriors. Scene Stack was not available at the time, and I did needed a save system in my game anyway so I was going this way:
    What I do basically I have created an event that is just write everything in to a file using the storage actions. Position, rotation, animation, variables, layer, scale of every single object in the scene. Everything. So basically, I’m designing the scene in the scene editor, when it done I run preview and I’m just run the event during preview to write everything in to file and after when my game is running I can just simply specify which file I want to load, and that’s it. I’m using a single scene a single layer and tons of files containing the details of different areas and levels of my game.

The benefit of doing this, I can change scene any moment without loosing progress on the previous scene, the downside is, it is a bit complicated and you can do pretty much the same thing using Scene Stack. Though I believe using Scene stack you can save the progress only of the previous scene and only temporary (I could be wrong), my way you can save the progress of all scenes and permanently.

I recommend doing this way mainly if you are about to make an open-world sandbox game, otherwise if you are making a classic linear game where the player progress through levels I think it better if you go with the 1. option and use separated scenes for each level and external events.

Thank you, guys! You’re AWESOME! :smiley:

I love GD community so much because of passionate answers like yours!

And, as always, english isn’t my prime language, so sorry by possible mistakes.