Search Unity

AssetBundles hash changed widely when shared bundle's dependency changed

Discussion in 'Asset Bundles' started by songtianming, May 18, 2022.

  1. songtianming

    songtianming

    Joined:
    Aug 3, 2018
    Posts:
    5
    For example : many bundles reference a common bundle named "shared.bundle", "shared.bundle" reference bundleA, when "shared.bundle" changed to or add new reference to bundleB, then all bundles dep on shared.bundle's hash changed(but the bundles md5 is the same), which is annoying, and can cause UnityWebRequest to redownload the totally unchanged files.

    Is this a design choice or issue?
    I found that the bundle's hash uses the indirect reference to caculate, which may cause this problem.
    why the hash calc need the indirect dependency?
    SBPdep.png 20220518110609.png
     
    Last edited: May 18, 2022
  2. songtianming

    songtianming

    Joined:
    Aug 3, 2018
    Posts:
    5
    I just figured out why unity calculated hash changed but the bundle's md5 stay the same.
    SBP::CalculateBundleDependencies think: when bundleA depends on bundleB, and bundleB deps on bundleC, so bundleA must deps on bundleC, this relation may be wrong, bundleA may actually only deps on bundleB.
    "External References" in bundleA ony records the real dependency.
    20220518160730.png
     
    ccamfield_sago likes this.