Killing Floor 2 Icon KF2 Tutorial

Create proper Soundtrack replacements with Wwise

Greetings! We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending Tarrende points.
  • Post: Give Tarrende your thoughts on this Tutorial.
  • Vote: Help Tarrende win the Monthly Awards.
  • Rate: Give this Tutorial a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Tutorial.
  • Watch: Get notified when this Tutorial is updated.
Mascot

Resistance is futile...

Sign up

Already a Bananite? Login

The Intro

Killing Floor 2 has a very nice and fitting musical selection. But not everyone is a fan of metal or wants to listen to the same old stuff day in day out. The "current" way to modify KF2's playlist is far from ideal, leaving you with cut off tracks or odd stretches of silence.
After a good amount of time, some tinkering and with the help of some talented people I've finally discovered a way to properly create my own custom playlist.
The end result of this tutorial is a fully functional playlist, with no cut-off tracks, silence and working zed time behaviour. It'll feel as if Tripwire themselves blessed you with this fine selection of tunes.

Stage 1 - Preparation

You'll need a few tools to accomplish this mission:
  • Wwise
  • Audio editing/converter software of your choosing (e.g. Audacity)
  • A text editor of your choosing (e.g. Notepad++)
In the case of Wwise it is recommended to get a version/build from 2015. Newer versions seem to cause trouble with Killing Floor 2 and we don't want trouble!
Create a folder for the songs that you wish to put in your playlist. KF2 features around 50 Tracks for Waves and 14 for trader time.
Wwise only likes .WAV files, so convert them to .WAV if necessary.
I will assume you know how to convert a file.

Stage 2 - Building the Foundation

Now put those music files aside, it is time to recreate the soundbank.
First of all we need to know how that bank is supposed to look like and function. So open your KF2 directory and click your way to the WWiseAudio Folder.

Default file-path: SteamLibrary\steamapps\common\killingfloor2\KFGame\BrewedPC\WwiseAudio\Windows

You're going to find a huge stack of .wem files and also some .bnk and .txt files. We don't care about the .wem files so scroll down till you hit the .bnk .txt combos.
KF2's music is split into 2 (technically 3) parts: Action, Ambient (and Menu).
In this tutorial we're going to replace the Ambient portion of KF2 with our own mix. The reason for choosing the Ambient playlist is rather simple: Few amount of tracks > less work to create > less potential errors > a [hopefully] better learning experience.

If you want to work on the Action Music, head down to Stage 5 for a few details to keep in mind while working on that.

The file we need to check out is: WwiseDefaultBank_WW_MAMB_Default.txt
It contains a table with all relevant information related to that soundbank. For example which songs it contains and which events it is responding to.
Now would be a good time to start Wwise.
Create a new Project, give it a suitable name for example "KF2_Ambient_Tutorial" and press OK.

In the Menu bar click on Project > Project Settings (or Shift + K) . Navigate to the Source Settings tab and click on the [...]-Button next to Default Conversion Settings.
Expand the tree to Factory Conversion Settings > Vorbis > Vorbis Quality High. Confirm your changes and move your mouse back to the Project Editor, Audio Tab.

Our objective now is to recreate the content of the soundbank.
Let's start by setting up the audio container for our tracks.
In the Project Explorer right-click on Default Work Unit under Interactive Music Hierarchy and hover over "New Child" and create a new Music Segment.
If we look at the first play event in the text file it'll say: Play_MAMB_Z_AssemblyLab, so we're going to name this Music Segment MAMB_Z_AssemblyLab.
Repeat this for every Play-Event mentioned in the text file.
If you're done it should look like this:

Now click the Events Tab in the Project Explorer, we are now going to recreate the play and stop events found in the text-file in the same manner we created the Music Segments.
Right-click on the Default Work Unit in the Events folder, select New Child > Play. This will, you guessed it, create a Play-Event.
Name this one Play_MAMB_Z_AssemblyLab and confirm with Enter. Select your newly created event and more detailed information will show up on the right in the Event Editor. Notice the Event ID in the top right corner? Check if your Play-Event has the same ID as stated in the text-file. If the numbers are not the same, you have a typo somewhere. This needs to be accurate otherwise the game will have trouble calling the event.

