Question about dynamically loaded assets (SOLVED)

I want to:

  1. Load new assets (image and music files) dynamically from a server while the app is running and permanently store them on the Defold based client

  2. Access those assets programmatically and place them where they belong in the game using code

Can this be done in Defold?

Not yet. You can download and store audio file assets, but you can’t load/play audio files arbitrarily. There’s already a request for this DEF-1967

Defold doesn’t do any special modifications to audio files, there is no processing to them when bundling so that is not an issue.

The way audio works right now is that you associate audio files to sound objects, and then you can have these in your main collection and be loaded as your game first loads, or put them into collections loaded by collection proxies so that they can be loaded async whenever you need those audio files.

As @Pkeod already has explained it is currently not possible to load audio dynamically. You can however load images and display them in gui box nodes. There’s an example of this here: https://github.com/britzl/publicexamples/tree/master/examples/loadtexture

Dynamic loading for gameobject and collection factories added in release 1.2.115

3 Likes