XCOM 2
Not enough ratings
How to port an MMS music pack to Wwise Mms
By nintendoeats
A simplified guide to using the Wwise Mms music modding framework, narrowly focused on how to port an existing MMS pack. Wwise Mms packs do not experience many of the technical issues that affect MMS packs.
   
Award
Favorite
Favorited
Unfavorite
What is this guide?
This guide is a set of step-by-step instructions for converting an MMS music pack to a Wwise Mms music pack. It does not include information about making interactive music, instead focusing on how to create a Wwise Mms packs from the simple "intro and loop" music segments most MMS packs use.

This guide does not require any previous knowledge of Wwise, or Wwise Mms. You do not need to read the full Wwise Mms guide to complete this guide. Once you know what you are doing, it should be possible to port a standard MMS pack in an hour or two, plus testing time.

Please ask me any questions you may have in the comments, or in the XCOM 2 modding discord.

Why port to Wwise Mms?
Music packs made for MMS always have, and always will, suffer from the following issues:

  • They play through cutscenes
  • They experience stuttering when there are many things going on, becoming more severe as you add more mods (a problem that is much worse with WotC).
  • They do not respect the music volume slider
  • They tend to be large, because they store uncompressed audio.
  • They do not behave properly on the turns of groups other than XCOM or Aliens in WotC.
  • They cannot support after action music.
  • They require some slack when transitioning between music segments, such as between and intro and a looping segment. They are not "sample perfect".
  • Probably other stuff, I am told that MMS is quite broken with WotC.

Most of these issues are a result of the fact that MMS bypasses XCOM's audio middleware (AudioKinetic Wwise) and uses the built-in Unreal Engine 3 audio cue system.

Wwise Mms DOES use Wwise, hence the name. Thus, Wwise Mms packs do not suffer from these technical problems. The drawbacks are as follows:

  • Wwise Mms requires you to use another piece of software (the Wwise Authoring tools) in addition to UDK.
  • Wwise Mms requires slightly more legwork for the simple "intro and loop" design used by most MMS packs.
  • Wwise Mms packs require an installation step by the end user, where they copy the Wwise Sound Banks to their CookedPCConsole folder.
  • If you want to support both Vanilla and WotC, you need to export separate versions of the sound banks for each. If your sound banks are large, you may prefer to make two mods.
Prerequisites
  • It is assumed that you are already familiar with modding XCOM 2 (modbuddy and UDK)
  • You need either the raw music segment files, or the UPK from somebody the MMS mod. If you are porting somebody else's mod, it would be polite to get their permission and credit them for creating the loops.
  • You will need the Wwise Authoring tools.

    If you only want to support WotC, download and install the Audiokinetic launcher (this may require an account) https://www.audiokinetic.com/en/download/
    From there, install version 2016.1.6.5926.

    If you also want to support vanilla, you will also need to install Wwise Wwise v2014.1.6.5318[www.hallmonitor.ca]. This is not available through the launcher. Just extract and run .\Authoring\x64\Release\bin\Wwise.exe.
NOTE: If you want to support both Vanilla and WotC, you must use the 2014 version to do your work. After you generate your soundbanks, you will need to copy your Wwise project, open the copy using the 2016 tools, then export your soundbanks again. If you only want to support WotC, just use 2016. You can support vanilla and change your mind later, but you cannot start with only WotC support and then backport to vanilla.
Example project
This guide is was written while porting the Solar 2 soundtrack. The Wwise and Modbuddy projects are included here[www.hallmonitor.ca] so that you can use them as an example. Additionally, you will be asked to use one of the config files as a starting point for the configs in your mod.

The example project is set up for WotC, it does not support vanilla.
Overall procedure
This is the general set of steps you will follow to port an MMS pack to Wwise Mms.

  1. Extract the music segmentsfrom the UPK (if needed).
  2. Add the music segments to a Wwise project.
  3. Add the music segments to playlists.
  4. Create Wwise Events which play those playlists.
  5. Add the playlists and events to sound banks.
  6. Export the sound banks from Wwise.
  7. Create a UPK that makes Unreal Engine aware of the Wwise Events.
  8. Create UnrealScript config files that tell Wwise Mms about the Wwise Events.
  9. Put the soundbanks in the correct folder.
  10. Build, test and publish.
  11. (Optional) provide your users with an install script.

Extracting music segments from the MMS pack
This section describes how to extract audio files from an MMS pack's UPKs. If you already have the files you can skip this. However, you may find it useful to have the UPK open so you can look at the sound cues to know which music segments go together.
  1. Open UDK.
  2. Go to Packages -> [folder icon] -> your UPK
  3. Select the UPK in the package list.
  4. Filter for Sound Wave Data objects.
  5. Select all of the sound waves.
  6. Right-click one of the objects and select "Bulk Export to Folder".
  7. Choose where to save the files.