Now, if you look at the Event Actions you will notice that the first action is to play a [Missing] object. Right-click [Missing], select "Browse..." and select the correct Music Segment from the list. Now the Event knows which track to play and we're almost done with this event. In the Event Editor at the bottom we have the Action Properties where we're going to  set a little fade-in for our event so the track doesn't just BURST into action. This is a bit of personal preference but lets go for a 1 second fade-in, adjust the curve if you like.
Recreate the rest of the play and stop events in the same manner.
Creating Stop-Events is the same as Play events, make sure to select Stop and not Stop All or Stop All Except. Also don't forget to set a little fade-out so we get a nice cross-fade between tracks.
Our foundation is almost complete!
The last thing missing: the correct Audio Bus
KF2 plays different type of sounds and music on a different Bus (think of it as a conveyor belt or tube) and also uses them to apply effects to them. For example slowing them down while Zed Time is active.
While this is not that important for the ambient tracks, knowing about it will help you when you're going to replace action tracks or sound effects.
Now how do we know how Tripwire set up their Bus?
In the Wwise-Folder of KF2 you'll find a Init.txt file, which contains a list of Game Parameters, States an their Bus setup.
Scroll down till you find a block labelled Audio Bus.
We are working with ambient tracks, so lets look for MUS AMB.
Back in Wwise head back to the Audio tab.
We have to recreate this:  \Default Work Unit\Master Audio Bus\MUS\MUS AMB
Right-Click on the Master Audio Bus, select "New Child" > Audio Bus and name it MUS. Then create a new child for MUS and name it MUS AMB.
All that is left is to set the MUS AMB Bus for all our Music Segments. So select a Segment and look for Output Bus in the Property Window hit the [...]-Button and select the Bus.
After doing that for all your Segments you're done with your foundation!
It's almost time for the fun part.

Stage 3 - Importing your Mix-tape

Before we import our files it is important to check again if our conversion settings are set to Vorbis high.
Look in the Property Editor in the Source Settings Tab for a Music Segment to see which conversion settings are selected. If it is Vorbis High, you're good to go. If it is Default Conversion Settings  you have to change that.

Right-Click on Default Work Unit under Interactive Music Hierarchy and select "Import Audio Files..."
Click on Add Files... and select your .Wav files.
Click Import and Wwise will nest them in your Music Hierarchy in separate Music Segments containing 1 Track each. This just bloats our nice structure! So expand those segments, grab the audio file within and drag them over to one of our previously created Music Segments. And while we're at it, let us change the audio to be streamed instead of being stored in memory. There is no need to bloat the games memory usage with a ton of track which may get never picked to play. To accomplish that select the audio file and set a hook for Stream, top right corner in the General Settings Tab.
We can delete those empty segments afterwards to clean up our layout.
If everything is done it should look like this:

You can use the Play-Button at the bottom to listen to your work, be warned though it could be pretty loud.

Stage 4 - Volume Adjustments & Bank building

It is time to even out the volume between tracks and in general.
Select a Music Segment and open the Source Settings Tab in the Property Editor. At the bottom you'll find the Make-Up Gain value. Let the Track play till it reaches its general 'loudness' and have an eye on the peak meter to the right. The general loudness of music in the game is at around -6. So adjust the gain as needed to reach that value and repeat that for each track.
Switch over to the Advanced Settings Tab and crank up the Playback Priority to 100. Wwise will only play a certain amount of sounds at a time, so everything with a low priority usually gets silenced and nothing is worse than a horde of zeds with no music, right?

If everything is in place and works, it time to bundle our mess into a file structure KF2 can handle.
In the Project Explorer head over to the Soundbanks Tab. Create a new Soundbank via Right-Click > New Child > Soundbank.
You could name it something like Ambient to make sure you know which is which. Or if you trust your file managing skills a little more name it WwiseDefaultBank_WW_MAMB_Default (Saves you renaming files later and a lot of time by having to recompile your banks over and over, because you find issues that need fixing.) and press F7. This will open up the Soundbank Manager. Select your newly created Soundbank in the Manager window, head over to the Audio Tab in Project Explorer, select everything under Interactive Music Hierarchy and drag it over into the Hierarchy Inclusion in the Soundbank Editor Window.

