Level Streaming hitching and stuttering

Unreal Engine 5.1.

I have a persistent level with 5 sublevels. I am loading them manually using LoadStreamLevel function, with make visible set to true and block on load set to false. I’ve put a widget with a progress bar on top that I’m updating every tick with delta time. My expectation was that streaming is fully asynchronous and the progress bar will fill up smoothly. However, the result is massive hitches and stuttering, as if the streaming actually blocks main thread quite a bit.

How to achieve smooth asynchronous streaming of sublevels without blocking so that you can play animations/sounds during that time without stuttering?

It should not block the main thread - but if you are reading values on tick you may be blocking the main thread.
Read values aren’t async usually. Since you need an output…

I am not reading anything in tick - the progress bar was just an example animation. There is no interaction in widget with anything streaming related.

Record your game stats and analyze what is happening using the profiling tools.
Its probably the only way to actually see what is causing it.
I’d suggest starting to profile in a small level, and toggling the load of the next level after you already started to record things…

How do you know how much of the level has loaded?

I don’t - the progress bar progressed based on a local variable and delta time. You can ignore the “progress” part - it was just an animation test based on delta time to see whether it’s smooth or not.

1 Like

That makes 0 sense.

Smooth during loading means your game doesnt get stuck or stutter.
If your player and related game events move around fine, even at a slightly higher fps cost during load, that’s all that is expected/guaranteed by async loading.

Its thread blocking vs non thread blocking.

From your description of things above, your thread is being blocked.
If it is, something isn’t right.

1 Like

Well that’s the point.

Forget about the progress bar. Imagine you have persistent level that plays some animation while loading sublevels. I would expect this animation to be smooth. But it isn’t - it’s choppy and it stutters (delta time being way bigger than expected). I don’t understand why, because I was expecting the act of loading sublevels to be fully asynchronous.

1 Like

Same with world partition, very laggy…

What engine version?

And profile your load with profiling tools. Make sure you aren’t overloading things by loading too much (how much is too much depends on end point/target system memory avaliability).
For instance, loading in 4 different foliage actors with their instances will cause a hitch. Loading just one would not.

But also, why is it laggy?
You should really only have a maximum of 4 tiles loaded ever in world composition.
Granted there is no way to pre-cache what you want manually unless you build out your own system (and everyone wishes there were), with only 4 tiles loading and unloading you shouldn’t have issues.

World parition being the “new” thing, and not working, makes a whole lotta sense…
It’s hard to even guess at what could be wrong.
To the point that there is no point? I mean, its not like 5.1 does much of anything to make the engine usable again…

2 Likes