Download

Get a progress value for loadings

Hi,

I saw all the tutorials like https://www.youtube.com/watch?v=6CkR6KG2znM&feature=youtu.be

And all the forums threads are like for 4.4 or 4.8 in the case of the Epic’s tutorial.

But it’s always the same thing, Level Streaming (and still we apparently don’t have a progress value) and faking non-seamless travels with delays .

I need to make the same loading screen as Days Gone https://youtu.be/Hab_ucAHhVc?t=9

And when you see Brackey’s making a progress bar in 10 minutes… with Unity T-T

But the thing is, Unity’s using Async operations, I know there is FStreamableMaanager, but also https://docs.unrealengine.com/en-US/Programming/Assets/AsyncLoading/index.html

But none of them seems to integrate a progress value like Unity or maybe I missed something…

I also saw Axel Riffard’s https://www.youtube.com/watch?v=ON1_dEHoNDg for setting a smooth loading screen.

The thing is to make a side module completely dedicated to loading

It’s already done in the Action RPG sample.

But the thing is it needs to be made with Slate(T-T) because it’s rendered on a different thread than the game thread. Still, it’s just to have a smooth loading screen. I don’t have access to the progress of my actual loading.

I also saw that UMG is now outered the game instance (since 4.5 even if I don’t really know what it means)

[THE FEATURE REQUEST IS HERE]

So basically, is it possible to have access to a progress value just like in Unity AsyncOperation class ? By returning something when we are calling LoadStreamLevel(…) (like the FStreamLevelAction with a progress value inside) or OpenLevel(…).

It could be also a FLatentActionInfo which coulb be ticked during the loading even if the best I think (I’m not an expert far from it) would be to make a FRunnable with a reference to the loading operation where we could access the progress value (concurency dangerous but possible)

Best regards everyone,

Alex

Badass haha ^^

I actually missed something.

And I’ve found a dude making this in a game instance UE4 Loading Screen with Progress · GitHub (havn’t tested it yet)

But still it needs to be done in Slate and it could be great to do it in UMG with all the tools and stuff.

But thanks a lot @Raildex_

why do you need slate to load something?
Slate should be used to display the progress, not controlling the actual loading.

Unfortunately, you won’t ever have such access. Engine doesn’t how long it gonna take. Size of the level file itself is irrelevant, it only holds references to assets. And these assets have references to other assets, you won’t know about it until getting to those asset in the dependency chain. Even if the loading time would depend purely on size of assets, you couldn’t predict loading time. It all depends on the hardware. If game is located on HDD, it also depends on how data is physically distributed.

Additionally loading level isn’t only about loading assets from disk. Actors need to be constructed. Engine can’t predict how long it’s gonna take.

Progress bar on loading screens in games shows loose approximation. That’s why often you “slow progress” up to some arbirtrary value like 60% or 80% and suddenly it speeds up a lot. It’s because map has been loaded at this 60% and developer added some extra time before hiding loading screen (so world can initialize everything what happens on Begin Play which often causes heavy framedrop).

The simplest way to do approximation is to count loaded sublevels.

Hi Doctor Ergot,

It could be great to have a dev from Bend Studio to know how they achieve that ^^ (if they add some fake delays)

Because in Unity it looks pretty accurate for the whole level.

So the solution would be to have one map file for your whole game and switch between stream levels ? In that way, what’s the purpose to have multiple .umaps files inside a project ?

Well that’s strange because the .umap file do have the number of referenced actors, am I right ? You just have to check if they are fully loaded or not.

I’m not a UE master, just asking about how we could improve some features.

It seems I forgot to note that a “true progress bar” would give player precise information on the loading time. Any other solution is a “fake progress bar”. Hence the confusion.

[quote]
Well that’s strange because the .umap file do have the number of referenced actors, am I right ? You just have to check if they are fully loaded or not.

[quote]

Sure, you can do this in editor. Would have to check it if cooked data keeps such information and you can access it prior to loading map. Reference Viewer is editor tool after all.
I will check in spare time, now that I’m curious :wink:

Potential issues.
The asset in map use other assets and you need to go through the entire reference chain in order to get a precise number of files to load.
Still, it gives us only amount of assets to load. And a single asset referenced many times would be counted many times…
And every asset will take a different amount of time to load and initialize.

Perhaps I just over-analyze this? Perhaps the amount of actors in the map is all that we need to achieve an illusion of the “precise progress bar”?

It’s much easier, if game uses only a single level. Unity barely introduced sublevels as an experimental feature. Maybe that’s the case there, just a single level and counting only assets placed in the currently loaded map?

Could be great (in case we are in a single level or even with sublevels we just have to iterate trough GetStreamingLevels() array and get all the actors) to “cast” it to FAssetData and check IsAssetLoaded()

Logically I have my World asset, get access to GetWorld()->PersistentLevel->Actors and only if we could get the FAssetData associated to it :confused: it could be easy.