Now all that is left is to build that bank.
Make sure Windows as a platform is selected on the tab further right. Right-Click your Bank in the Soundbank Manager Window and click on Generate Soundbank for current platform.
The process may take a while, specially the first time if you haven't converted your audio files to Vorbis High (you can do that at any time by selecting Project in the Menu bar and clicking 'Convert all Audio Files...').
When the process is done, right-click your bank again and select Open Containing Folder (Bankname.bnk) to see the results of your hard work. Open up the bankname.txt and the original to compare your number of events and IDs.
Since the play and stop events are ordered in a very chaotic nature, it is bound to happen that you miss one or overlooked a typo. If anything is missing just add it into your project and generate the bank again.

Before you copy over the files to the KF2 directory, make a backup of the original .bnk and .txt file you're going to replace.

Copy over:
  • the .wem files
  • bankname.bnk
  • bankname.txt
into the killingfloor2\KFGame\BrewedPC\WwiseAudio\Windows directory

Considering the numbering of .wem files it may happen that your bank will generate a number already taken from the original banks by Tripwire (hasn't happened to me yet, but it is a possibility!). Better double check what you're overwriting, it could lead to comical results or certain sounds simply just stop playing.

Stage 5 - Play testing and Beyond

The moment of truth is near! Time to boot up KF2 and play a nice solo game.
Since we've picked the Ambient Music Bank for this test, we'll be able to hear our tracks already in the waiting lobby.
Also a good time to enable cheats and use "NextTrack" to skip to test all tracks functionality in a timely manner.
If you hear silence, certain songs refuse to play or the volume is way to loud/quite compared to the rest of the audio, head back to Wwise and track down your cause.
This is the frustrating part, since it can be something as simple as a typo or missed check-box which often may not be that obvious.
But let us assume everything went well, you may have to go back and adjust the volume a little - but it werks!

What if you want to replace the Action Portion of the soundtrack?
The process is basically the same, with a few things added.

  1. There exist instrumental and vocal versions of many tracks. Both have their own play-event, but they share a stop-event. Use that [>>]-Button in the Event Editor for additional event parameters.
  2. You want the Audio Bus to use Auto-Ducking (for those volume adjustments during zed time and FP/SC roars) unless you don't want that, but let us assume you do.

Select the MUS bus, click Insert... under Auto-Ducking and choose the MUS ACT Bus.
No setting changes or anything else required.

Stage 6 - I like my bugs squished

Is this process perfect?
Nah.
Is it almost perfect?
Pretty much.
What will happen is that sometimes a track refuses to play (even though it works). Happens when a lot of events start, like the start of a wave for example. Wish I could say for sure what is causing that, might be the bank setup itself not being perfect or my computer having trouble loading everything in time. If you find out what it is though, let me know.

Can I expand the track list?

With clever usage of random containers and a slightly different bank structure, yes. You could put up to 200 tracks into your playlist (or even more if you're the lucky owner of a Wwise license). I highly recommend audiokinetics documentation and tutorials for that. Having a better understanding of the software itself will help you realise your own ideas.

Do I have to set up all those events and structures every time I make a mod?

You can just re-use the structures for the most part. Once you have everything set up, you can just easily remove audio files and replace them, cutting out a lot of the initial work.

Posts

None found

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Key Authors
Tarrende
guinea pig
Contributors
Paulcon-1
sharing his knowledge with me

Submitter

Tarrende avatar
Tarrende Offline
Member Joined 5y
426 points Ranked 9733rd

Tarrende
Creator
Send a Private Message to the submitter

Category

Details

Difficulty Level
Intermediate Difficulty

Attributes

Stats

Posts
0
Views
389
Date Added
3mo

Rating

  • Not yet rated