VR Loading Screen

Hi all!

I’m working on a large VR project in UE4 at the moment and hitting huge brick walls when trying to implement a loading screen between the game’s chapters.

What we need to happen:

  1. Fades the screen down
  2. Loads up (or teleports the player) to a “loading room” with some 3D text and a few 3D planes (with some nice artwork on) for the player to look at while the game loads.
  3. Fades out when loading is done and starts the new level once the fade is done.

I’ve been trying various ways of loading up new levels in code and Blueprint, but never getting anywhere.
My main issue is that UGameplayStatics::OpenLevel entirely blocks the game, meaning that any VR headset movement is frozen until the next level is fully loaded.
Has anyone had any luck with making a smooth loading screen in VR? Or what solutions have people been using instead?

Thanks!

You would probably have to do some clever stuff with level streaming to accomplish that.

My idea would be to fade to black - then trigger load - that way nothing is frozen on screen.

This may not work so well for long loading times - but I haven’t had any level transitions more than a few seconds long.

I’ve found the simplest solution is that cheat exactly. Fade into black before loading your next level, and have it fade in from black. So while things are frozen you don’t notice that it’s not tracking your head.

Have you looked at the level streaming examples?

Regardless I would just lay them out side by side. Then fade to black then transport the user.

Epic pretty much did this with their Crescent Bay demo, so it is possible :slight_smile: You got a spinning UE logo while waiting for the level to load.

That’s interesting. Do we know is that was made by Epic or Oculus? Would be great to know how they put it together :slight_smile:

I would presume that it uses a mix of level streaming and standard loading. Stream the “Loading screen”, which is a level in itself, albeit, a very simple one, during the game load event. As that level would always be sitting in memory, you can access it almost instantly. So:

Game Starts
Loading scene is loaded into memory
Player is teleported to loading scene
Level 1 is loaded, player teleported to level 1 with a fast cross-fade
When level 1 is finished, the player is teleported to loading scene with fast cross-fade
Level 1 is unloaded from memory, Level 2 is loaded, player is teleported to level 2 with cross-fade.

That would make the best sense to me. The cross-fades are really only in there so the “instant teleport” isn’t as jarring as it would be otherwise.

Epic did this scene yes, and they had a talk about it and UE4 Rift integration at Oculus Connect. Slides are available online:

https://de45xmedrsdbp.cloudfront.net/Resources/files/UE4-Integration-and-Demos_OC-100270768.pptx

Holy beefcakes Batman, thanks for the powerpoint link SiggiG! This is a huge “must read”.

Dear Epic, please make this a mandatory read/sticky in the VR development sub-forum. KKTHNX!

The video of the Epic talk (as well as all Oculus Connect talks) is now online!

agreed, was a very interesting and informative powerpoint, can’t say that very often heh

I’ve had some interesting investigations with something called a “Transition Map” with seamless travel.

This requires code as none of these variables or functions are exposed to Blueprint (because it’s completely undocumented?), but here goes.

In a custom CPP GameMode constructor, set the bUseSeamlessTravel variable to true.


this->bUseSeamlessTravel = true;

Now you can set a transition map in the project settings in UE4 (click the advanced arrow). Here you choose a light map that will have the 3D loading screen in it.

At the moment my editor crashes whenever I try to do a seamless travel (have asked on UE4 Answers, no reply). So, I’m currently doing this (where Level is an FString):



if (!GEngine->IsEditor())
{
	// just doesn't work in editor. Crashy crashy.
	GetWorld()->SeamlessTravel(Level);
}
else
{
	UGameplayStatics::OpenLevel(GetWorld(), FName(*Level));
}


I have a button in my game for testing that is hooked up to a Blueprint Macro that fades down my level, waits for the fade to finish, then calls the above CPP to jump to the transition map.

The transition map runs smoothly for a little while, then hangs/lags horribly and eventually jump-cuts to the new level when ready (where I fade back in).

It’s not perfect (loading is super-jumpy, which hopefully will be improved with 4.6 and async loading???), but it kind of works? It could be that this feature is being used completely incorrectly. Would really appreciate any further thoughts on this usage or if anyone from Epic has any comments on usage on transition maps (since I can’t find any examples or docs)?

Thanks!

Has anyone been able to solve this yet?

+1

I’m testing Transition Map, the behavior is just like Cube said:
Instant jumping into Transition Map, then waiting for destination map loading, then screen hangs for a while, then instant jumping into destination map.
The problems are the screen hang and the second instant jumping.
The first instant jumping can be fixed by a fade in triggering by Transition Map’s BeginPlay(), but not the second, since there’s no obvious event to implement right before screen hang.

The desired behavior should be a smooth fade out when destination map is loaded, while Transition Map is also smoothly rendering.
And the screen could hang now since everthing is black, in the meantime player is jumping into the destination map.

I’ve traced some source code and thinking UEngine::BlockTillLevelStreamingCompleted and GEngine->BeginStreamingPauseDelegate->Execute might be clues but not sure.
Any help would be appreciate.

I’ve been unable to remove all screen hanging when loading/streaming maps, so we’ve abandoned that and are looking into something else using the VR layers feature coming in 4.11.

Hi SiggiG:

Did you mean the hanging still occurs with level streaming? Is the hanging occurring during the loading or begin/ending of the loading?
As my experience there’s tiny hanging during the loading with shipping build game, and I’m ok with that, even though it’s not supposed to happen.

As the layer, are you referring to stereo layer? If that could be a method to make smooth loading screen then it’s great news! though I haven’t see any detail of that.

We don’t want any hanging/freezing screens at all, and our levels are quite big so probably longer for us.

Yeah the layers has been in the Oculus SDK for a long time now, only being supported in UE in 4.11 under the StereoLayers yeah.

Ok SiggiG, thanks for sharing!