Sub level streaming FPS drops
Currently in our project we are using sub level and other asset streaming to reduce the memory usage and initial loading times but whenever streaming is occurring, the FPS drops considerable and causes freezes of up to 2 seconds.
Is streaming not happening on a separate thread? Is there a way to make it more smooth?
asked Sep 12 '18 at 01:51 PM in Using UE4
There are two parts to level streaming, in terms of loading. The first is reading the assets from the disk, and the second is creating the necessary UObjects for the level.
UE4 requires that UObjects and derived classes be created on the Game Thread (there are a number of reasons for this). The main parts of Async Loading that happens in a separate thread is actually reading data from disk.
As long as you have the Async Loading Thread enabled, I/O work will be handled in a separate background thread. However, there's still some amount of work that needs to happen on the GameThread (like creating UObjects). This is in AsyncLoading.cpp, and can be changed as you normally would CVars (including through INI):
There's also a few settings in CoreSettings.cpp:
Second is actually creating the level + objects in game. This does not happen on a separate thread. So, the way level streaming deals with this is by splitting up the Creation and Registration of objects across multiple frames. There are a number of options for this. These options are also CVars that can be set, and there is also a section under property settings which makes editing them easier. These are defined in CoreSettings.cpp:
One thing to point out is that any of the "time" values mentioned above are in milliseconds (I've seen a few licensees assume it was seconds).
Basically, there are a number of different settings associated with level streaming. There's definitely no "one size fits all" adjustment of these settings, so it's up to individual projects to figure out what values work well for them.
One thing you can do to start is enable PERF_TRACK_DETAILED_ASYNC_STATS (which is defined in AsyncLoading.h). This will print out detailed information on how much time each frame was spent on handling Streaming Steps when a world is loaded. From there, you can figure out what you need to adjust in order to get a better framerate. You want to make sure to disable this when not testing, as there are other pieces of code that also use this can it could bloat your logs a bit.
Of course, you'll have to make tradeoffs and find a good balance between total loading time and framerate.
I'd want to reopen this thread because we have been testing out a lot of different parameters and no matter what we do we still have large streaming hitches.
There is one section in particular where we would like to be able to play a full screen movie (in PS4) while a couple of sublevels load in the background. The parameters I modify temporarily so I can control the streaming during the movie are as follows:
I am attaching part of the logs from when I activated DUMPHITCHES right before starting the movie: : /storage/attachments/253475-moviehitches.txt
Is there something I'm not understanding about streaming? Is there anything else I could try out? Someone suggested I could try bPlayersOnly in the UWorld but that will pause the streaming which defeats the purpose of what we are trying to do.
Follow this question
Once you sign in you will be able to subscribe for any updates here