Search Unity

Requesting download size & pre-downloading(caching) remote groups?

Discussion in 'Addressables' started by MaskedMouse, Jun 22, 2018.

  1. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    301
    Will there be some API to use that will check the size of the asset you might be trying to download?
    Like I'd want to know how many bundles need to be downloaded and how much data that will be so I can prompt my user for confirmation to download the bundles. On a mobile platform that would be a mobile data friendly thing to do instead of burning through their data.

    Also will there be a way to cache an entire remote group that consists of several smaller bundles? That way you could download remote updated content and make sure that all critical content is locally available before using it (instantiation / loading into memory).
     
  2. PaulBurslem

    PaulBurslem

    Unity Technologies

    Joined:
    Oct 7, 2016
    Posts:
    43
    Not currently, though this could possibly be supported by storing size information in the IResourceLocation.Data field. Currently that field is used to store asset bundle cache info (crc & hash). This structure could be expanded to contain file size as well with a minimal amount of effort. I'll go ahead and add it to our tracking system as something to investigate.
     
    optimise likes this.
  3. Allan-Smith

    Allan-Smith

    Joined:
    Feb 7, 2012
    Posts:
    52
    This would definitely come in handy... we used to have a very... "hacky" system that we ourselves cached the sizes of asset bundles at build time, and when downloading we would refer to a dictionary to find the size of all the bundles beign downloaded and use the percentages to estimate how much was downloaded or not... I mean, it worked, but was a lot of work for such a basic info... would be useful if Unity did this size caching itself, would make life much simpler
     
  4. NWalker_FGOL_Ubisoft

    NWalker_FGOL_Ubisoft

    Joined:
    Aug 10, 2015
    Posts:
    11
    +1
    Addressables are not production-ready without it as iOS requires this info for all new content downloads.

    https://developer.apple.com/app-store/review/guidelines/#minimum-functionality

    (iii) If your app needs to download additional resources, disclose the size of the download and prompt users before doing so. Existing apps must comply with this guideline in any update submitted after January 1, 2019.
     
  5. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    301
    Oh wow I did not even know that Apple had actually changed their guidelines for this.
    Thank you for the heads up. I wanted this functionality to make it "User Mobile Data Friendly" but this makes it an actual requirement!
     
    NWalker_FGOL_Ubisoft likes this.
  6. Allan-Smith

    Allan-Smith

    Joined:
    Feb 7, 2012
    Posts:
    52
    wow that is good to know... thanks for pointing it out, one more reason to get sizes as part of the system!
     
  7. mahaiting

    mahaiting

    Joined:
    Apr 30, 2018
    Posts:
    3
    +1

    waiting for the new address system.
     
  8. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    362
    Thanks for pointing out the new Apple requirement. I've added this to our task list.
     
  9. AAK_Lebanon

    AAK_Lebanon

    Joined:
    May 30, 2015
    Posts:
    43
    Any update on this topic ?? I know that we can now get the PercentComplete from the IAsyncOperation but how we can know the size of the asset bundles ?? (I am using the 0.5.3 version)
     
  10. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    362
    That'll be there in the next release or next+1 (almost certainly next).

    -Bill