Search Unity

Addressables and App Thinning / App Slicing on iOS + Android App Bundle

Discussion in 'Addressables' started by 5argon, Oct 31, 2018.

  1. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    iOS do app slicing so that non-iPad may get lower resolution texture. Previously in Unity this mechanism is heavily relying on adding a tag on the (old) asset bundle system then setup in Player Settings > Variant Map For App Slicing

    https://docs.unity3d.com/Manual/AppThinning.html

    https://blogs.unity3d.com/2015/12/28/optimizing-ios-app-size-with-resource-slicing/

    Now that Addressables system make asset bundle too and pack together with the app, what is the recommended way to utilize app slicing now? Any newer ways going forward?

    My idea use case would be :
    1. I have some textures I made into a SpriteAtlas. My atlas has a variant with smaller scale.
    2. 2 atlases are in the separated Addressable group. Both has the same addressable key for load. The original separated textures are not in any of the addressable group.
    3. When building to Xcode they would be both in the Xcode project's output side of StreamingAssets/com.unity.addressables, and then both uploaded to the store. Later when player download the game they would only get one Addressable bundle according to their device.
    4. In the game I use Addressables.LoadAsset<SpriteAtlas>(key) with the same key. Because only one bundle comes with the app thining it would load the appropriate one.

    The onto Android, I am also wondering how this would bridge to Android's new App Bundle / Dynamic Delivery.

    AAB works by assembling many smaller split APK into one large app. Ideally I would like each of the Addressables group to be its own split APK which player will get depending on device's resolution via the new App Bundle support.

    https://medium.com/google-developer-experts/exploring-the-android-app-bundle-ca16846fa3d7

    You can see it is able to split up by density (hdpi, mdpi, ldpi, etc.) Looks like the split was automatic based on `res/` folder's qualifier (https://developer.android.com/guide/topics/resources/providing-resources#BestMatch)

    But Addressables output (StreamingAssets's content) was put in `main/assets/com.unity.addressables/...` and not `main/res`. I believe it is not possible for the bundle builder to split anything in the `main/assets/`. It would be great if addressable can utilize this too. There is `main/assets/raw` folder support which could be appropriate for the bundle to be in.
     
    Last edited: Oct 31, 2018
    icatt23 likes this.
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Thank you for reaching out. All of the things you are describing can be done by extending the addressables system with custom providers, and in some instances, a custom build script. Long term, we definitely don't want users to have to create custom systems to handle this, but for now you must. Apple ODR support is probably one of the first one's we'll tackle, but all of it is on the list.

    -Bill
     
    5argon likes this.
  3. ArminP

    ArminP

    Joined:
    Jan 29, 2015
    Posts:
    4
    Hi,

    @unity_bill since it's already 4 months from your replay, I'm wondering how far is Apple ODR addressable builder and provider?

    We're working with addressable and we want to put it together with Apple ODR so I'm wondering if it's better to write our own build and provider script or are you already finalizing it?

    Thanks, Armin
     
  4. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    It is still best for you to write your own. I expect us to leave "preview" state before adding this feature.
     
  5. ArminP

    ArminP

    Joined:
    Jan 29, 2015
    Posts:
    4
    Ok, thanks for info @unity_bill . Looking forward for addressable out of "preview" state.

    Best, Armin
     
  6. Murillo

    Murillo

    Joined:
    Aug 8, 2013
    Posts:
    4
    @unity_bill do you have a timeframe for when Addressables will be out of preview? Or, even better, when do you expect to have ODR supported out of the box?
     
  7. BBO_Lagoon

    BBO_Lagoon

    Joined:
    Mar 2, 2017
    Posts:
    200
    Hi, Is there any advice on how to put AssetBundles in main/res/drawable-{res} at compile time and load them at app startup ?
     
  8. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    586
  9. BBO_Lagoon

    BBO_Lagoon

    Joined:
    Mar 2, 2017
    Posts:
    200
    unityeightingame likes this.
  10. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Not much of one. The platform team is actively working on improved support for Android App Bundle as we speak. As they work through that, we are exploring some sort of addressables integration, but when and what are fairly fuzzy.

    If you set up your AAB as install-time or fast-follow, then addressables integration is fairly straightforward as all the content should be downloaded by the time the app is running. If you want it to be on-demand, then you'd need a custom provider that asks Google for the content instead of asking a URL via UnityWebRequest. There's a lot of other things going on in this sample, but the sync addressables sample shows how to use custom providers: https://github.com/Unity-Technologies/Addressables-Sample/tree/master/Advanced/Sync Addressables
     
  11. hejalejandro

    hejalejandro

    Joined:
    Oct 26, 2021
    Posts:
    5
    @unity_bill any updates? Any sample project we could look at for integration between addressables and apple/android ODR without having to use custom providers?
    The "app thinning" documentation still guides you through the classic asset bundle approach, could we at least get a variant of that page using addressables?
     
  12. unity_krista

    unity_krista

    Unity Technologies

    Joined:
    Apr 28, 2020
    Posts:
    40
    As far as Android, we do have a Google PAD sample here. The Apple ODR project is still unfortunately a WIP
     
  13. RaventurnPatrick

    RaventurnPatrick

    Joined:
    Aug 9, 2011
    Posts:
    250
    Is there any news regarding Apple ODR support?
     
  14. programacion-6

    programacion-6

    Joined:
    Mar 25, 2022
    Posts:
    10
    Hi there,

    Is there any news regarding Addressables and ODR support?

    If there's any other workaround it would be nice to have it. Even if it's in preview or in GitHub somewhere.
     
  15. ZuuksDeveloper

    ZuuksDeveloper

    Joined:
    Apr 3, 2020
    Posts:
    1
    Is there any news??