Age of Empires II: Definitive Edition

Age of Empires II: Definitive Edition

63 ratings
Audio Modding Guide
By StepS
A guide to modifying or adding new audio in-game, as well as using them in scenarios.
   
Award
Favorite
Favorited
Unfavorite
Introduction
With the release of AoE II DE, many were left wondering about the moddability of the in-game sounds. Understandably, not everyone will like the changes to the sound effects. Some people would like to change which sounds are played where, or introduce new sound effects into custom scenarios. This is where modding comes in handy.

However, modding sounds is no longer as straightforward as simply adding, replacing or substituting .wav or .mp3 files. Because the audio engine is now powered by Audiokinetic WWise, there are some new things to know before attempting to create audio mods. This guide will provide you with the necessary information on how to use existing sound effects in scenarios, add new effects, rearrange audio in the DAT file, and cleanly substitute in-game sounds and music with your own custom files. The goal is to make this process as simple as possible for modders.

NOTE: This guide is still a work-in-progress as more information is added, and older information is updated with game patches. Several known issues with the modding system are listed below, with the development team working on resolving them for future patches.
[REQUIRED] Sound Events and Audio Sources table
Because of the WWise system, sound files no longer have meaningful names. Some of them are visible as .wem files with random numbers in the name, others are packaged as part of soundbanks (.bnk). Moreover, not all of them accurately represent how a sound event is played in-game, because sound events may combine several of these sources with varying settings, configured to play together.

In order to bridge this gap, I've created this spreadsheet[docs.google.com]. What does it include?
  • Every Event Name linked to its Event ID. Event Names are necessary to make soft substitions of audio in drs\sounds and to use stock sound effects in the Scenario Editor. Event IDs are necessary to reassign sound bindings in the DAT file (with Advanced Genie Editor).
  • Audio Source Names linked to their IDs. This is for people extracting the stock files, so that they can know what they are working with. The numbers in the .wem filenames come from here. Note: some of the sources listed there are not actually found in the game, because they are not used. This is normal and they can be ignored.

These will be needed for nearly every type of modding below.
Using stock audio in Scenario Triggers
Let's say you wanted to make use of any existing sound in the game and put it into a scenario.
  • Create a new trigger with the "Play Sound" or "Display Instructions" effect.
  • Check the Audio Spreadsheet (linked at the top of the guide) and input the Event Name that you want.

Notes:
  • Event names are not case-sensitive.
  • There are two types of events: 2D and 3D. At this moment there is no visible separation between them in the spreadsheet, so you will have to keep in mind their characteristics below.
    • 2D events are not bound to any specific location on the map, and are played at the middle of your stereo setup without any panning. Examples are UI sounds (button clicks, notifications, unit select and move orders, etc.). These can be used in both "Display Instructions" and "Play Sound" effects without any restrictions.
    • 3D events make use of in-game coordinates and will have panning. These are normally battlefield effects (explosions/gunpowder, melee/ranged sounds, villager working effects, death screams). They cannot be used in "Display Instructions" effects. They can be used in "Play Sound" as long as Location is set for them to play on the map. The Location requirement for 3D sounds may be removed in future updates.
Pictured: example Play Sound effect with "Play_Chat_Received" as the sound.
Using new (custom) audio in Scenario Triggers
  1. First of all you will need to prepare your source files into WEM files. I cannot provide specific help with that, however user-created guides for doing this are available. I'm going to create a converter tool for WAV and OPUS formats in the near future, which will not require you to have WWise installed at all.
  2. Create a new mod in your personal AoE2DE directory. Example: C:\Users\Admin\Games\Age of Empires 2 DE\46461161022890482\mods\local\SoundMod1
  3. Within that mod directory, create folders in the following order: resources\_common\drs\sounds
  4. Place your converted WEM file inside the sounds folder.
  5. When adding your "Display Instructions" or "Play Sound" trigger (see the paragraph above), specify the filename of your sound without the WEM extension. For example, if your file is named "custom1.wem", input "custom1".

