Search Unity

Addressables incompatibility with iOS ODR

Discussion in 'Addressables' started by Swah, Mar 12, 2021.

  1. Swah

    Swah

    Joined:
    May 13, 2015
    Posts:
    80
    Hello,

    We're using iOS On-Demand Resources (ODR) to download all levels from our game after the user logs in. We have successfully used Addressables on other platforms, but were not able to use them with ODRs. Some problems could be fixed by creating our own AssetBundleProvider, but some are issues in the addressable package itself:
    • This workaround for AssetBundleResource.BeginOperation is still needed
    • Showing size of upcoming downloads is a requirement on iOS, but Addressables.GetDownloadSizeAsync doesn't work. In AssetBundleRequestOptions.ComputeSize, ResourceManagerConfig.IsPathRemote(id) always returns false because it considers the "res://" load path as being local. The load path has to be set to "res://" since that's the only place ODR downloads go. I did a point fix for this, but for some reasons the asset bundles are not found in the cache even though I enabled caching.
    I stopped investigating after a while because it's an immense potential time sink and I don't want to maintain code changes to a package that will evolve.

    For developers: was anyone able to use addressables with ODR? If so, did it require changes to the package or were you able to simply override some classes?

    For Unity: is ODR support being worked on for addressables?

    Unity 2019.4.13f
    Addressables 1.8.5 (although trying 1.16.16 didn't fix the above)

    Thanks.
     
    Last edited: Mar 12, 2021
    _creatio_, odovhodko and apkdev like this.
  2. _creatio_

    _creatio_

    Joined:
    Mar 21, 2013
    Posts:
    43
    Hello,

    I'm also looking into the integration of the ODR and PAD with addressables right now. Seems like it still requires a lot of effort for integration. Did you have any success with it? Did you make it work in async mode or sync only?
     
  3. Swah

    Swah

    Joined:
    May 13, 2015
    Posts:
    80
    We ended up using Addressables only to build asset bundles, but after that use Unity's implementation of ODRs directly to load these bundles. There's a lot of trial and error involved here, with long iteration times to test since you need to build every time. We ended up also not using addressables for loading on Google Play. Everything is async.

    Honestly there's probably a way to make addressables work on both platforms, but it would have required too much time on our end, with no guarantee that the code would work with future versions of addressables. I'd love to know if someone creates an implementation that works, and I'm a bit surprised that wasn't done by unity itself.
     
    ScottJustScott and _creatio_ like this.
  4. KwahuNashoba

    KwahuNashoba

    Joined:
    Mar 30, 2015
    Posts:
    110
    Unity developed their own CDN, so I guess it's agains thier interest to work on it
     
    ScottJustScott likes this.
  5. _creatio_

    _creatio_

    Joined:
    Mar 21, 2013
    Posts:
    43
    Unity is not only for mobile games making, so, I think, their CDN solution will have a lot of attention from the web games developers.

    Also, there are many other Android app stores (non Google ones), so there will be a lot of developers who will be interested to have a general solution (without a need to implement a new CDN support for each platform).

    So I guess, it's not against Unity's interest, but an additional benefit of using Unity for those who are hesitant.