Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bank changes are ignored in Addressables Content Update #48

Open
jungsooPark-dev opened this issue Mar 19, 2024 · 3 comments
Open

Bank changes are ignored in Addressables Content Update #48

jungsooPark-dev opened this issue Mar 19, 2024 · 3 comments

Comments

@jungsooPark-dev
Copy link

When using Addressables with FMOD for Unity, there is a feature that automatically executes EventManager.CopyToStreamingAssets and EventManager.UpdateBankStubAssets using Scriptable Build Pipeline PostDependencyCallback and PostWritingCallback. However, this causes issues when utilizing Addressables' Content Update feature.

To use the Content Update feature, the hash values of all individual entries going into Addressables are recorded in the addressables_content_state.bin file. However, referring to the BuildScriptPackedMode.cs script, the action of recording hash values occurs after the AssetBundle build. After the AssetBundle build is complete, FMOD automatically calls EventManager.UpdateBankStubAssets through PostWritingCallback. As a result, the hashes recorded in the addressables_content_state.bin file are all hashes of Stub Assets. Therefore, it becomes impossible to record the hash value of the FMOD Bank, and any changes to the FMOD Bank are omitted from all content updates.

To address this issue most simply, it would be preferable to make the automatic functionalities of EventManager.CopyToStreamingAssets and EventManager.UpdateBankStubAssets using Scriptable Build Pipeline optional. Currently, when using Addressables and FMOD simultaneously while trying to utilize the Content Update feature, it is inconvenient as it requires modifying scripts within FMOD for Unity.

@phanphantz
Copy link

Our team is currently experimenting with FMOD and Addressables for mobile games, and this issue sounds critical since it will break the sound asset update flow.

@jungsooPark-dev , have you found any workarounds? Any temporary fixes or code snippets would be greatly appreciated.

@jungsooPark-dev
Copy link
Author

@phanphantz You can just comment out UpdateBankStubAssets at EventManager.cs

  BuildStatusWatcher.OnBuildEnded += () => {
-     UpdateBankStubAssets(EditorUserBuildSettings.activeBuildTarget);
+     //UpdateBankStubAssets(EditorUserBuildSettings.activeBuildTarget);
  };

and call it manually in your code, after ContentUpdateScript.BuildContentUpdate.

var result = ContentUpdateScript.BuildContentUpdate(settings, contentStateDataPath);
Debug.Log($"[Build Update] Addressable Assets UpdateTime: result.Duration}");
EventManager.UpdateBankStubAssets(EditorUserBuildSettings.activeBuildTarget);

@phanphantz
Copy link

phanphantz commented Sep 25, 2024

@jungsooPark-dev Much appreciated! I tried using your solution to build a content update for the Local Asset Group that has a modified bank inside, but unfortunately, it's still not working for me. The hash doesn't change when I perform an update build. Have you had success with Local Asset Group, or am I missing something?

Another thing to mention is the issue does not happen with Remote Asset Group that is hosted on the CDN. (We use Unity CCD)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants