Age of Empires II: Definitive Edition

Age of Empires II: Definitive Edition

119 betyg
Audio Modding Guide - AoE2DE
Av StepS
A guide to modifying or adding new audio in-game, as well as using them in scenarios.
2
4
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
Introduction
AoE II DE released with a new audio system, powered by Audiokinetic WWise. This means that files like .wav or .mp3 are no longer used, and a special modding system is now in place, which is separate from the way audio files are stored in the base game. Therefore, there is a lot of information you must know before you attempt 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.

The guide also informs you of several issues with the audio modding system known to the game developers.
[REQUIRED] Audio Spreadsheet
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.
1. Scenario Triggers
1.1. 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.

1.2. 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.
  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.
2. SFX
2.1. Overriding SFX (Unit & UI)
  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.
  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* and UI sounds tabs. Find the Sound that interests you and copy its corresponding File Names / Event Names. Rename your files to match. For Unit Sounds, make sure that you cover all variations of your sound with your replaced ones.

* For Unit Sounds, you can alternatively use Advanced Genie Editor to check which sounds with which names are bound through the Sounds tab (see Section 6 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.
  • 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.
  • 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.

2.2. Adding new Unit SFX
Adding new SFX requires modding the data file. This is covered by Paragraph 6.1 of this Guide.

2.3. Adding custom Click and Mouseover sounds for WidgetUI buttons
You can set custom unique Click and Mouseover sounds for each button in WidgetUI json files. To do so:
  • First perform the steps described in section 2.1 but excluding the last step.
  • Set the "ClickSound" and/or "MouseoverSound" properties of your chosen "Button" Widget in your chosen WidgetUI .json file to the filename (case-sensitive without extension) of a .wem file that you placed in drs\sounds.

An example of using ClickSound can be found when looking for "ClickSound" in campaignselection.json.

If you want to have the Original Mouseover Sound from Age of Empires 2: HD Edition, when mousing over certain menu buttons, you can install this mod (not included with the three mods in section 2.1):
3. Music
3.1. 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.
  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 thes mods:

You can add up to 99 tracks (01-99) for each type of music, except ingame. They will be randomly picked. ingame tracks will utilize your current playlist settings from Game Options.
Valid music filenames can be found here[docs.google.com].

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.
4. Voice-Over
4.1. 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.
  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>\scenario\sounds
    • 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).

If you want original campaign narration in original AOK/AOC campaigns, check out this community-created mod:

Known Issues:
  • It is not currently possible to use the "Previous"/"Next" slide functionality with custom intro/outro voice-overs.

4.2. Adding Voice-Overs
The procedure is the same, but you are in control of your campaign JSON files (please refer to Campaign Making guides). Files go to the same folders as above, and the file names from the JSONs are case-sensitive.
5. Taunts
5.1. 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.
  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.

Please note that it is not currently possible to create a taunt that would use a single file for every language at once, in this way. An alternative "hacky" method is available, however.
See Paragraph 5.3 of this Guide for more details.

If you want to override Base Game taunts instead, see Paragraph 5.2 of this Guide.

5.2. Overriding Taunts
There is a way to override Base Game taunts, which can work either per-language or for all languages at once.

To use it, create a file named taunt_11.wem in:
  • resources\_common\drs\sounds (for everything)
  • OR resources\<language>\sound\taunt (for each specific language).
Do not use per-language folders simultaneously with the common location!
Replace 11 with any Base Game taunt number; single-digit numbers must be ascended to the 01 format with two digits.

Files will be looked up under your mod paths (local/subscribed), user profile path and the game path.

5.3. Adding Taunts For All Languages (alternative)
There is an alternative way to add in-game taunts, which can work for all languages at once without having to create duplicates.

To use it, create a file named Play_Taunt_300.wem (case-sensitive!) in resources\_common\drs\sounds.
Replace 300 with any number that's 3 or more digits.

❗You have to always use / when chatting in-game, even when the slash option is disabled in game options. Example: /300. The file name is case-sensitive and has to start with Play_.

All files that reside in per-language folders (including taunts added via Paragraph 5.1 of this Guide) take priority over this "alternative" method. Files added here can also be placed into per-language folders simultaneously with the common location.

Files will be looked up under your mod paths (local/subscribed) and the game path, but not your user profile path.

Upside:
  • If your taunt pack uses the same files for every language, significantly reduces its size and load time.

Downsides:
  • Have to type / at all times unless the taunt is a Base Game taunt or a language-specific copy was added via Paragraph 5.1 of this Guide and the current interface language matches the one supported by it
  • Cannot have built-in subtitles to go with the taunt. The filename cannot include any additional comments
  • It should be noted that this way of adding taunts relies on a quirk of the audio modding engine, hence the case-sensitivity, the / requirement, and other weird deviations from Paragraph 5.2. It may stop working in the future if a "proper" replacement for it appears in an update.