At this point you should have a folder populated with the original WAV files.
Creating the Wwise sound banks
This section describes how to import music data to Wwise and expose music tracks using Wwise events.

NOTE: Sometimes I say that you must assign a name that is "unique", This means unique across all XCOM 2 mods. I usually include my own name in these cases to ensure that there is no name collision.

In the Wwise authoring tools, create a new project. Disable all asset imports.



Press F10, or go to Layouts -> Interactive music. This will open several windows that you will need.

Right click Master-Mixer Hierarchy -> Default Work Unit-> Master Audio Bus, Select New Child-> Audio Bus. Rename the new bus to MasterDynamics. Repeat this process to create the following hierarchy:



Drag and drop your audio files onto Interactive Music Hierarchy -> Default Work Unit. The default settings are fine. This makes a copy of the files; you can delete your originals.

At this point you have two options, you can either create a separate playlist for each track or create a single playlist for each phase of the game, which selects a music track at random.

Creating a single playlist means that your music will be selected less often However, it saves time later on and gives you different options when it comes to creating your music definitions. Look at the Solar 2 strategy definition for an example.

To create one playlist per track, do the following for each track (here I assume that there is an intro and a looping segment):
  1. Right click the Default Work Unit and select New Music Playlist Container.
  2. Drag the music segment for the track into the playlist, as shown in this image:



  3. Click the playlist.
  4. Set the Output Bus for the playlist to Music_NoFilter.
  5. Drag the music segment into the Music Playlist Editor and configure them as shown in one of the images below. Note how in either case the intro is configured to play once, and the loop will play infinitely. Note that this editor is only available if you are using the interactive music layout, as mentioned above (press F10).
  6. Click the playlist again.
  7. Click the Transport Control -> Play button to verify that everything is working.
  8. Optionally, adjust the volume of the playlist using the Voice control under General Settings.
    This is the correct way to set the volume of a specific pack. Make sure you are adjusting the playlist volume, not the individual music segment volume.

To have one playlist per track, set up your playlist like so:


To put all tracks in a single playlist, set your playlist up like so:


Select one of the playlists and go to the Source Settings tab of the property editor. in the Conversion Settings area, click Edit... In the window that opens, under Windows, set the format to ADPCM, and set the Sample rate to Auto High. This should shrink your audio files considerably with no appreciable loss in quality. Since you are adjusting the defaults, you only need to do this for one playlist and it will apply to the others automatically.

Now you need to create events which start your playlists. Go to the Project Explorer's Events tab. For each playlist:
  1. Add a Play Event to the Default Work Unit.
  2. Rename it to something unique.
  3. In the event Editor, right click the Play action and select Browse.
  4. Choose the appropriate playlist.



Once you have done this for all playlist, go to the Project Explorer's SoundBanks tab. Create a new sound bank and give it a unique name starting with WwiseDefaultBank_. Double click it to open the sound bank editor. Drag and drop your playlists and Events into the Add tab of the sound bank editor.




In the project explorer, right click the Sound Bank and click Generate Soundbank(s) for current platform. After the process has completed, right click again and select Open Containing Folder.



Take a look at the size of the generated bank. If it is larger than ~70 MB, you will need to distribute your music pack across multiple banks. To do so, simply uses the SoundBank editor to delete some of the playlists from the existing SoundBank, then redistribute them. Note, if you have to do this then it will cause some inconvenience in UDK. Most packs are large enough that this is necessary; in the case of Solar 2, I simply extracted one track to another bank.

You should now have one or more sound banks compatible with either vanilla or WotC depending on which tools you used.
Creating the bank and event associations in UDK
Unreal cannot read the contents of a sound bank. Instead, you must cread AkBank and AkEvent objects in a UPK, which UE3 uses to find the events and forward them to the Wwise audio engine. This section describes how to create those objects.

Open UDK, and do the following:

  1. Create a new package. If you only have one sound bank, give this package the same name as the soundbank (minus the WwiseDefaultBank_ part). Otherwise, it doesn't matter what you call it.
  2. For each sound bank, create an AkBank object in the package with the same name as the sound bank in Wwise.
  3. For each event, create an AkEvent with the same name as the event in Wwise.
  4. If the event is in the soundbank called WwiseDefaultBank_PackageName, UDK will automatically set things up so that the engine looks for that event in the bank with that name. Otherwise, you must specify which soundbank contains the event. To do so, Open the AkEvent's property editor and change Required Bank to the name of the bank.

The end result should look something like this:



One option to make this more convenient could be to have one packaged per bank, in which case you can name your banks such that you do not need to configure the required bank.

In the Solar 2 pack, you will note that most events are in WwiseDefaultBank_PackageName, and only one is in a different bank.
Creating the associations for Wwise Mms
At this point you should have:
  • One or more soundbanks which contain your music segments and events.
  • One or more UPKs which tell UE3 about those sound banks and events

