Pull to refresh

Unity Addressable Asset System

  • What is Addressable Asset System ?

  • Why should we use Addressable Asset System?

  • How can we use it.

What is Addressable Asset System ?

Addressable Asset System provides the robust and simpler system to load the assets by its “address”. Yes, you heard it right it loads the asset by it address and this simple change will make your life so much easier.

By unity definition: “The Addressable Asset System uses asynchronous loading to support loading from any location with any collection of dependencies.”

Why should we use it?

If we you are a unity developer you must be having the idea of loading the asset at the runtime to make your game more dynamic. There are different ways to load the asset at the runtime.

  1. Assigning the reference of the asset in the editor and accessing it inside the script to load

  2. Resouces.Load API

  3. Using Asset Bundles

  4. From StreamingAssets folder

So many ways to do the same thing (I know all these are used in different conditions) it’s very confusing and if you are downloading the content from server using asset bundles for which you have to write the separate code for editor and the device, this is not align with the unity’s core idea of “Write code only once”.

Addressable Asset System is design to save you from all this confusion.

Biggest benefit of using Addressable is “Low Iteration Time” and “Better Memory Management” and “Reducing the initial scene load time”.

Low Iteration Time :

If you don’t use the “Addressable Asset System”, and choose the conventional way of loading the asset through the asssetbundle, first of all you need to write separate code for the editor and the build platform. Debugging this code will be very difficult and you will never be sure about the code that is working on editor will work on your build platform.

Time will further increase if you choose to support multiple build platforms i.e android,iOS and windows(which is very common scenario). Addressable system will streamline the whole process and you will end up writing single set code for all the platform, which will save the lot of production time

Memory Management:

This is best thing about the “Addressable Asset System”, it fixes the lot of memory management related loopholes of unity. Let me share a secret about the way of unity manages the memory. It was a big surprise for me,when I came to know about this loophole. It was like how this could be possible(jaw drop :)). Are you ready for this, too much hype :).

Unity will not release the texture memory of the asset even if the asset has been destroyed. You will be thinking are you serious? yes I am. I totally understand the reason of your frustration :).

Let me elaborate this, suppose you have a shooting game where there are number different enemies and user can kill(destroy) them by shooting bullets towards them. So when you instantiate each enemy using “Instantiate” unity method, unity will load its textures in memory and when you destroyed these enemies using Destroy(this.gameobject), technically unity should release the memory used by these textures, but unity does not release this memory and texture memory will keep on pilling up as you instantiate more enemies. I know you will be thinking about the object pooling, yes you can use object polling. This was just for the example. You can take the example of fireworks particle system. I hope you got the main point.

So Addressable not only load the object effectively it will also release the memory, when not is uses. It is very important if you are creating games for mobile devices.

Reducing the initial scene load time :

You must encountered this, if you have assigned too many references to the script in the editor (e.g array of enemies prefab), the scene will take long time to start, for that you must be showing some loading screen. But if your game is taking too long to load a scene, do you think player will open your game again? Game should be quick to load the scene to provide the good user experience.

Addressable do this very effectively it will not take too long to load the scene and provide the best user experience.

Tags:
Hubs:
You can’t comment this publication because its author is not yet a full member of the community. You will be able to contact the author only after he or she has been invited by someone in the community. Until then, author’s username will be hidden by an alias.