Hey all, I’m currently looking into the monumental task of building a custom streaming solution that will be intended to break down a streamed level into chunks and load it in over a fixed time supplied by the designer calling the custom streaming method, for example, if I have a section where I know I have 15 seconds before this section has to be loaded in for the user to see, like due to a 15 second cutscene. Then when I start streaming in the level - instead of trying to stream it all in one go and risking hitches during the cutscene, I’ll instead tell my streaming method it has 15 seconds to spread out the load…
But before I go and potentially sink weeks worth of time into understanding how Epic engineered the ULevelStreaming class and trying to build a complex system similar to it, does anyone know of anything similar to this that may already exist?
Before I continue further I just want to point out that the World Partition system already does all the things you mentioned and you might want to check out if that will fit your use case.
Having gotten that out of the way, in case World Partition doesn’t suit your project, you’ll want to have your system do level loading and unloading using ULevelStreaming or a subclass of it, like ULevelStreamingDynamic which can handle loading in multiple instances of a single level.
With it you can tell Unreal to load, unload, show or hide levels. Even our new World Partition system uses this class for loading in and out levels.
It’s quite a simple class and it shouldn’t take weeks to understand it, should take under a day to understand it enough to use it.
If you prefer C++, you can call these functions directly, like via ULevelStreamingDynamic->LoadLevelInstanceBySoftObjectPtr(..)
Or you can go full manual, creating the ULevelStreaming object yourself via NewObject<.. and feeding it into World->AddStreamingLevel(StreamingLevel), and then controlling it’s loading status and visibility with its setter functions like StreamingLevel->SetShouldBeLoaded(true).
Does World Partition allow for specifying an amount of time to gradually stream in a given streamable level? My understanding of World Partition was that it was distance and player view based streaming…
I should clarify - what I’m looking into putting together if it doesn’t already exist, is something similar to the static LoadStreamLevel function, but adding a parameter that enables specifying a time to load the level, e.g. if I know I have 10 seconds to load in a level before making it visible, then instead of loading in all the objects in the level as soon as possible like LoadStreamLevel does - I split them into chunks to be loaded evenly over the 10 second period
The “gradually” is achieved by being distance based. You can also make the cell size smaller if you want to load them in more granularly.
There’s nothing out-of-the box in the engine to get a time based streaming of cells in a World Partitioned map. But there generally hasn’t been a need for it. Perhaps make sure you’re not trying to solve a problem that isn’t a problem to begin with?
In any case, it’s possible to add that functionality yourself manually, using either ULevelStreaming like I mentioned before, or by somehow leveraging the Data Layers of World Partition.
You could even perhaps override some of World Partition’s own classes to add the timing based streaming