23 June 2024

Integrating Wwise 2023.1 as a plugin for Unreal 5.4

This past semester I've been teaching a few classes for the 2nd year sound students at Howest - Digital Arts & Entertainment in the course "Sound Integration 2". Main goal: make them accustomed to use C++ in Unreal, but also make them able to integrate Wwise as a plugin in an Unreal project without destroying the project for their peers.

In courses where the sound students work together with art and programming students on game projects, we often had the situation where the sound student wanted to use the Wwise plugin, tried to add it to the project and subsequently broke the project for everyone. After a few hours of trying to get it fixed they usually give up and just use the built-in audio tools in Unreal, or use Fmod.

But we want them to be able to use Wwise, so we need to fix this. I myself have little knowledge of Wwise, but I do know a bit of C++ and Unreal so that's why I took a shot at clarifying for the students how they should integrate Wwise. 

And boy, it is indeed not for the faint of heart. The following is a summary of my research into this to get to a completely working plugin, but it took me quite a while to iron out all the details. There are numerous sources that guide you in this, but they're all very specific to a certain Wwise and Unreal version. The same goes for this blog post of course, although the below steps work for multiple versions.

Wwise as a local plugin

Turns out, there are two ways of integrating Wwise into Unreal, either as a local plugin to your project, or either as an engine-wide plugin. Let's start locally as this is the easiest way.

  •  Make sure to install Wwise 2023.1.x - there are quite some differences between different Wwise SDKs so no guarantees are given that this process will work for other versions. I used 2023.1.0 when I started writing this article and now I've updated to 2023.1.4. You need to repeat this process if you update Wwise.
  • Make sure to have Unreal 5.4.2 installed - same deal, there are differences between Unreal versions that might make this process different. I've also tried this with 5.3.2 and the process is the same. And again you need to repeat this process if you update Unreal.
  • If you don't have one already, create a new C++ Unreal project.
  • In the Wwise launcher you can now click the "Integrate Wwise in project..." button


  •  Set everything up as requested


  • If you leave the Wwise project path empty, a new Wwise project will be created inside the Unreal project. I'd rather not mix these so I recommend creating a Wwise project first next to the Unreal project and then entering the path to that project here, as in the screenshot.
  • If you do create a separate Wwise project then don't forget to point the soundbank folders to the Unreal project

  • I recommend adding an event with a simple test sound to verify your integration.
  • When Wwise is done integrating you can open the Unreal project. The plugin will be automatically active.
  • In the project settings we need to target the Wwise project and define the Soundbanks folder


  •  And enable this so assets get reloaded after banks are generated:


  •  Via Window -> Wwise browser the soundbanks can now be generated

  •  There should be a folder WwiseAudio in the content browser containing a soundbank


  • If not, I noticed it helped to restart Unreal.
  • I've added an AKAmbientSound actor in the scene that uses an AK event to play my test sound. That should be functional now.

And done! We have now a working integration of the Wwise plugin in our project! At a whopping size of 7.3GB! If you use git for your versioning needs you'll notice that git is quite unable to sync this. Perforce (what we use at DAE) can handle it, but it still slows down everyone's progress a lot.

Wwise as a an engine plugin

One way to avoid having to upload this enormous plugin is to have the plugin engine-wide instead of inside the project. With this approach all your peers need to install the plugin in their engine (once), but at least it's not part of the project anymore. For this approach Wwise gives us a nice warning:

They were not kidding... Let's be experts here:

  • Close Unreal, we'll be creating the plugin via command line. 
  • The Wwise plugin is configured to be enabled by default, switch that off or all your Unreal projects, whether or not using Wwise, will load the plugin and that's not desired. In the Wwise.uplugin file which you can find in your Unreal project, change this line from true to false.
"EnabledByDefault": false,
  • For some reason the Wwise.uplugin is missing some modules it need to be compiled as an engine plugin, so in that file, add the text below at the end of the modules list. Note, this seems to be fixed in Wwise 2023.1.1, so from then on this step is obsolete.
,
{
    "Name": "WwiseUtils",
    "Type": "Runtime",
    "LoadingPhase": "None"
},
{
    "Name": "WwiseProcessing",
    "Type": "Runtime",
    "LoadingPhase": "None"
},
{
    "Name": "WwiseEngineUtils",
    "Type": "Runtime",
    "LoadingPhase": "None"
},
{
    "Name": "WwiseObjectUtils",
    "Type": "Runtime",
    "LoadingPhase": "None"
}
  •  Open a terminal and navigate to this folder in your Unreal installation: "Unreal\Build\BatchFiles"

  • Now run this command (change YourProjectPath with the path to the project you integrated wwise with):
    .\RunUAT.bat BuildPlugin -plugin="C:\YourProjectPath\Plugins\Wwise\Wwise.uplugin" -package="C:\Temp\Wwise" -TargetPlatforms=Win64
    If all goes well, this should build the plugin. In the package parameter we specify where this plugin should be placed, in the example it's "c:\Temp\Wwise".


    This takes a while though, so go grab lunch.
  • Copy the folder "ThirdParty" from the local plugin to the build plugin. We now have all the files for the entire engine-wide plugin.You can zip the content and distribute as you like.
  • We don't need everything actually, for example the ThirdParty folder contains files for Visual Studio 2019 as well so if you're only using Visual Studio 2022 you can remove those older files. Same for when you're not targeting Win32 computers


  • To install into Unreal as an engine plugin, place the content of the build Wwise folder in the Plugins\Marketplace folder of your engine. If that folder does not exist yet, create it.
  • We can now remove the Wwise plugin from your project folder, since we don't need the local plugin anymore.
  • Since the plugin is no longer enabled by default (as it should) we should enable it specifically for our project. That can be done via the project settings in Unreal or simply add it with a text editor in your uproject file:
{
    "Name": "Wwise",
    "Enabled": true
}

If we open our Unreal project the Wwise integration is still completely functional + our project is a 7.3GB smaller.

 Let me know in the comments if this has helped you in any way!

No comments: