Video yükleniyor...
Video Yüklenemedi
Any unreal dev know how to fix the level streaming hitch? Tried merging and used packed level actors on some of my static meshes. It's been happening on all of my levels on load. Seems like the rendering thread is running high.
27,833 görüntüleme • 6 ay önce •via X (Twitter)
43 Yorum

Seems like the hitch went away. Thanks everyone! I ended up changing the Engine -> StreamingSettings to really low values. The sublevel loads slower, but doesn't hitch anymore. For anyone curious: (thanks to @Keytotruth)

Async load but doing it several chunks away, and then just toggle level visibility

will try this. thanks!

Of course!

you can stream levels without making them visible to have them in memory a little bit early, and then set them to be visible if you're using classic UE streaming.

@MattGameDev36 Ah cool. will try this. thanks.

There are ways to spread the level streaming load across more time in the project settings. Also, use ISMs whenever possible.

tried s.AsyncLoadingTimeLimit and s.LevelStreamingActorsUpdateTimeLimit. Doesn't seem to have any effect. thanks though.

Yeah, those aren't the ones I meant. I mean the ones in the project settings. Specially, Async Loading Time Limit and Priority Async Loading Extra Time. Reduce those and it should heavily restrict the amount of ms spent doing the level streaming. Play around with the rest as well

Tried these last night. Did extreme values (1, 100) and the hitch still happens. I only tested in PIE though. I can probably try it again.

That's an incorrect value change for those parameters. Think that that's ms per tick. The values should be way below 1 if you want it to be spread over more frames. So, on the first tick of loading, if you set it to 2ms. If the load takes 15 ticks, that's a 30ms spike minimum.

I think this worked! I'm still playing around with it, but I did set it to 0.2 and the other values to really low numbers. It loaded slower, but theres no hitch (so far) on packaged.

Awesome! Glad it worked. As long as you set up the volumes far away enough to give it room to load, I don't think you should have a problem.😁

hmm... theres still a hitch sometimes for some reason. It might be something else, but this is a good start. I wanted it to load slower and more spread out. Tyty!

Not a pro here, but I assume the net load of the sections is to high. Would recommend to try a load hierarchy so first the level, then the object and then the rest loads in. Maybe also check how your mats are setup. If you have objects using the same mats you should check for complexity and if mat inst are used. Also check how many objects are loaded in at the same time and if your code demands direct load over a dynamic load. That’s where I would start.

I can probably trim down my static meshes some more. My materials are pretty simple for environments. Though I have a lot of props scattered throughout.

Check asset insights

Seems to be rendering thread. Lots of InitRHIs

Ah right. Viewing unreal debug ui via Twitter compressed video on mobile is many levels of oof

I have a feeling you are hitting a shader compilation / permutation hitch - Lots of material parameters? Testing a streaming level with only pre-loaded materials may be worthwhile to know if this is it. 5.6 and 5.7 have asset streaming improvements also.

I'm still stuck on 5.4, but thanks. I was able to fix it by tweaking some settings.

It's tedious, but have you tried partial loading assets from the level? Separate out various assets to see if the hitching is being impacted by a specific asset / material / texture? It's more of a brute-force method.

Tried, but its so hard and inconsistent in PIE. I deleted all geometry + props. Hitch stops. I did undo to bring them back, hitch is gone. Restart editor hitch is back.

Have to exported the game as a shipped build, and tried to run outside the editor? So, don’t run as a simulated, but actually export (with debug tools) and run it. Sometimes the engine itself will cause hitching, when the game is actually fine on its own.

Could be running out of texture streaming memory looking at your profiling stats. Maybe try increasing the pool size before loading the sub level with a console command? r.Streaming.PoolSize 3000

Just tried. Seems to be happening still. Thanks though.

Not sure if it's related but Squad devs avoided traversal hitching by loading entire map in RAM or you could try looking into using FastGeo plugin that got merged in UE 5.7

Ah yeah. I think my problem was loading my levels too fast it stutters. Also I'm stuck in 5.4 lol. Thanks though

There are two in-depth articles covering this kind of stuff:

It's been a bit since I've opened Unreal and dealt with level streaming, but if I remember correctly it was because I wasn't using async loading for the level.

Ah thanks. I'm using blueprints for LoadStreamLevel (by Name). ShouldBlockonLoad = false and MakeVisibleAfterLoad = true.

Two things: Don't profile in PIE. Make a development build of the game. And profile there. And MakeVisibleAfterLoad can still cause an issue IIRC. I would check if the spike goes away when turning it off. If it does, it means something in the level is causing a blocking op when visible.

Ah yeah thanks. I'm profiling on packaged dev. Maybe its the visibility yeah.

Lame. This is actually one of the reasons I stopped using Unreal. I spent more time figuring out why things weren’t working than actually working on my game :(

If you're comfortable with source, you could optimize a bit by implementing optimizations to loading? A form of culling to cell loads not in LoS (when you're in this tunnel, you don't really need upper or lower levels?). I see you have "add to world" hitches. Instead of loading the full mesh at spawn, use a simplified LOD or pre-baked proxy mesh initially. Load full mesh in background asynchronously over multiple frames. Especially if you creating unique material instances per actor. Batch them or use parameter collections instead. Most hitches come from heavy actors and material setups that are default in engine so they stall actor spawning. Maybe you could work around the loading code that does synchronous material resources and stalls threads until actor spawn. You could make material compilation staggered across multiple frames using async tasks. Load mesh assets before spawning, especially simplified meshes. Spawn actor with simplified mesh + placeholder materials and then you're free to load full mesh + compile final materials over next 100-500ms in async. It'll soften your per-frame load.

Thanks for the suggestions! I'll try the LOD and materials setups. I will have to look up how to do custom loading code. Cool stuff. I'm still not comfortable with the engine code even though I'm on a modified version.

The video itself got hitches like 3-4 times.

Put <loading> in the middle of the screen and ensure its duration is about two seconds, and Half Life fans will lose their minds.

Looks like a Vsync issue

Can you just load it asynchronous? There are some great videos on “Hitch Hunts” on the UE channel on YouTube.

Just a question from a n00b... Why do you need to stream the level ? Does every section have new assets that can all just be loaded at the beginning? (Not trying to be clever just want to understand - I make pixel art games so they usually load the whole thing on level start)

Try asking Grok and have it comb through the web to see what other devs have done to optimize their games.

Can't really. It's a core problem with the engine


