Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

+1 vote

My team has been running into a problem when multiple people are using Wwise in a Unity project.

Wwise in Unity uses WwiseEventReference assets (based on ScriptableObject) to serialize what events are used by a component. However, these assets are generated from the native Wwise project data lazily - i.e. the asset for an event doesn't exist until the first time someone drags that event onto a component.

The problem is that when multiple people use Wwise in the project, both might drag the same event for the "first time", thus generating two unique WwiseEventReference assets for the same event. When the two try to merge in source control, the assets conflict and one person's event uses must be re-done with whichever asset is chosen to overwrite the other in conflict resolution.

  • User 1 makes changes to the Wwise project
  • User 1 opens Unity and the Wwise Picker updates - this updates AkWwiseProjectData.asset
  • User 1 commits to source control
  • User 1 then drags a new Wwise event - Event A - from the Wwise Picker onto a component
    • This creates an AkWwiseEventReference asset for Event A - Asset A - in User 1's local copy of the Unity project
  • User 2 pulls the latest commit from source control
  • User 2 drags Event A onto a component
    • Since User 1's AkWwiseEventReference Asset A is not in source control yet, this creates a new Asset A in User 2's local copy of the Unity project
  • User 1 commits to source control
  • User 2 tries to pull the latest commit from source control
    • A conflict occurs as source control tries to pull User 1's version of Asset A but User 2 already has one
    • User 2 chooses to overwrite their version with User 1's version
  • User 2 no longer has a reference to Event A in the component(s) they dragged it onto
    • Unity generates a random GUID for every asset created, which will not be the same for User 1 and User 2's versions of Asset A
    • Unity uses the GUID to track references, so the GUID stored from User 2's original use of Event A is now invalid and the reference has been lost

In my opinion the ideal solution would be to ditch lazy asset generation, and eagerly generate the Unity assets for new events as soon as the Wwise project is updated.

In the meantime I've written an import post-processor to force this behaviour:

using UnityEditor;
public class WwiseProjectImporter : AssetPostprocessor {
    const string PROJECTDATA_PATH = "Assets/Wwise/Editor/ProjectData/AkWwiseProjectData.asset";
    static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths){
        var data = AssetDatabase.LoadAssetAtPath<AkWwiseProjectData>(PROJECTDATA_PATH);
        foreach (var wu in data.EventWwu){
            foreach (var e in wu.List){
                WwiseObjectReference.FindOrCreateWwiseObject(WwiseObjectType.Event, e.Name, e.Guid);
            }
        }
    }
}
 
in Feature Requests by Luke T. (110 points)
Having the same issue - can this please be addressed?

Please sign-in or register to answer this question.

...