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

Undeterministic asset bundle creation ?

Discussion in 'Addressables' started by makiooto, Jan 29, 2021.

  1. makiooto

    makiooto

    Joined:
    May 22, 2019
    Posts:
    2
    Hello everyone,

    I'm trying to make patches for a game, I have a master branch and an update branch.

    A lot of my resources haven't changed but the bundle generated for that resource is different between the master and the update though..
    I figured the content update build would be able to repair that, but it does the same as when building normally

    upload_2021-1-29_1-6-3.png

    As seen most of the generated file is the same, except the parts the white part of the yellow lines...

    ex : "archive:/CAB-a9b8dd83803860a922a1f1b8383b7c11%" and "archive:/CAB-abde2d28334311c2fe2c545d840e5103%" which seems to be some kind of internal id which happens to be different for some kind of reasons...

    I've been blocked with that issue for a few days, i tried to change the addressable version from 1.8.4 to 1.8.5 but it doesn't do anything...
    I cleaned both the project to be sure and rebuilt...
    A strange thing is that issue only happened on my side after installing the PS4 plugin on my computer...

    Do someone have any idea ?
    (Unity version : 2019.4.0f1)
    Thanks.
     
    Last edited: Jan 29, 2021
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,796
    I'll bounce this off the team, but I will say you are using a older version of Addressables.
     
  3. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    So, 1.8.5 is quite old at this point and it relies on an old version of the Scriptable Build Pipeline. I'd try updating Addressables to 1.16.6 at least (or 1.17.4-preview if you want the latest) so that you can also get the new Scriptable Build Pipeline dependency in there. A lot of work has gone into both Addressables and SBP in the way of determinism since 1.8.5 so I wouldn't be surprised if your issue is fixed in the newer version.

    Hope that helps!
     
  4. KarimTA

    KarimTA

    Joined:
    Jan 8, 2019
    Posts:
    27
    Last edited: Feb 10, 2021
    TacticalShader likes this.
  5. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    Hm, that is odd. It could also very well be something we're doing (in the way we're feeding data to the Scriptable Build Pipeline) or the Scriptable Build Pipeline itself. Would you be able to submit your project in a bug report? That'd be a huge help in getting this tracked down.
     
  6. hochuls

    hochuls

    Joined:
    Jan 28, 2020
    Posts:
    4
    I've been suffering because of this issue for a long time. Unity keeps making newer bundles without any changes from our side. We are using addressable for the remote static bundle and don't want to patch or update over client version update. We are using Unity 20.1.17f with addressable 1.17.5

    And we have more strange things with Addressables.

    1. Issue what OP mentioned: Unity is making new bundle files when we didn't change any assets in the bundle
    2. Unity Cloud Build is making different bundles in different pipelines(same source/setting)
    3. Sometimes UCB build is making the same Hash added bundle but the different file(same as case#2 but this time with same file name).

    Any ideas or anyone solved these issues?
     
  7. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    Quick question: you say you aren't changing any assets in the bundle, but are you changing non-Addressable assets that assets in the bundle depend on (at any level in the dependency tree)? That would also cause a re-build.

    I would mention that the indeterminism from your machine and UCB could be due to a couple of issues:
    1. There are shader indeterminism issues in the editor that you may be running into
    2. If the OS of your machine vs that of the UCB are different then that could account for these changes.
    Some things I might suggest:
    1. Double check that you're not modifying anything in the dependency tree of an Addressable asset.
      1. If you do find that you're modifying something in the dependency tree you can add those assets to Addressables and then keep your bundle changes isolated.
    2. Put all shaders/materials into separate bundles from your other assets (this might not really work for you since there will still be bundles being rebuilt but you could keep those changes isolated)
    3. Change the Bundle Naming Mode on the Content Packing & Loading schema on the Addressable Group to Filename. This will stop the bundle from using the hash in the name. I would warn that if something is getting changed then it will still be a new bundle so this might not be exactly what you're looking for.
    Let me know if you try any of this and if it does or doesn't work for you. If you still are encountering the issue and think it might just be a legitimate bug in our code then please file a bug report with a repro project. It helps us a ton to have a good repro for cases like this.