[4.5.1 UMG] How Do I make Animated Loading Screen between levels?

Dear Friends at Epic,

How can I make an animated UMG / Slate setup that will display a loading screen similar to the initial loading screen used int he Platformer demo, but have it run and animate between each level?

So to be clear, I do the equivalent of open NewLevel in console

and I would like an animated loading screen to display while the NewLevel is being loaded, where normally all rendering freezes.

Any ideas?

#Thanks!

Rama

Create 2 widgets, main menu and loading screen (check it out here if u wanna know how to create loading screen Kitatus' Free Books, Projects and Tutorials! - Community & Industry Discussion - Unreal Engine Forums)
and then create event with the menu play button “create widget” and connect it with the level u want to open…

and about animated main menu… You can just create it if u have knowledge of C++ and and aswell as using scaleform

I gonna do this soon too, and i’m thinking of doing it with empty level with UMG UI load first then i will stream the rest of level while playing the animation, maybe u can try and let me know ^^

I came to solution that steaming levels are the best and I made persistent level which holds all my global objects and several streaming levels. I load my levels by using LoadStreamLevel() and check if it was loaded in GM’s tick fucntion while making my HUD show loading screen during unloading level and loading another one.

I have PendingAction variable in my GM which I set to EPendingAction::LOADING when I call LoadStreamLevel and check my loading level state in Tick(). If it’s it’s loaded Ichange my variable to EPendingAction::NONE. Also I had several HUD states and one of them is EHUDState::LoadingScreen which I set when my PendingAction shows that loading or unloading process is running.

It may not be suitable for your setup though, I just leave this answer here as one of the possible solutions.

#Epic?

Any reply from Epic on this matter?

I need the UMG animations to continue playing while the new level is being loaded, and I can’t use level streaming as one answer suggested :slight_smile:

So it’s essentially like this

-equivalent of “open levelname” gets called from console

While the new level is being loaded, I’d like to run an animated UMG element.

#:heart:

Rama

TimGS is it possible to do the same thing with Blueprints cause im not good in C++

Make a ‘level’ that contains a UMG canvas with a background of your choice, set the Z very high (so it goes on top of any UI/HUD you might have). Add loading animation or text to make it cool.

When you need to load a new map;

  1. Use “load stream level” and point your ‘loading level’

  2. “unload stream level” the old map.

  3. Use “load stream level” in the next map you want

  4. “unload stream level” the loading level

If you know how to do it , would you mind please make video tutorial fore this case ?
we really need that how to make loading screen .

Hi, I’m very sorry but I’m under serious workload at this moment (we’re in pre-release stage).
Still, I think you don’t need a tutorial, use the “Load stream level” BluePrint node and point it to your map name, it will load the map while your game runs.
In other words if you have a map that loads a UMG widget (the one with the background) it will do that in real time while your real map is still in background.

To unload the other map use the “Unload stream level” node.

I have used streamed levels in the past but not for this purpose so I can’t guarantee 100% that it works but I don’t see why it wouldn’t. We plan to take care of this part in a week or two from now, I will confirm the results here but I’m pretty sure it will work.

I think the trick will be to load first an empty map, and from there stream your first map in, then unstream when you’re done, to then load the next one and so on.

Thanks for taking the time to reply, but I am specifically wanting a solution that does not involve level streaming, as I want to the new level to be the persistent level, not a sublevel.

Thanks though!

Rama

I think we use Persistent levels in our game and have a basic solution. I basically use a BeginLoadingScreen and DrawLoadingScreen and use GetWorld()->ServerTravel(loadThisMap); to load the level.

I run BeginLoadingScreen to setup an image on the screen and any other variables for the loading screen and set a bool for bLoading to be true. I then call the server travel and set a variable in my game instance (persitent across loading levels) to true which tells me I should be drawing the loading screen.

I then Draw the loading screen every frame (animation on this screen) until my game instance variable says false. Seen as I’m using ServerTravel, the game re-initializes and I then set bLoading to false when it post initializes the data. Once I know bLoading is false, I know the game has loaded and can then set my game instance variable (persisted so will still be drawing loading screen at this point) to false, which will then stop drawing the loading screen.

Animation does run slow (especially in the editor) at times on the loading screen, but it seems to work for the most part as you would expect a loading screen.

It may not be the best or correct way to do this, but it works for me.

Yes it is. Everything I’ve described can be implemented in BP.

“I then Draw the loading screen every frame (animation on this screen)”

How are you ticking the loading screen?

When I use “Open LevelName”

All rendering freezes until the new level has started :slight_smile:

Rama

This is possible with Slate, in one of my bug reports I actually show how to do this.

Or you can also check out this post (scroll down to the C++ answer).

GetWorld()->ServerTravel(loadThisMap);

This seems to perform the loading asynchronously and so the game still runs in the background, however FPS/tick time does drop sometimes when loading large levels.

Thanks Dune that was the critical info I did not know, about ServerTravel!

Thanks!

Rama

Thanks!

I made a new BP node so we dont have to store references in Game Instance, which leads to GC issues.

The information you shared with me was extremely helpful, thank you again!

#My UMG Node For Community

#Get All Widgets Of Class

Here’s the BP node I made for community, Get All Widgets of Class, finds any widgets that exist int he game, so you can avoid having to store persistent references to them

This is actually not true. The main thread is blocked while loading using ServerTravel() - just tested again using UE 4.6.1. So the SlateApplication and all UMG widgets are not up updated during that time.

You can use the Movie Player to get Slate Widgets updated during loading, however no UMG widgets. This is done internally by starting a new thread since the main thread is being used for loading.

Marc

Hi Rama
Can you explain how you made this animated loading screen? I don’t get it how ‘GetAllWidgetComponentsOfClass’ are helping with this :confused:

The animation is done inside the widget normally, for example if you use one of the throbbers in the UMG editor.

GetAllWidgetsOfClass is to find the widget after the new level is loaded, so you dont have to store any references to the loading screen in a Game Instance or other persistent class.

:slight_smile:

Rama