Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Asset bundles hashes change unexpectedly

Discussion in 'Addressables' started by paweechinagarn, Feb 13, 2020.

  1. paweechinagarn

    paweechinagarn

    Joined:
    Jan 7, 2019
    Posts:
    7
    Hey,

    Anyone notices that asset bundles hashes change when adding new label even it's not assigned to any addressables?

    I'm using Unity 2018.3.14f1 with Addressables 1.6.0
    My group settings
    - Bundle Mode: Pack Together By Label
    - Bundle Naming: Append Hash to FileName

    Here are my steps
    - Have some addressables with labels and build them once
    - Add new label (just create new one and leave it unassigned to any addressables)
    - Press update a previous build
    - Notice that there are new bundles generated for every labels (hash in file name are not the same)

    Should bundles hashes stay the same as I didn't make any change to them? How these hashes been calculated exactly?

    Any info on this @DavidUnity3d ?
     
  2. paweechinagarn

    paweechinagarn

    Joined:
    Jan 7, 2019
    Posts:
    7
    In addition, adding new folders to addressables also causes a rebuild to every bundles despite bundle mode or bundle naming
     
    Last edited: Feb 14, 2020
  3. nik_d

    nik_d

    Joined:
    Apr 27, 2018
    Posts:
    66
    They should, but I (for example) fight with them already more than month. =(

    Bundle hashes are calculated in sbp (scriptable build pipeline) - ArchiveAndCompressBundles.CalculateHashVersion and depend on built binary content.

    I've made them more stable via deterministic iterations in many addressables / sbp loops, rewriting Hash calculations for internal names, better usage of build cache (e.g. https://forum.unity.com/threads/bug...128-depends-on-the-order-of-unionwith.819792/) and workarounding a lot of other bugs (e.g. https://forum.unity.com/threads/bug...builds-eventsystem-executionorder-bug.830892/) - cannot remember everything.
    And I still have not achieved an acceptable result.

    Some of bugs / stability issues are fixed in Unity 2019, others - I don't know still (f.e. ordering of temp:/GameObject and temp:/MonoBehaviour in WriteResult of SceneBundleWriteOperation).

    And it made me to know just about everything inside addressables / sbp (via all available origins including translation of some Japanese presentation captions)).

    Good luck you too to walk this way. =) (or writing something personal using native sbp part - ContentBuildInterface.*)
     
    Last edited: Feb 18, 2020
  4. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    762
    I'm surprised that adding a label to Addressables and not assigning it caused a hash to be different. Are you getting 100% repro with those steps? There are determinism issues we've fought with on the engine side quite a bit so I'm curious if you're running into something else but it just looks like adding the label is the cause.

    Anytime you run into a determinism problem feel free to report a bug to Unity. These are frustrating issues to be sure so the quicker we can get them directed to the correct team (if, for instance, the issue is engine side and not related to our team directly) the quicker we'll be able to correct this issue.
     
    cygmatz likes this.