6. Data File
Opening 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.

6.1. Adding new sound bindings for Data Mods
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).

6.2. Remapping sound bindings in Data Mods for Base Game files
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.
Sound extraction and playback
Exporting
To extract sounds from the base game, go to the "wwise" directory, then open .pck files with Ravioli Tools[www.scampers.org] (Extractor or Explorer)*. These files will contain Soundbanks (.bnk files) as well as numeric .wem files. Soundbanks can be further unpacked with the same tools.

To know what each file is actually called, check the respective "Audio Sources" tabs in the Spreadsheet (at the far-right in the list of sheets). They will provide filenames as well as the .bnk banks where the files are seen.

The difference between .wem files that are in the .pck itself and those that are in .bnk is that the former only get loaded on demand, while the entire .bnk gets cached in memory.

* Note that for some reason, these tools may display/extract sounds as ".wav" files. The actual extension is .wem, so mass-renaming may be required.

Converting/playing
To convert or play the sounds you can use vgmstream[vgmstream.org]. The foobar2000 plugin can directly play .wem files of all codec types. The command-line tool lets you convert any .wem file into .wav although not the other way around.

As of 2023, this is the only tool that supports the wem-opus format introduced in AoE2DE's May 2023 Update.
Additional material
More guides with video instructions can be found here:

(video by Hjörleif)
152 kommentarer
Gequi 14 timmar sedan 
Interesting, I have seen several similar tutorials about this, although it is not clear to me if it is only to introduce new sounds in custom scenarios or to replace the sounds with those already existing in the video game. I would like to edit or modify some sounds that are in the game, such as those of the monk, but I don't know if I will be able to do that with this.
Pinko Commie 31 jan @ 16:00 
The only one that works is play_elephant_thud and nothing else
Pinko Commie 31 jan @ 15:48 
has anyone figured out how to make these work in ror? have tried typing in tons of IDs like in the guide but none work
CYLinder 14 okt, 2023 @ 2:02 
There is no "camel_created" sound in your spreadsheet, plz find it for us, thx
Komivi 10 aug, 2023 @ 12:25 
Hello !
I'm working on a mod, and I change musics and sounds inside him. For musics and sound, it doesn't cause any problem. But I can't change the jingle.
I founded a solution, in the folder ...\resources\_common\sound\music, add a "_" at the end of the name (for example Aztecs_theme_.wem), but it doesn't work. Any suggestion ? thank you !
StepS  [skapare] 2 jul, 2023 @ 16:20 
Which specific Music mod you select depends on your preference since different people have played with either only the CD or only the MIDI soundtracks back in the day, so there is no catch-all option.

For the Original Sounds mod there is still a bit of delay as the current DAT mappings are in a bad state not allowing to create proper 1 on 1 mods, although this is a known issue and a workaround (albeit somewhat painful) is currently possible. Will keep this thread updated for anything that comes up
StepS  [skapare] 2 jul, 2023 @ 16:14 
Hey everyone, some news here :)

As you've probably noticed, the in-game music mod issue got fixed in the last update. With it two new mods are now live:
- [RoR] Original Music (CD Order) [www.ageofempires.com] - 20 in-game tracks ordered as they were on the Original CD and AoE 1 DE's Classic Mode, including "Gray Sky" but excluding 5 midi-only tracks
- [RoR] Original Music (DE-Midi Order) [www.ageofempires.com] - 24 in-game tracks ordered the same as in the unmodified Return of Rome, as well as in AoE 1 DE. These include the 5 midi-only tracks using high quality TimidityGM conversion, as well as all the rest using CD mastering, but not having "Gray Sky" in the in-game rotation.
Both of them include the original Main Menu, Win/Loss, and Credits/Modmanager themes.
ONOX 27 jun, 2023 @ 15:47 
Hello, I can confirm that todays patch has solved the issue. It is now possible to change the music with RoR.
@Leogun
Leogun 29 maj, 2023 @ 19:22 
It doesn't work for me with RoR, I can't modify the music, only the one that sounds in the menu.

example: aoe_ingame01.wem

it does not work.
:wololo:
ONOX 27 maj, 2023 @ 7:37 
It does not work for me with RoR and its driving me crazy. I would like to change the music. The only thing that is working is the menu music, like "aoe_frontend01.wem".

An example:
I have my own .wem file. I name it "Romans_theme.wem". Now the civ jingle of the romans civ of the ORIGINAL aoe is replaced. It does not affect the roman civ from RoR. But anyway it shows that my .wem file is valid, because it can properly load at least for the roman civ in the original AOE2 DE. Now I take the "Romans_theme.wem" and rename it to "Shang_theme.wem". Nothing happens at all.

The same applies to "aoe_ingame01.wem" and so on. Is that the bug that StepS described? Or am I doing something wrong?