Best Practices 2021 : Async Load assets from disk at runtime with Asset Manager

Hello,

I’ve been trying to figure out how the asset manager works for a few weeks and wow! this tool is really useful.
But then, most of the answers about asynchronous asset loading at runtime are legacy… and I’d like to know the best way to go about it now in 2021.

Here is my problem in more detail :

I want to use dozens of pictures (jpg/gif/png) at runtime from a random folder (local or distant).

  • Picture are not in Content folder (nor known by the editor)
  • Pictures will be displayed/undisplayed a looot of time during game
  • I don’t want to have all of them always loaded in memory

If I understand well : Asset manager load assets when needed, based on Asset Registry. So is there a way to register my picture as asset at runtime without load it in memory ? ( And then, I consider them as a normal asset and manipulate it with the asset manager juste like every elses assets that i need to asyncLoad/unload )

If it is not possible, what is the best way to handle that kind of async loading from disk at runtime ?

Even if it’s possible, is it the best way to do it ?

(NB : I can use C++ and blueprints)

Thanks

I may be wrong, but I think that it is not a good idea (or even possible) to create a new asset and register it at runtime.

There is a function that can load files as UTexture2D objects at runtime that may help you:

Hope this helps

2 Likes

Oh thx !
I did’nt know this one existed, it’s more simple than all other way I found and I am going to use it, but it’s synchronous.

If anyone knows more about asynch loading at runtime good practices, I am interested.