Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Addressables - Moving Groups Local to Remote, without losing current install data

Discussion in 'Addressables' started by Alikum, May 26, 2022.

  1. Alikum

    Alikum

    Joined:
    Jun 1, 2016
    Posts:
    3
    Hi everyone.
    I am working on mobile project where we are trying to decrease build size. We are already using addressables in our project and we are planning to move most data from local to remote.

    But, we already have huge install count and updating current users with remote not good for us.

    Basically, can we cache assets with one build and releasing another update that use remote, with this way current users not need to redownload again from remote system, only new users use and download remote data.

    I hope I explained myself clearly, thank you.
     
    Last edited: May 26, 2022
  2. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
  3. Alikum

    Alikum

    Joined:
    Jun 1, 2016
    Posts:
    3
    Maybe I can use cache system in one build to cache groups those are local in that build, and next update, I can check if there is any cached group, if so use that, if not check remote source. Is that possible?

    Basically, I'm trying to reduce initial download size for new players. If all players use remote system, the cost will be too much for our organization.
     
  4. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    @Alikum Hmm I see, there's a way to achieve this but there are some drawbacks. Enabling the "Use UnityWebRequest for Local Asset Bundles" group setting will allow caching for the local bundles associated with the group.
    https://docs.unity3d.com/Packages/c...20/manual/GroupSettings.html#advanced-options

    Using UnityWebRequest to load the bundles (UnityWebRequestAssetBundle.GetAssetBundle) is generally less performant than the default method (AssetBundle.LoadFromFileAsync). Additionally you cannot switch between using the two methods in different builds (cache the bundles using GetAssetBundle for the initial build, then use LoadFromFileAsync in the second build). LoadFromFileAsync has no way of accessing the AssetBundle cache, only GetAssetBundle does.
    https://docs.unity3d.com/2022.2/Doc...nityWebRequestAssetBundle.GetAssetBundle.html