What is the best way to do an initial loading screen?


I’m having trouble for create an initial loading screen for my project. Without loading screen the project takes a bit for loading on ssd and can take some time if running from hdd, and this causes a black screen after launch the project. So, in order to not have a black screen where can leave people think this freezes or not working on their computer, i decided to have a simple initial loading screen.

What i have done:

  • created a blank map
  • created a blueprint class “HUD”
  • created a blueprint widget
  • change on project settings > default maps (i changed to this blank map)
  • change on project settings > default modes > maps & modes > hud class (used the blueprint hud class)
  • on blueprint widget i have done: event tick > open map (i have chose the map i want to load)
  • on bp class hud i have done: event begin play > create widget (then i select the loading widget i created on step 3) > add to viewport

Well, i’m not sure if i am doing something worng, but after the splash screen goes out the loading screen don’t show up on application frame, it stays a few seconds on a black screen then it loads the “loading screen” where it supose to load just after the splash screen goes out, also the animation icon got stuttering and the last but most important is the game map i set on “open map node” on widget just doesn’t seem to open.

Any clues?

Create your own game instance class and implement the Init event.
That will let you create the loading widget without waiting for a map to load.

To create an animated loading screen, add a throbber, hide it by setting its alpha to zero, then use Event Tick to cycle through the textures you wish to animate.
This is how I created the walking animation for the Ground Branch loading screen without making a new UMG widget in C++.

Thanks Kris! I will see if i can do what you said.

Worked great Kris
the culprit was the need of duplicate my game mode and state it on world overrider of blank level, and put the “open map node” on hud class, with that leaving the widget without any nodes… just the screen and the animated icon material

i made a simple video from the tests
[video]Frazão Archviz loading screen test - YouTube

thank you very much!

The Unreal Action RPG sample has a different and interesting way of doing this involving c++. The “ActionRPGLoadingScreen” code module is loaded in the uproject file - “LoadingPhase”: “PreLoadingScreen”

You can describe in more detail how you made the animation in the loop. And will it work on UE4 20? Thank.

How can I create a multiplayer loading screen (with no lobby) while client joins a server using Join Sessions from Adv Sessions and LAN?
I would like to add somekind of Joinning Server animated screen while clients are joinning the server.

The walking animation is simply a bunch of UMG image widgets hidden in an overlay.
When the loading screen is made, it picks one at random and makes it visible.
As the loading screen ticks, it reduces a simple timer.
When it hits 0, the visibility the current images is changed to hidden and the next child in the overlay is picked and has its visibility to set visible.
If its the last child overlay, it’ll pick the first child.
That’s it - not particularly fancy :slight_smile:

See my solution above.
Create your own game instance, create your loading screen, place it on the screen and keep a reference in your game instance.
Once the loading screen is in place, connect to the server.
Once the client has connected to the server, use the reference kept by the game instance to find and remove the loading screen.
This can be done manually in your player controller, if, for instance, you wish to wait until the player has fully connected and pre-cached anything required by your game.
Or it can be done simply when the map finishes loading by binding something to the movie players “OnMoviePlaybackFinished” delegate.

Not sure if that is exposed to the Blueprint system, but it definitely is in C++.

try taking a look at this plugin https://unrealengine.com/marketplace…ueprint-plugin!

It’s Free and working~

I stuck at about 30 8K HDRI Texture Streaming when runtime startup loading phase.
Thanks to this plugin it solved my problem.

What do you base the loading screen removal on?
meaning, what event or loaded asset chek is used to remove the widget and/or hide the screen?

[USER=“3140864”]MostHost LA[/USER]
All players are placed in an array, which is processed using a simple timer only if play has begun properly.
i.e. GetWorld()->HasBegunPlay() would return true.

The timer checks that a player is valid and has a valid net connection, then checks if the player has completed an initial sync.
When ever this check fails, it uses a client RPC in an attempt to get the player to sync up.

This client function checks to make sure the play has begun, then waits for the player state, game state and game mode classes to all be valid.
Once those criteria are met, its starts loading up various assets and tells the server it is synced up.
All this server function does is to set the initial sync boolean to ‘true’.

Once the initial sync check passes on the server, the game mode figure out where the player should spawn etc and the uses another client RPC to fade out transition/loading screens.
It then removes the player from the waiting list.

If the waiting list is empty, timer is cleared.
If not, it loops around again.

Waiting for GetWorld()->HasBegunPlay() to be true on the server and client helps prevents NetGUID issues, which can happen if actors are spawned too early.
Waiting for the player state, game state and game mode classes to all be valid ensures that anything that requires basic info from them has it immediately without the need for any further delays.

Do you have to have a custom GameInstance to implement the init event? Can’t you use the default GameInstance? I mean all other classes have BeginPlay, to use which you don’t have to extend those classes. Why do we have to do that for GameInstance?

GameInstance is created when the game first loads and is used to load the map, gamemode, local player etc.

Hi, can you clarify somethings?
The “Animated Loading Screen” is this a regular UMG Widget?
In the Init() for GameInstance, does it create the Widget via C++, i.e CreateWidget(…) etc? Anything special? Or is there a means of creating and spawning a widget in the editor so it is always visible?

@Bigodon Any chance can you go over in more detail what you did to create a pre-loading screen? And what you did to solve it?