However, perhaps I’m not fully understanding the usage of it, as when I tried it out by following the Step by Step Example #2: Integration in existing content, any actors which I spawn in a loaded level (using the standard Spawn Actor From Class node within that loaded level) still exist when that level is then closed (they persist from the previously loaded level in all other levels, including the loading screen, after closing the loaded level). From what I can tell, any actors which were added to the loaded level in the editor itself, rather than being dynamically spawned at runtime, do get cleaned up correctly between level loads.
I did try to use the LSS Add Level nodes in my Root persistant’s Level Blueprint with the Persistant flag unchecked (rather than via adding them directly to the BP LSS Actor’s “List of Levels” as shown in the aforementioned documentation steps) and then to switch levels, I used the LSS Load Level EX with the Close Other Levels and Close All Other Levels flags checked in an attempt to work around this, but I still have the same problem. Any help with this would be much appreciated…
As a side note, does manually adding the levels to the BP LSS Actor’s “List of Levels” via the editor rather than via blueprint nodes default to setting the Persistant flag on those levels to true or false? Likewise, does the standard LSS Load Level node close all other levels by default?
By default “Spawn Actor From Class” will place the new actor in the persistent level. Thus it will not be affected by the loading state of any sublevels.
Notice, that the node has an “Owner” input - if connected to any Actor placed in a sublevel, the spawned Actor will also belong to that sublevel and would be unloaded with that level.
It works similar to placing Actors in the editor and changing the current level (highlighted in the “Levels” window) from the persistent level to a sublevel.
Note, that the Actor will be gone if the level is unloaded and loaded again (Actor would have to be spawned once more).
True for the Loading Screen Scene
False for Levels
Persistent in this case means, the level is set to hidden (bShouldBeVisible=false), but not unloaded (bShouldBeLoaded=true).
The “LSS Open Level” calls “LSS Open Level Ex” with “Close Other Levels=true” and “Close All Levels=false” (i.e. All except this level if it is already open).
“LSS Load Levels” however is a newer node, that accepts “Map Settings” assets as parameter rather than the level name (Map Settings are config files for levels, which override all settings in the LSS Actor).
I understand that having “LSS Open Level” and “LSS Load Level” is not ideal naming (unfortunately, nodes with different parameters can’t share the same name) and having several systems can be confusing - these two methods will be streamlined in version 2.0 with a much more convenient set of nodes (and references to choose files instead of copying level names).
Baked Lightmaps yes.
Volumetric Lightmaps, according to the Unreal documentation currently aren’t working with level streaming.
If that hasn’t changed, then those would not work.
Wow, thanks for the quick reply and great explanation! I didn’t realise the ‘Owner’ on ‘Spawn Actor from Class’ was so important! Hooking that up correctly has resolved my problem.
The BP_LSS_Actor appears to be changing my maps Game Mode to ‘GameModeBase’ which prevents my map from properly loading.
I have followed all the steps in the video and everything works fine, until it starts to load the actual game map. Instead of running my custom game mode it runs GameModeBase. Did I miss something?
It appears that what is happening, is that the default game mode defined in Project Settings>Maps&Modes overwrites the GameMode specified in the World Settings> GameModeOverride for the loaded level when using the LSS. If I load the level without the LSS, the correct game mode is applied. I am assuming this is not the intended behaviour?
In Unreal, a single Game Mode is active at any given time.
It is set by the “GameModeOverride” of the persistent level (also referred to as “Root” level) or by Project Settings, if no override is set.
GameMode can only be switched when the current persistent level is closed and a new persistent level is opened (usually with the “Open Level” node).
GameMode will not be applied by the GameModeOverride of a sublevel.
LSS performs level transitions by streaming sublevels into the root level, it does not close the current persistent level at any time, thus the GameMode remains unchanged.
In your case, the GameModeOverride of your actual game level is ignored, because it is a sublevel.
Your root level has no GameModeOverride, therefore the Default Game Mode in Project Settings applies.
I have published a new series of video tutorials yesterday.
Part 3 will show you how to use LSS if your levels need different GameModes.
Keep in mind though, that by default, the game will spawn the “Default Pawn Class” (set in the GameMode) when the root level loads.
When using LSS, we don’t want to load a pawn in the root level at all, therefore we set “Start Players As Spectators” and “Delayed” start in Game Mode.
Otherwise your game would spawn the pawn in the empty root level, before the game level (sublevel) has been loaded.
Your pawn would then potentially fall into empty space.
Part 2 will show how to manage the Pawn Class of sublevels without relying on the GameMode at all (it is recommended, that you watch all 3 videos in order).
Hi,
I have constant crash with my project for android, when the root level is loaded. I never tested it with an example project. Do i have to enable some other unreal engine plugin? Anyway, i am more interested in actual game loading progress. For example, instead of Launch Screen for app, to have screen with progress bar for game loading. Is this possible? Any thoughts about this.
Thanks.
When the crash occurs, do you have the Loading Progress code plugin installed and has it been compiled for Android (it is provided as source and initially built for Win64 only, any other platforms need to be compiled individually)? Or does the crash occur with that plugin disabled / not installed?
Aaah, the part with compiling for should be the problem :), my mistake. Just in curiosity, what do you think about game loading? Why i can’t find any solution for tracking game loading progress, not level loading?
I’m not familiar with specifics of development for mobile. If “game loading” refers to the process of downloading the apk to the device then the plugin won’t be of any help. If it means launching the app, then it would depend, whether we are talking about anything happening before or after your game can run its first BeginPlay.
Yes, it’s about launching the app and loading the whole game before start loading the level, or even with the level and as you mentioned before first BeginPlay. I thought the principle should be similar for any game and platform? Something that could track the loading of all engine stuff and game assets to the point, where the game can start.
The way this is accomplished with LSS is, the level your game initially loads, is an empty map with sublevels which are set to be not loaded initially. A packaged game, when launched, at least on a platform such as Windows, should load into the initial map almost instantly as no assets are being loaded.
At that point, the LSS actor placed in that map asynchronously loads the loading screen map, then once that has been displayed, starts loading the game level or levels in the background.
Hi there! Is it possible to keep on screen my loading screen while executing latent actions? At the moment in my case, it switches in the spinning cogs screen…
Yes it is, look for the example level named “Alternate loading order”.
By default, the loading screen is closed before a level is made visible (they basically switch places behind the screen fade), the alternate loading order will make both visible at the same time, allowing the game level to apply latent actions, such as procedural generation, while the loading screen is visible.
While it is just one checkbox on the LSS Actor, the example level will cover some setup ideas and troubleshooting.
Thanks for the explanation. May be i will try what will happen if i disable Launch Screen for and compile the plugin for the progress bar, then build the app and test it.
Thanks for your quick reply. I am not sure what I might be doing wrong, but when I Uncheck the LSS Set Load Order for my BP LSS Actor I get no loading screen at all…
The BP LSS Actor has been placed in my root scene. In the Roots’ level Blueprint I am referencing th LSS Actor and I am then setting the Load Order to false with my LSS Actor as the target…
My loading scene is a simple 2D widget scene
Keep in mind, that changing the values of the LSS Actor from Blueprint will only take effect for a level transition that is initiated afterwards, i.e. if the level transition is performed on start by enabling “Autoplay” in the Actor’s details, that first transition could potentially run before the BeginPlay in the level blueprint fires.
It is also recommended, to use the nodes provided in the LSS Function Library (BP_LSS_FunctionLibrary) instead of changing properties directly in the LSS Actor (both will work, but the library functions include checks such as making sure not to interfere with an ongoing transition if it is in progress).
The node in question would be “LSS Set Load Order” (does not require a reference to the LSS Actor).
Does the 2D Widget show correctly when “Default” is checked for “Set Load Order”?
Could you also try it with a blank / template level - so it can be ruled out that something happening in that destination level is interfering with the Widget (for example a call to “Remove All Widgets”)?
Sorry but I am still confused.
Is there a checkbox for the Load order in the LSS Actor? I cant find one.
Placing the LSS Set Load Order from the LSS Function Library in my Event Begin Play has no effect in both LSS Set Load Order enabled or disabled…
It has no effect, because in your case the transition has probably already been initialized at that point (the node checks for that eventuality and will return false).
There is no checkbox for “Load Order” in the details. You could set “Autoplay” to false, then in your Level Blueprint’s BeginPlay run: “LSS Set Load Order” and right after that call “LSS Open Level” (or “LSS Load Level” if you are using “Map Settings” assets).