When packaging your scenario, package it in the same mod alongside audio files (using resources\_common\scenario).

Pictured: example of the "Play Sound" effect with "custom1.wem" as the custom sound file.
Overriding In-game SFX
  1. First of all you will need to prepare your source files into WEM files. I cannot provide specific help with that, however user-created guides for doing this are available. I'm going to create a converter tool for WAV and OPUS formats in the near future, which will not require you to have WWise installed at all.
  2. Create a new mod in your personal AoE2DE directory. Example: C:\Users\Admin\Games\Age of Empires 2 DE\46461161022890482\mods\local\SoundMod1
  3. Within that mod directory, create folders in the following order: resources\_common\drs\sounds
  4. Place your converted WEM file inside the sounds folder.
  5. Check the Audio spreadsheet (linked at the top of the post), the Unit Sounds tab*. Find the Sound that interests you and copy its corresponding File Names. Rename your files to match. Make sure that you cover all variations of your sound with your replaced ones.

* Alternatively, you can use Advanced Genie Editor to check out what sounds with what names are bound through the Sounds tab (see the bottom of the Guide).

Want to have Original Sounds in the game? Check out these mods!

Known Issues:
  • Individual Civilization Jingles (short audio cues that play when you press "Start Game" in single player, and not the Civ Themes) cannot be modded at this time. However, you can place a file called "Civilization_Jingle.wem" to override all civilization jingles at once.
  • Looped sounds (burning fire) are currently not supported with this. The loop will not be preserved and the sound will play just once. This is a known issue that is being looked into.
  • Various in-game effects, such as sword clanks, arrows, mango shots etc., and some UI effects are not properly capped to cancel one another when a lot of them are played at the same time. There is a workaround in place to prevent them from stacking up volume, however. This is a known issue that is being looked into.
  • It may not be always possible to preserve the same variety of randomly-picked sounds for certain effects compared to the vanilla DE soundbanks. Some sounds (like all DLC birds after AoC) are bound to one same entry like in the legacy game. These can be corrected/expanded with a data mod however, and will be slowly addressed with game updates.

Pictured: Arrow sounds overridden as in the "Original Sounds" mod pack.
Overriding and Adding Music
  1. First of all you will need to prepare your source files into WEM files. I cannot provide specific help with that, however user-created guides for doing this are available. I'm going to create a converter tool for WAV and OPUS formats in the near future, which will not require you to have WWise installed at all.
  2. Create a new mod in your personal AoE2DE directory. Example: C:\Users\Admin\Games\Age of Empires 2 DE\46461161022890482\mods\local\MusicMod1
  3. Within that mod directory, create folders in the following order: resources\_common\sound\music
  4. Place your converted WEM file inside the music folder.
  5. Check the list below to rename your file accordingly.

If you want to have original music in the game, check out this mod:

