Search Unity

How does caching on remote addressables content work?

Discussion in 'Addressables' started by wirelessdreamer, Dec 14, 2019.

  1. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    In this setup, how will addressables behave?
    (online)
    app start in scene 1
    load scene 2, which is remote hosted
    load scene 3, which is remote hosted
    download scene 4 to use later
    (go offline)
    exit app
    start app
    app start in scene 1
    load scene 2 (expecting its now cached, and we don't have to be online)
    load scene 3(expecting its now cached, and we don't have to be online)
    load scene 4(we downloaded it so we should be able to use it)

    what does that process look like in addressables, and how do we know which addressables we've downloaded, and which we haven't in this setup?

    Thanks.
     
    AskCarol likes this.
  2. Atlantiss

    Atlantiss

    Joined:
    Aug 5, 2018
    Posts:
    14
    I also would like to know this as I am trying to implement addressibles for content loading like mentioned above.I would also like to know how you can preload or update only chosen addressable groups at runtime.
     
    AskCarol likes this.
  3. GB_HB

    GB_HB

    Joined:
    Jul 14, 2019
    Posts:
    20
    Hey, I hope I can clear some stuff up and if I'm wrong a dev will drop in to correct the record. You've essentially figured out the pipeline with remote hosting and updating.

    When you run your game and are grabbing assets remotely, first the addressable system checks to see if there are cached versions of the asset within the .Bundle[?]. If there is this version of the asset is loaded. But If there is a missing assets from the catalog, they will be downloaded from the remote. Like you state in your overview example.

    The small test I did was simple. With an android phone, I updated my catalog with additional content. Then shut off internet/network capabilities to make sure cached versions of my assets loaded. They did and the remote content did not. Then when I turned internet/network features back on and restarted the game the new content populated along with the 'old'. Last I cleared the games cache as well as once again disabling internet/network just to make sure everything was to be expected. As you would assume with the cache cleared addressables couldn't load the now missing assets as well as being unable to load them from the remote. Again, turned the internet/network back on started up the app and everything is now loading from the remote. That was a long way around but I hope it helped

    How to track what addressables have downloaded, unfortunately, I don't know of a way that gives this information automatically, but I believe it is stored within the Addressables Cache. How and where this information is, is a mystery to me atm. You may want to consider having your own database of asset ref. information. I think this is the reason why so many of the official Unity addressables examples load assets into a dictionary.
     
    jipsen and AskCarol like this.
  4. Atlantiss

    Atlantiss

    Joined:
    Aug 5, 2018
    Posts:
    14
    @badgerdox,
    Thanks,Your Youtube tutorials are awesome,very helpful.
    I need to figure out how to check if the asset and its dependencies are locally cached.
    In my case,the app has different modules that the user must be able to choose to update individually.So checking and pre loading the chosen module and its dependencies are necessary.
     
    GB_HB likes this.
  5. GB_HB

    GB_HB

    Joined:
    Jul 14, 2019
    Posts:
    20
    Much appreciated @Atlantiss.
    Knowing if a dependency is cached seems as if it would be something the devs would let us track. I need to look over the manual and wish I could help more as nothing comes to mind :/. I will be looking things over to see what I can find and reporting back late in the week.
     
  6. FiniteReflection

    FiniteReflection

    Joined:
    Jul 29, 2017
    Posts:
    23