What happened
We have multiple Addressable Groups. Default, Vehicles, Maps. We make change to an asset that resides in the Default group, and this causes Vehicle and Maps bundles to be unique even if we try to do an update. No assets in those groups were altered, we expect the generated bundles to be the same with the exception of the Default group.
The maps and vehicles bundles are our largest bundles. A simple change (altering the version of a string on an asset in an unrelated addressable group) results in our users having to download 40~ mbās of content!
How we can reproduce it using the example you attached
clean build cache
New Build: build bundles = Bundle A
Edit āContent Pack Versionā asset, change version to 40.0.0
Update Previous Build: build bundles = Bundles B, not matching Build A. For example, see
Some bundles are unique as expected (ādefault_assets_gamedatabase.bundleā), but unrelated bundles are also unique (āmaps_scenes_industry.bundleā and all 'vehicles_assets_*.bundleās)
Been 2 weeks since I submitted the bug report and not so much as an acknowledgement on the tracker. (Bug reported 8th of February)
This is a really concerning bug, because it would be prohibitively expensive to use addressables if it turns out this is āexpected behaviourā of some sort. Id like to know sooner rather than later!
Something as simple as changing the value of a string in one asset group should not result in the user needing to redownload a majority of the game content.
I will have to resubmit for review in 2020.2. We were waiting for LTS before we updated our project. I canāt imagine the issue would just go away, though. Fingers crossed I guess. Will report back when I get around to updating and retrying.
I havenāt had time to resubmit a bug report but was able to reproduce in the latest version of Unity.
I was able to narrow down the problem a bit more. Bundle A contained just one addressable folder, and the folder contains a bunch of assets. Bundle B is the same.
If I edit an asset in the folder that contains Bundle A assets, both Bundle A and Bundle B get dirty. (Bug, unexpected) If I mark the asset I want to edit as its own addressable asset explicitly (has its own explicit address and entry in Bundle A) and edit it, Bundle A gets dirty as expected but Bundle B does not. (Expected outcome)
So the asset is included in Bundle A in either case. In one case itās included because its parent folder is marked addressable (bug can be observed) and in the other it is included explicitly with its own entry (bug no longer observed).
This is a real project with real assets and such. I canāt reproduce it in an empty project with simple scriptable objects and small bundles.
@TreyK-47 I just spent 2 days peeling back the project and trying to narrow the problem down.
It seems like the problem is due to Unique Bundle Idās. It seems like any change in Bundle A causes bundle B to be rebuilt too because of this checkbox.
Feedback: This was extremely hard to debug. It took a very long time. I wish there was some easier way to see why and when a bundle is going to have to be rebuilt instead of re-used. I wish there was some option to turn on more verbose logs.
Seeing as option 2 is unusable and unrealistic for our use case (any minor change to the small parent āmetadataā bundle causes the bundles with the actual assets to be regeneratedā¦), weād like to go with option one.
But how exactly do I ensure thisā¦? Say Iāve initialised addressables and loaded up some data already. I then want to update my catelogue. How exactly do I make sure Iāve unloaded everything correctly?
There doesnt seem to be a way to clearly bring Addressables back to a reset/ground state. How do I achieve this so that it is safe to download a new catelogue ?
Thanks for the feedback, @Prodigga . Iām going to flag this with the team again, and either myself or a team member will share some further guidance/insight.
I ran a test and things do appear to be working with my code. I do try to ensure things are unloaded before I download bundles and it seems to work out.
My concern stems from the fact that the event window doesnāt show an asset being unloaded/released for a little while after you release it. Iām concerned about whatāll happen if the game downloads the assets in this window of time, while the old addressables assets are still lingering around.
āMy concern stems from the fact that the event window doesnāt show an asset being unloaded/released for a little while after you release it. Iām concerned about whatāll happen if the game downloads the assets in this window of time, while the old addressables assets are still lingering around.ā
The right most frame of the event viewer is the current state. If you select an area of the event viewer. You will see a number indicating how many references Asset/Bundles are being referenced by. When the bundle has 0 references (the bar is missing, at the right most frame), then it is unloaded. It will remain in the event viewer as 0 references for a few frames. This can give you a visual representation of loading/unloading over time.
After updating your catalog and loading your content, if it uses the same bundle, it will reload and increase the reference count. If you have a new bundle, you will see a new entry in the event viewer.
To give you some info about the issue you weāre seeing. Based on the description in this post.
Unique bundles includes the hash of an Asset into the bundle internal name, so any change to any Asset in a bundle will change its internal name. This internal name is how AssetBundles refer to one another. If you have another bundle that has a dependency on / reference to something in that bundle. Then it will also change, in order to change its reference from the old AssetBundle to the new one.
In addition to Unique bundle naming.
In the newer versions that you are using, you will see āInternal Bundle Id Modeā setting. This can help manage this internal name further. āGroup Guidā will mean the name doesnāt change as assets are added/removed. āGroup Guid Project Id Entries Hashā will result in a change of this internal bundle name if the group guid, project id, or entries are changed.
"But how exactly do I ensure thisā¦? Say Iāve initialised addressables and loaded up some data already. I then want to update my catelogue. How exactly do I make sure Iāve unloaded everything correctly? There doesnt seem to be a way to clearly bring Addressables back to a reset/ground state. How do I achieve this so that it is safe to download a new catelogue ?"
We donāt have any ārelease everythingā API. You need to manage the handles from all load calls. You could wrap the Addressables.LoadAsset calls and keep track of the handles and release them all in your code. That would be dangerous for any other code that may be trying to use a handle and find that it is not valid and error. So you should be careful there.