You can add up to 99 tracks (01-99) for each type of music, except ingame. They will be randomly picked.
Valid music filenames (## = number, e.g. 01):
  • credits##.wem - currently NOT played, the Credits menu uses main menu music instead.
  • frontend##.wem - also known as "Open", the main menu opening music.
  • history##.wem - history background tracks.
  • lobby##.wem - played when in lobby or lobby browser.
  • lose##.wem - music files when losing.
  • map##.wem - played when a campaign map is open.
  • win##.wem - music files when winning.
  • ingame##.wem (01 - 30) - in-game music.
  • Aztecs_theme.wem (and other civilizations, check the spreadsheet) - civilization themes.

All music filenames are currently CASE-SENSITIVE (as displayed above and on the spreadsheet).

Known Issues:
  • Modded menu music lacks fade-ins and fade-outs when changing between menus.

Pictured: first 8 ingame music tracks replaced through modded WEM files.
Adding New Taunts
  1. First of all you will need to prepare your source files into WEM files. I cannot provide specific help with that, however user-created guides for doing this are available. I'm going to create a converter tool for WAV and OPUS formats in the near future, which will not require you to have WWise installed at all.
  2. Create a new mod in your personal AoE2DE directory. Example: C:\Users\Admin\Games\Age of Empires 2 DE\46461161022890482\mods\local\TauntMod1
  3. Within that mod directory, create the following folders:
    • resources\<language>\sound\taunt (for all languages that you want to support)*
  4. In the taunt folders, name your files as follows: "<taunt number> <Flavored taunt text>.wem". Example: "324 This is a very special taunt!.wem". Typing the number 324 will result in the taunt playing in-game.

If you want to override existing taunts, you need to use files such as "Taunt_98.wem" in resources\_common\<language>\sound\taunt (for a specific language) or in resources\_common\drs\sounds (to override the taunt in all languages).

* If you did all of the above, and the taunts are not working, you may have to duplicate all sounds you added in taunt to the resources\_common\drs\sounds folder. This is a known issue that is being investigated.
Changing or adding sound bindings in the Data File
  1. Open your AoE2DE directory.
  2. From the "Tools_Builds" folder, launch "AdvancedGenieEditor3.exe".
  3. Enter the correct paths to the "empires2_x2_p1.dat" and "key-value-strings-utf8.txt" files and proceed.

To add a new sound into the game and bind it to unit/graphics:
(This procedure is nearly the same as in AoE II: HD Edition, with the two exceptions that files are encoded in WEM instead of WAV, and that they are referred to by their literal filenames declared in Sound entries instead of "Data Resource IDs".)
  1. Create a new group on the Sounds tab.
  2. Add filenames, delays and probabilities as needed. Notes:
    • The files will be looked up at resources\_common\drs\sounds in either your mod directory, profile directory or game directory.
    • The file extension does not matter and can be left empty here, however must be WEM in the target folder, and if you choose to use a different one, the game will replace it by .wem during file lookup anyway.
    • Don't forget to "Auto-odds" when done adding files if you want each file to be randomly played with even odds (up to the maximum of 100). For example, with 4 files, setting auto-odds will mean 25, 25, 25, 25 for each file, with the maximum of 100. At the same time, using 4 files with low odds like 1, 1, 1, 1 for idling animals will mean that the sound will rarely be played at all.
  3. Fill the sound ID into the Dark Blue cells of unit or graphics Sounds you wish to replace.
  4. Optional: if you want people who somehow don't have your audio file to still hear something as a fallback, you can add an Event ID into the cyan box nearby, that will play one of the built-in sound events (please refer to the Spreadsheet for Event IDs).

To remap an existing sound to another sound:
  • Unit sounds: choose the unit you want and change the blue and cyan boxes in the "Sounds" section: these are the new Sound fields. The values inside the cyan box represent Event IDs (refer to the spreadsheet) for those who are not using modded sounds, while values inside the blue box refer to modded Sound groups on the Sounds tab, with filenames bound to files in resources\_common\drs\sounds (created only by mods). You should remap both IDs to make sure that both unmodded and modded users hear what they are expecting to hear. Example below for the Fishing Ship:

  • Graphics sounds: choose the needed graphic at the "Graphics" tab and edit the sound boxes (both for the main Sound and for the frame-specific angle Sounds) in the same way as Unit sounds. Example below for Man-at-Arms's angle sounds.

Note: as you probably know, data mods require all players to have the same file to play online, so changing sound bindings with this method should only be done if absolutely necessary for your mod.
Overriding Voice-Overs
  1. First of all you will need to prepare your source files into WEM files. I cannot provide specific help with that, however user-created guides for doing this are available. I'm going to create a converter tool for WAV and OPUS formats in the near future, which will not require you to have WWise installed at all.
  2. Create a new mod in your personal AoE2DE directory. Example: C:\Users\Admin\Games\Age of Empires 2 DE\46461161022890482\mods\local\VoiceMod1
  3. Within that mod directory, create folders in the following order:
    • For intro/outro slides: resources\<language>\campaign\sounds
    • For in-game narration: resources\<language>\sound\scenario
    • If you want to replace for all languages at once, then everything goes here: resources\_common\drs\sounds
  4. Place your converted WEM file inside the folder of choice
  5. Check the Audio spreadsheet (linked at the top of the post), the Scenario & Campaign Events tab. Scenario Dialogue is in the first table, while intro/outro slides are in the second table after it. Rename your WEM files in accordance with the files you want to replace (Note that the "PLAY_" in the name is optional and not required).

Known Issues:
  • It is not currently possible to use the "Previous"/"Next" slide functionality with custom intro/outro voice-overs.
< >
93 Comments
Jernside 6 hours ago 
Hi, I want do play a Sound in a scenario.
Effect 1 - Play sound - PLAY_ALFRED_MOVE
The game chooses one of the 5 sounds. How can I specify, that I only want the move2 sound ("Woo woo woo woo")?
Red Khan Jan 3 @ 12:54am 
@StepS Also I found out that some files are completely missing from the spreadsheet. For example Slavs' monks and king clearly has four "select" and "move" lines, but in the spreadsheet they are only three of each. For example monk's "In the name of the Lord" select line is clearly missing.
Red Khan Dec 20, 2020 @ 3:24pm 
@StepS I've been looking through this Google spreadsheet and found out that some unit voices can't be found by using i.e. some numbers are invalid. It would be OK if we consider only "villager attack" lines, but some other files can't be found too. For example I was able to find only one "Italian King Move" line (3), while clearly in the game he says more than one line when ordered to move. ITAL King Move 1 legacy ID is 6383. "Audio Sources - Speech" sheet contains several File ID's for this legacy ID (1044981241, 717355599, 750476605, 203874901) but there are no files with such names in game resources, neither in .bnk files or as seperate .wem files.

Here is a list with "Villager Attack" lines - https://pastebin.com/kFddSayL
And one without "Villager Attack" lines - https://pastebin.com/6dabKM88

Is there something that I'm missing?
Meidi Nov 28, 2020 @ 3:18am 
Thanks for the guide! My taunt pack didn't work properly but putting a copy of all .wem files into "resources\_common\drs\sounds" fixed it. What a weird issue, considering that HD version was so straightforward with taunt add-ons.
StepS  [author] Nov 17, 2020 @ 3:31pm 
Hello again,
the issue where civ themes would require localized filenames has been solved in November update. Do keep in mind that filenames are still case-sensitive and the first letter is capitalized (refer to the spreadsheet for the names).
StepS  [author] Nov 1, 2020 @ 5:58am 
@Infinity183 @疯狂宇宙 @S A I N T P E P S I
Apologies for the delayed response on civ themes.
Modding civ themes DOES work, but has a couple of issues:
1) it is case-sensitive. For example "Portuguese_theme.wem", NOT "portuguese_theme.wem" -- the first letter must be capitalized.
2) due to a bug, the filename must match your localized civ name if you are not using the English language for AoE 2 DE. (e.g. "Португальцы_theme.wem" in Russian)

Also, civ themes and music work through the mod directories (mods\local, mods\subscribed) but not through userprofile-storage directory ("resources" under profile id). They also work when under the base game installation directory.

Thanks for bringing my attention to this. Both of the aforementioned issues should hopefully be addressed in the future (especially localization).
Infinity183 Oct 31, 2020 @ 10:42am 
@StepS Any update regarding civ theme replacements? Would like to do this with Portuguese but it still doesn't work.
Sir Sebästschn Sep 28, 2020 @ 9:28am 
just realized, only xbox-live users can publish. Therefore I did it via ageofempires.com with an xbox live account
Sir Sebästschn Sep 28, 2020 @ 8:33am 
@StepS
Great instruction StepS!
I used Overriding In-game SFX, but how can I publish my mod?
My button is greyed-out (I even filled out the .json-file and added a jpeg).
Juggernaut Sep 17, 2020 @ 10:50pm 
can somebody share a silent(no audio) wem file?