Now you need to create config files which tell Wwise Mms about the events. To do so:
  1. Create a mod in Modbuddy, the same as you normally would.
  2. Copy the XComWiseSound.ini config file from the example Solar 2 project.
  3. Fill it in for your mod, with one "Music Definition" per track.

    Set "Append" to the name of the package with a period (for example, "AdriansSolar2MusicPack_W.")

    Set "Start_EventPath" to the name of the event that starts the track. For the tactical and strategy screens, only fill in this field for situations the music should play for. For example, If you have music for exploration, you want to fill in the "ExploreExposed_StartEventPath" and "ExploreConcealed_StartEventPath"

  4. Optionally, if you are feeling advanced, you can create one music definition associated with several tracks.

    For example, if you have a combat track and an explore track which go well together, you can have one music definition with "ExploreExposed_StartEventPath" set to an event that starts the explore track, and "XCombat_StartEventPath" set to an event that starts the combat track. If this music definition is already playing in explore mode, Wwise Mms will automatically use the specified combat track when combat begins.

    An example of this technique is seen in the "Discoveries and Constellations" strategy definition in the solar 2 example project.

Once you have done this for all your tracks, build your mod as usual and test it. YOU MUST MANUALLY COPY YOUR SOUNDBANKS TO THE XCOM 2 COOKEDPCCONSOLE FOLDER. The game WILL NOT look for them in the mod folder. Your users will also need to do this. I describe a partial workaround later in this guide.

Generally, you want to make sure that your main menu definition is working. This verifies that the whole chain of components is wired up properly Then worry about everything else.
Packaging
The only distinction between an MMS pack and a Wwise Mms pack is that you must distribute the sound banks. You should included those in your project and distribute them with your mod. Unfortunately, XCOM 2 does not look for those in the mod folder; they have to be copied to the CookedPCConsole folder.

You have 2 options:

  • Tell the user to copy them.
  • Provide a batch file that creates hard links from the CookedPCConsole folder to the mod folder.

The advantage of the first method is that it's simple. The advantage of the second method is that you can push changes to your soundbanks after release.

If you choose to give the user a batch file, you will need to publish your mod to find out what folder it is placed in. Then, create a bat file from these templates. Add a new mklink line for each bank, with the correct names and folders.

Vanilla
cd %~dp0 mklink /H "%~dp0steamapps\common\XCOM 2\XComGame\CookedPCConsole\SSC_PlaceholderBank_1.bnk" "%~dp0steamapps\workshop\content\268500\1428252618\Banks\SSC_PlaceholderBank_1.bnk" pause

WotC
cd %~dp0 mklink /H "%~dp0steamapps\common\XCOM 2\XCom2-WarOfTheChosen\XComGame\CookedPCConsole\AdriansSolar2MusicPack_W2.bnk" "%~dp0steamapps\workshop\content\268500\3016678828\Banks\AdriansSolar2MusicPack_W2.bnk" pause

You can either put the batch file in your mod folder, or provide it by a separate link. the user needs to run this batch file from their steam folder.

Vanilla and WotC
If you want to support both Vanilla and WotC, you need provide banks created with both 2014 and 2016 versions of Wwise. If you create 2 mods this is less convenient for you, but providing banks for both requires people to download twice as many sound banks.
7 Comments
nintendoeats  [author] 20 May, 2024 @ 7:02am 
@neochen' Good point, thank you.
neochen' 20 May, 2024 @ 1:40am 
I kinda figured out things I've needed already, but since you've replaced this file you might wanna also replace the "The Wwise Mms Resources Package" from your other Wwise MMS guide.
nintendoeats  [author] 18 May, 2024 @ 7:15pm 
@neochen' Mea culpa, I completely changed my website recently (by which I mean, I actually started using it), and I forgot that file was linked. The file has been restored.
neochen' 15 May, 2024 @ 2:12am 
> https://www.hallmonitor.ca/share/Wwise_Solar2MusicPack.zip

The requested URL was not found on this server.
:seriousboss:
Evil Artist Man 15 Mar, 2024 @ 12:18pm 
Thank you. :steamthumbsup:
nintendoeats  [author] 15 Mar, 2024 @ 11:22am 
Thanks @Artist Fartist. It is fixed.

As a PSA, the link was correct. HOWEVER, chromium-based browsers will silently block downloads if an https address is used to download an http file or vice-versa (I'm mangling the details a little bit, but that's the gist of it). If you ever see your browser silently fail to download a file, you can try downloading it through Firefox instead (assuming you trust the file). This is a particularly annoying feature, and I cannot fathom why the browser does not give a warning to explain what's going on


Anyway, boring detail, in this case I simple needed to add an explicit https to the link and it was happy.
Evil Artist Man 14 Mar, 2024 @ 7:22pm 
Broken link for example mod