StaticLoadObject Multiple Objects Gradually?
My team and I are currently loading objects via the StaticLoadObject() function in a similar manner to Rama's method, which can be seen here: https://wiki.unrealengine.com/Dynamic_Load_Object
Unfortunately, we're loading in a massive amount of meshes and materials at once in some cases. Sometimes (though not always) we're bringing this data into the engine from an external server, so preloading the objects isn't going to be feasible.
Is there a more efficient, gradual method of loading that still allows frames to process and other actions to be taken by the user while things load in the background? Perhaps a multithreaded approach? Lastly (and this is a large ask, I know), it would be best if the solution was mobile friendly.
I'm certainly not asking for code...just a nudge in the right direction theory-wise. I'm not sure if UE4 supports loading like this by default or not.
Hey there, while I've not had experience in doing this in UE4, I did have a large project a while back that did exactly this (loading thousands upon thousands of assets in parallel).
I am going to assume that the render thread is being blocked by the object's loading. So yes, you should try asynchronously loading in the objects / assets as it sounds like you are using a blocking loading function (i.e. one that ensures the object is loaded when the function returns, e.g. if you need to use it asap for a effect, or something on demand (ignoring the bad form of this, as it leads to app hangs)).
Here's some good reads to get you going:
Some pseudo of how i did the project that I spoke of earlier:
Use a task factory / worker approach (spawn some threads and give them a handful to work on)
. I don't know what your experience is with parallel programming. If you are relatively new, things to watch out for:
answered Jul 16 '15 at 01:23 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here