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. Dismiss Notice

Bug [1.17.5] Getting downloaded percentage seems not working ?

Discussion in 'Addressables' started by AirUnity02, Feb 23, 2021.

  1. AirUnity02

    AirUnity02

    Joined:
    Feb 23, 2021
    Posts:
    4
    Hi, I am using Unity 2019.2 and previously using Addressables 1.16.15.
    I decide to update to 1.17.5 because of the cache clear behavior option and it is great.

    I am using the same code on 1.16.15 and 1.17.5 :

    Code (CSharp):
    1. downloadHandle = Addressables.DownloadDependenciesAsync(everyKey);
    2. while (!downloadHandle.IsDone)
    3. {
    4.     DownloadStatus status = downloadHandle.GetDownloadStatus();
    5.     OnDownloading?.Invoke(status.Percent, status.TotalBytes);
    6.     yield return null;
    7. }
    1.16.15 works fine but 1.17.5. not.

    In 1.17.5, the DownloadedBytes in status was 0, result in the percent is also 0.
    I have tried downloadHandle.PercentComplete, and it is also returning 0.
    But all the bundles can be downloaded and loaded.

    Sorry for poor English, and Thanks for the help.
     
    Last edited: Feb 24, 2021
  2. AirUnity02

    AirUnity02

    Joined:
    Feb 23, 2021
    Posts:
    4
    Push.

    Besides that, I found out that setting the retry count in addressable group seems not working on mobile device, but editor works fine.
     
  3. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    365
    Try using "status.DownloadedBytes"
    this works for me.
    But I am using Unity 2020.2.

    I recognized that "status.TotalBytes" is the size of the current bundle that is downloaded. So if "everyKey" refers to multiple bundles to download, that value will change during the download.
     
  4. AirUnity02

    AirUnity02

    Joined:
    Feb 23, 2021
    Posts:
    4
    Thanks for the reply.
    Both status.DownloadedBytes / status.Percent / downloadHandle.PercentComplete are returning 0 to me.
    It is weird because these line of codes work fine at Addressable v1.16.15, so it may be a bug from Addressable.

    status.TotalBytes is fine, it is always the total size of bundles from keys, nothing changed.
     
  5. hochuls

    hochuls

    Joined:
    Jan 28, 2020
    Posts:
    4
    Same here 2020.1.17f + 1.17.6. status.DownloadedBytes / status.Percent / downloadHandle.PercentComplete are returning 0
     
  6. tatar1n

    tatar1n

    Joined:
    Jun 1, 2015
    Posts:
    5
    The same behaviour. Unity: 2020.1.17f, addressables: 1.17.4/1.17.6. On the 1.16.x everything is displayed correctly.
     
  7. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,796
    I'll flag this for the team to have a look!
     
    AirUnity02 likes this.
  8. oliviergc

    oliviergc

    Unity Technologies

    Joined:
    Dec 19, 2019
    Posts:
    26
    Hey everyone.

    We identified some faulty logic and areas of improvement in the computation of download percentage and progress. We have a fix incoming soon.
     
    AirUnity02 likes this.
  9. AirUnity02

    AirUnity02

    Joined:
    Feb 23, 2021
    Posts:
    4
    After testing with latest version (1.17.13), I guess the problem is still existed. Here is my log after added this line of code in my while() loop at #1 :

    downloadHandle is a AsyncOperationHandle
    status is from downloadHandle.GetDownloadStatus()
    Code (CSharp):
    1. Debug.LogError(status.Percent * status.TotalBytes + " / " + status.TotalBytes + "\t(PercentComplete) " + downloadHandle.PercentComplete);
    logerror.png

    In this scenario, I have 3 bundles to download, and it seems that those download status values will only changed after completing a download operation of each bundle.
     
  10. oliviergc

    oliviergc

    Unity Technologies

    Joined:
    Dec 19, 2019
    Posts:
    26
    Hmm this is supposed to be fixed. We'll investigate and update the thread as soon as possible.
     
  11. oliviergc

    oliviergc

    Unity Technologies

    Joined:
    Dec 19, 2019
    Posts:
    26
    Oh. I was right about it being fixed, but wrong about the fix being included in Addressables 1.17.13.

    We actually missed some use-cases in our first attempt at fixing this. It should work correctly in version 1.17.15+. I just tested your exact use case and all numbers seem correct.

    Apologies for the inconveniences, if any.

    As always, don't hesitate if there's anything else.
     
    TreyK-47 and AirUnity02 like this.