How to make separate levels

hello every one,

i am very familiar with another game engine called game maker studio, and i created many things on it,
now i downloaded unreal engine and im starting to get into it, but i have a question regarding creating many levels,

in game maker i made a space shooter game with 10 levels, and the way we do it there,
is creating something called rooms, and basically each room is a level that you put all the level resources inside it,
this is how you separate your game into many levels, and i also have a room for the main menu

but i don’t see something similar in unreal engine, if my game need to have 10 levels for example, how can i separate them?, all i can see is a one sand box world where you can create your level in it,
but what if my game is old style space shooter where you go from one level to another, and other levels might have different themes like, space, jungle, ocean, etc…

There are plenty of ways to do that, including portals which transit player from one room to other and level streaming, which makes it dinamycally changing. All based on your concept.

are you saying all my levels will be created in the same world in separate positions ?

I wouldn’t call that ‘separate positions’…

You’d better check out this documentation:

And this live stream:

man i saw parts of the video you posted, many days ago, they was talking about loading and unloading parts of the level that you are away from or not in your view to reduce memory/cpu usage

what im asking about is something completely different, im asking about if there is a method to make a completely separate levels (game levels)

Yes. Press CTRL+N or File-> New Level. That’s how you create a new level.
You can also travel through different levels using the game logic if you want. If it’s a very big world, maybe you should use level streaming.

The design of the level is all up to you, you can make it a desert or a town if you want. It’s up to your fantasy and of course, the assets you have access to.

thanks for the reply, i see that each level will be a separate file on the hard desk,

i have another question, what if i need to use the same object in many different levels, can i access an object that i used in level 1, and put it in level 2 when level 2 is loaded in the editor ?

what you need to do, is open a project, that project is your persistant level, you can then add existing maps to the persistant level in the levels menu. you can switch levels in and out on the fly either through a menu system or by streaming them in via some kind of trigger. every map in your game should be in your persistant level, just remember ( cause i forget all the time ) that you need to make whichever level your editing the current level, otherwise things get tricky, it’s a good idea to hide levels your not working on so you don’t get confused why there’s a garbage bag in your space ship environment :).

im still in the learning process, but reading this i see there is something that doesn’t make sense, you are suggesting to create all the levels in the same space ? and then hiding and unhiding them ? that doesn’t make sense,
i should be able to make a different world for each level, and still be able to move objects and variables from one level to the another, i just don’t get it, how can you design a level on top of another one or even beside it,
that both of the levels exist in the same world ?, like if i want to amend level 2 for example, then im doomed to load level 1, level 3, level4 …etc in the editor with it ?

you can read up on level streaming in the unreal engine documents online… just google unreal docs level streaming… but basically consider the persistant level as you overworld! all levels get added to the persistant level… then you stream in the level or unload the level from memory when you are switching levels. it’s done this way to improve performance… ok think of this… you have a corridor and a room, they are two separate levels in your persistant level… at begin play of your persistant level you load in the corridor by calling load stream level in your blueprint. you walk to the end of the corridor, there is a right turn, before you reach the right turn there is a trigger box, in your level blueprint you have an on actor overlap event, you call load stream level and load in the room, you walk around the corner and the room is there, you walk into the room enter another trigger box, and call unload stream level and unload your corridor… i hope this explanation helps…

hi fellow gml user lol i found that there was very little you can take from gml into unreal .It Really annoyed me at first i could not even define a variable and then when i finaly worked that out gaining access to that variable took me another lifetime … lol however im a pretty slow learner so maybe you will have more look than i didmy advice would be try to forget about gml all together whilst working in unreal as the parallels are few and far between … Good luck

I know it can be confusing because there are many different ways of doing things.

If I understand you correctly, you want to create different levels (worlds) and then move between them while retaining properties from level to level.

So for example, you have 2 levels and when moving from Level 1 to Level 2, you want to retain your Player Stats (say coins collected, lives, etc). Another example is object states (like if you open a door it should remain open). All these things can be done, but UE4 doesnt do this automatically.

Each level creates its own instances of the classes (actors). So you must save this information between levels yourself.

The Game Instance Blueprint retains all its variables during the game session no matter the level.

So here’s an example:

You are in Level 1 and collected 50 coins. You cleared the level and now load level 2.

Create a variable called Coins of type Integer in your Game Instance.

Before you exit the level you want to save the 50 coins in your Game Instance - Cast to your Game Instance and SET that variable with the number of coins.
Load Level 2 (Open Level node)
On Begin Play cast to Game Instance and GET the value of variable Coins and SET your Player variable to this value.

It sounds more complicated than it really is. The basic idea is that you want to save the variables in your Game Instance to preserve them between levels.

Hope this helps!

i didn’t get into the programing aspect yet, im still trying to understand the pipeline, how to use the program in general,
i’m from a designing background, and when i started creating games i just learned the programming things that i needed as i went through…

and gml was very easy, it made so much sense

thanks for the reply, but is this the normal way of doing things, or you are trying to solve my problem in a weird way, because i want to understand how the program is meant to work

Sorry for the late reply.
CoquiGames is correct, you should use the Game Instance Blueprint, although I think (I’m not sure about this) it might also work with the Game Mode or the Game State BP but I’m not sure.
If you want info on how the Game Instance BP works, I think this video explains it

But if you want to use Game Mode and/or the game state then I will quote a EniGmaa

For a more detailed explanation you can read Rama’s reply

Its the “usual” way of doing things. If you have separate levels and want to share information between them Game Instance is where to store them.

If you have a massive world (say an entire city with buildings you can walk into) then using Level Streaming is better because you can have a persistent world with parts being loaded / unloaded as needed (think a city like in GTA).

Im using the Game Instance in my current project because I have distinct levels.

If you make blueprints for the objects you can put them in any level. If you need a certain blueprint placed in a level with certain parameters already set you can select it in level 1, ctrl+c, open level 2 and paste with ctrl+v.

Is there a video or document that explains this a little bit better?