Search Unity

Assetbundles as Addressables

Discussion in 'Addressables' started by madhur, Sep 11, 2019.

  1. madhur

    madhur

    Joined:
    May 16, 2012
    Posts:
    86
    I am working on a project where we create assetbundles of 3D models (.fbx files) dynamically in a server and load them from an app dynamically. For different content in the app we load the relevant assetbundle based on the mapping given in the Database.

    I have come across this new Addressable concept recently.

    1. I want to know whether there will be any advantage of using Addressables to above project vs continue to use create assetbundles/load assetbundles the old way.

    2.If there is any benefit of using Addressables, can we create Addressable assetbundles dynamically through scripts (without any human interaction).

    Looking for your valuable inputs.
    Thank you.
     
  2. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Not much if you already have a well designed system based on asset bundle. The benefits - probably in a few years, the addressables will be dominated (and default) way to handle asset management in Unity.It reduced the fragment of home-made solutions made by each developer.

    Especially for your case, which requires loading existing asset bundle from the system - it is much harder at the moment. You need be an expert of the system to achieve that (custom catalog, custom bundle provider...) Or you can wait until another talent sharing their code snippets.

    In general I suggest you start the system with new project, or in a processive way (i.e. make your UI prefabs addressables / updatable).

    The process of generating addressable bundles can be complex, but at the end it generates settings files, catalog file and the assets bundles. You can do it all in script. But it will requires an unity instance in your server (for invoking editor scope scripting for sure), and generating individual bundles (say pack these three fbx into a bundle) is not supported by default, it achievable, but will cost you more time.
     
    madhur likes this.
  3. madhur

    madhur

    Joined:
    May 16, 2012
    Posts:
    86
    Thank you very much @Favo-Yang for the explanation.

    We already have an app running fine using assetbundles for a long time and we are planning to do an upgrade soon. So that's why I was wondering whether we should look at upgrading things to use Addressable or not.

    Lets say I have to create each assetbundle for each fbx only. (No need to group fbx in one assetbundle). In that case is there any documentation or scripts already available on what I have to do to, using addressable system.

    If I do it manually I think I will have to follow something similar to this. https://docs.unity3d.com/Packages/c...4/manual/AddressableAssetsGettingStarted.html

    If I have to automate that process, do I have to make the scripts by myself by going through the manual steps or is there any such scripts or any helpful info already available at the moment?

    Also while continue using the assetbundles we have created, can we just update the assetbundle loading code to use Addressable related coding like Addressables.LoadAsset, so at a later date if we replace assetbundles with Addressable assets, loading part will automatically work. Do you think something like that will make any sense or just continue with assetbundles and code we have at moment and reconsider going for Addressable in another few years time?

    Thank you.
     
  4. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    I guess you have to go through the documentation anyway for the basic concept. Not much difference for a single fbx or a group of them. In either case you need generate a catalog and a bundle file. Again you need quite knowledges to achieve there.

    I can think about 2 approaches.

    1) You can prepare an empty project with addressable system setting up and an empty group inside. Then using editor script to put the fbx file into the group. Build the addressable system, in such case you will get the catalog file and the bundle. After copy them to your content server, clean the group.

    2) Same as above to get the catalog file and the bundle file. But instead of asking the system to build stuffs for you, you analyze the catalog file and use it as a template. Next time you simple build the bundle yourself, then update the catalog file (probably just a change the file name in the json file).

    Out of dated. Use my link above pls.

    Here's a tutorial may help in general https://forum.unity.com/threads/demo-tutorial-for-remote-hosting-using-amazon-s3.724022/

    The importer can be a reference for how to maintain assets via editor script. The gist shows how to build via editor script.

    Actually that probably better, if you use addressable as a loader first. But it doesn't magically work as you expected. You still need prepare a catalog file for each bundle. I'm sure it's achievable, just need some work. A few folks discussed about this, but no code sharing at the moment.
     
  5. madhur

    madhur

    Joined:
    May 16, 2012
    Posts:
    86
    Thank you @Favo-Yang
    I have one more question. Currently the assetbundles are supported for the specific Unity version only. (If the assetbundle was built from Unity xxx version, it'll load properly on the apps built from that Unity version only. It might not properly work with newer Unity versions. Some materials can be missing etc in newer versions)
    Is it going to be the same even if we use Addressables or the bundles created from Adressable system will load in the future versions without any issue?
     
  6. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Addressables system is just a package of handling asset bundles at the moment. So all the constraints applied, until sometime unity dev rolling out a new format for the system (sort of a very very long term plan). I'm not an expert for the limitation of asset bundle. So you may want to post on the asset bundle sub-forum for help.
     
    wlwl2 and madhur like this.
  7. ScottPeal

    ScottPeal

    Joined:
    Jan 14, 2013
    Posts:
    61
    I have the same issue as the OP. My question is can we use addressables without needing a catalog at all?

    In our current solution we track the versions because the last x versions are valid objects that could be presented in a scene. So no need or desire to only show the latest version. If we could just use addressables without catalogs and we use a web service to tell Unity what asset to load/when.

    So, can we just no use catalogs?

    My related forum post"
    https://forum.unity.com/threads/how-do-remote-catalogs-work.749138/#post-4990268
     
  8. GorseB

    GorseB

    Joined:
    Jan 5, 2017
    Posts:
    2
    sorry to necro this post but I have the same problem and can't find an answer anywhere else. It's been nearly 4 years so I'm hoping there is a solution...