Modding Sound
Documentation
Disclaimer: This post contains documentation on modding sound. Documentation on modding music can be found in the second post in this thread. Table of contents can be found in the spoiler below.Documentation
1.1 Adding New Sounds
1.2 Defining New Sounds
2.1 Playing Sounds
1.2 Defining New Sounds
2.1 Playing Sounds
2.1.1 Playing Voice Lines
2.1.2 Playing Sound For Animations
2.1.3 Playing Sound on the Campaign Map
2.1.4 Playing Sound In Scenes
2.1.5 Playing Sound For Particles
3.1 Extracting Sounds From Native1.1 Adding New Sounds
Any new sound files must be added to the module's ModuleSounds folder.
\Mount & Blade II Bannerlord\Modules\YourModule\ModuleSounds
1.2 Defining New Sounds
After adding a sound, the module_sounds.xml file needs to be added to the ModuleData folder (simply copy paste it from Native). This file is used to define each sound and assign them a category in order to correctly lead them through the engine. The sound categories function as templates / mixer tracks that each apply different effects to the sounds, meaning that it's important to assign the correct category when adding a sound. Additionally, if a sound is not assigned a valid category, it won't be played in-game.
\Mount & Blade II Bannerlord\Modules\YourModule\ModuleData\module_sounds.xml
<module_sound name="example/combat/hit" is_2d="true" sound_category="mission_combat" path="example_sound_modders.ogg" />
Each entry contains the following 4 properties:
name: The ID used to call the sound later on. Does not need to match the file name.
is_2d: See the list of sound categories and set true/false depending on usage of the sound.
sound_category: Assign the sound a category depending on what the sound will be used for.
path: The path and full name of the sound file, starting from the module's ModuleSounds folder. Child folders can be created to organize the sounds (e.g to separate ambience from voice acting or to organize separate voice actors).
is_2d: See the list of sound categories and set true/false depending on usage of the sound.
sound_category: Assign the sound a category depending on what the sound will be used for.
path: The path and full name of the sound file, starting from the module's ModuleSounds folder. Child folders can be created to organize the sounds (e.g to separate ambience from voice acting or to organize separate voice actors).
Here's an extended list of all sound categories, including descriptions and examples:
mission_ambient_bed
mission_ambient_3d_small
mission_ambient_3d_medium
mission_ambient_3d_big
mission_material_impact
mission_combat
mission_combat_trivial
mission_foley
mission_voice
mission_voice_shout
mission_voice_trivial
mission_siege_loud
mission_footstep
mission_footstep_run
mission_horse_walk
mission_horse_gallop
campaign_node
campaign_bed
ui
alert
(2D) Ambient loops played from no specific position in a scene.
Examples: wind, rain, storms, room tone.
mission_ambient_3d_small
(3D) Ambient sounds, heard from a specific position in a scene, within short distance.
Examples: torches, fireplaces, candles.
mission_ambient_3d_medium
(3D) Ambient sounds, heard from a specific position in a scene, within medium distance.
Examples: smaller waves, medium fires, crickets.
mission_ambient_3d_big
(3D) Ambient sounds, heard from a specific position in a scene, within long distance.
Examples: thunder, distant bird chirps, big waves, distant bells.
mission_material_impact
(3D) Material impacts on other materials.
Examples: steel sword hits stone wall, iron spear hits wooden wall.
mission_combat
(3D) Non-voice impact damage sounds in combat.
Examples: taking hits, others being hit.
mission_combat_trivial
(3D) Non-voice trivial impact damage sounds in combat.
Examples: taking smaller hits, applying smaller hits.
mission_foley
(3D) Foley sounds for animations.
Examples: weapon swings, movement, animal movement.
mission_voice
(3D) Voices for humans and animals.
Examples: grunts for pain, death, weapon swings.
mission_voice_shout
(3D) Voices for humans and animals, heard from long distance.
Examples: battle cries, victory yells, troop orders, multiplayer voice commands.
mission_voice_trivial
(3D) Voices for humans and animals, quiet vocalizations.
Examples: jumping, climbing.
mission_siege_loud
(3D) Loud sounds to be used in siege scenes.
Examples: gates breaking, siege weapons firing, ladders.
mission_footstep
(3D) Footsteps for humans and smaller animals.
mission_footstep_run
(3D) Footsteps for humans and smaller animals, to be heard from longer distance.
mission_horse_walk
(3D) Single footsteps for mounts - horses and camels.
mission_horse_gallop
(3D) Galloping footsteps for mounts - horses and camels.
campaign_node
(3D) world map positional sounds. Played when close to specific world map entities.
Examples: waterfalls, settlements, water, battles, sieges.
campaign_bed
(2D) World map ambient sounds. Played from no specific position on the world map.
Examples: wind, atmospheric weather for different biomes.
ui
(2D) Sounds for UI and notifications.
Examples: inventory, crafting, level up, button presses.
alert
(2.5D) Sounds for alerting the player from within medium distance.
Examples: kingdom rallies and multiplayer alerts, flag captured, out of map.
2.1 Playing Sounds
This section will cover how to play sounds in various situations in-game. This will include documentation on playing voice lines as well as sounds in scenes, campaign map, animations, particles, and eventually from code and UI. This is work in progress and will change and be expanded upon over time.
2.1.1 Playing Voice Lines
The game uses voice lines for combat (grunts, pain, death, war cries), group identifiers (infantry, cavalry), orders (follow, charge, advance), formations (line, shield wall, loose), multiplayer chatter (help, thanks, sorry), and horse sounds (idle, neighs, collision grunts). Additionally, voices are also used for animal vocalizations such as pain, death, and idle.
When adding new voice lines to a module, the mission_voice, mission_voice_shout, and mission_voice_trivial sound categories should be used depending on the voice type (see 1.2 Defining New Sounds).
These sounds are defined in \Modules\Native\ModuleData\voice_definitions.xml where all voice types are listed at the top, and all of the character voices are listed in groups below. Each character voice is enclosed in a <voice_definition> tag, and within this tag, each voice line is defined with a <voice> tag. The properties of each tag are explained below:
name: The name / ID of the voice.
sound_and_collision_info_class: The race of the character. Human, horse, camel, dog, and more. These can be found in monsters.xml.
only_for_npcs: Setting to false will allow the player to select the voice when creating their character. Setting to true will reserve it for non-playable characters. As an example from Native, male_04, male_06, and male_07 are set to false, and represent the voices available when creating a male character in-game. Note, this line is not required for animals.
min_pitch_multiplier: This allows you to randomize the pitch of the voice lines when played in-game. This sets the minimum point of the pitch range where 1.0 is the original pitch of the sound. Native usually sets the minimum pitch at around 0.9 which means the game can pitch the voice down by up to 10%. This is different for every voice, so play around and see what works.
max_pitch_multiplier: The maximum point for the pitch. Native usually goes around 1.1 here which means the game can pitch the voice up by up to 10%. Again, set it according to what makes sense for the voice.
sound_and_collision_info_class: The race of the character. Human, horse, camel, dog, and more. These can be found in monsters.xml.
only_for_npcs: Setting to false will allow the player to select the voice when creating their character. Setting to true will reserve it for non-playable characters. As an example from Native, male_04, male_06, and male_07 are set to false, and represent the voices available when creating a male character in-game. Note, this line is not required for animals.
min_pitch_multiplier: This allows you to randomize the pitch of the voice lines when played in-game. This sets the minimum point of the pitch range where 1.0 is the original pitch of the sound. Native usually sets the minimum pitch at around 0.9 which means the game can pitch the voice down by up to 10%. This is different for every voice, so play around and see what works.
max_pitch_multiplier: The maximum point for the pitch. Native usually goes around 1.1 here which means the game can pitch the voice up by up to 10%. Again, set it according to what makes sense for the voice.
type: What the voice line is used for (grunts, jumping etc.). A list of voice types can be found at the top of the same document.
path: The name / ID of the sound file as assigned in module_sounds.xml.
face_anim: The face animation played with the sound. Can be found in voices.xml.
path: The name / ID of the sound file as assigned in module_sounds.xml.
face_anim: The face animation played with the sound. Can be found in voices.xml.
The gender of each voice is assigned in \Modules\Native\ModuleData\skins.xml (Examples: adult male voices on line 1033 and adult female voices on line 3322). In order to play new character voices in-game, they must be added to the relevant skins, allowing the game to select the correct voice for each character.
Here's a list of every Native skin and the voice_types they use:
- Adult male: line 1033
- male_02
- male_03
- male_04
- male_05
- male_06
- male_07
- Adult female: line 3322
- female_01
- female_02
- female_03
- female_04
- female_05
- Teenager male: line 4400
- male_02
- male_03
- male_04
- male_05
- male_06
- Teenager female: line 6180
- female_01
- female_02
- female_03
- female_04
- Tween male: line 7268
- male_03
- Tween female: line 9024
- female_03
- Child male: line 10110
- male_03
- Child female: line 11802
- female_03
- Toddler male: line 12654
- female_01
- Toddler female: line 13522
- female_01
Here's a tutorial on adding and playing new voice lines. This tutorial assumes that the sound files have already been added to the game (see 1.1 Adding New Sounds).
- Open voice_definitions.xml from \Native\ModuleData (If using a custom module, add the document).
- Copy a complete character voice such as male_06 (Take everything from start of <voice_definition> to the closing tag) and paste it below the others.
- Change the name of the <voice_definition> to something relevant.
- Set sound_and_collision_info_class according to the character (see family types in monsters.xml)
- human if the character is human, horse if character is horse, etc.
- Set only_for_npcs to true if you want the player to be able to use the voice. Set to false if not.
- Set min_pitch_multiplier and max_pitch_multiplier according to the voice.
- This requires you to play around and see which pitch ranges sound good for each voice, as every voice is different. Original pitch is 1.0.
- Replace the sound codes / paths of each voice type with the new sounds you wish to use (the name given to the sound in module_sounds.xml).
- Open skins.xml from \Native\ModuleData (If using a custom module, add the document).
- Find the <voice_types> tag within the skin you want to assign your voice to.
- See the list of all skins and voice types in a spoiler above.
- Add a new line with the name of your character voice as assigned in voice_definitions.xml.
- Example:
<voice_type name="female_05" />
<voice_type name="female_new_06" />
- Example:
Note: There is currently, what I presume to be, a bug that causes the panning of custom voice lines to go crazy when previewing the voice in character creation. Whether the sound is 2D or 3D doesn't seem to affect it, and neither does changing between mono and stereo.
2.1.2 Playing Sound For Animations
Playing sounds for animations originally happened through the animation XML files, however these have since been deprecated. The animations must instead be edited through the Resource Browser window in the Modding Kit. When opening an animation in the Resource Browser, the Inspector will open on the right side wherein the Sound code and Voice code properties can be found. For Sound code, the name / ID of any added sound file from module_sounds.xml (or native sound codes found in \Mount & Blade II Bannerlord\Sounds\GUIDs.txt) can be used. For Voice code, the voice types from voice_definitions.xml can be entered instead of the path of the sound file itself.
The Voice code property is typically used to play vocalizations for animals or mounts (idling, pain, and more as found at the bottom of voice_definitions.xml). It is also possible to use both a Sound code and Voice code at the same time. Native often does this for mounts in combat - for example the horse_kick animation playing a swing sound code for the horse kicking as well as the Neigh voice code from voice_definitions.xml. Another example is horse_run_collide playing a sound code for the horse charging as well as the Collide voice code.
When editing an animation, several flags can be selected to do with sound:
- make_walk_sound
- Adds a walk sound when playing the animation. Mostly used for walk animations.
- make_bodyfall_sound
- Adds a body fall sound when playing the animation. Mostly used for fall animations.
- do_not_keep_track_of_sound
- Unclear exactly what it does. Mostly used for bow and crossbow release animations.
Here's a short tutorial on adding sounds to animations:
- Open the Modding Kit, go to Window > Show Resource Browserand open the animation you wish to edit.
- The inspector window will open on the right side of the Resource Browser.
- For Sound code, enter the name / ID of your sound as assigned in module_sounds.xml - or use a Native sound code.
- You can find a list of all Native sound codes in \Mount & Blade II Bannerlord\Sounds\GUIDs.txt.
- The Voice code property allows you to play voice codes from voice_definitions.xml.
- Select the relevant flags depending on the sound.
2.1.3 Playing Sound on the Campaign Map
The world map uses sounds in 2D for ambience, such as wind or weather for different biomes. These sounds are not played from any specific position or entity.
It also uses sounds in 3D for water (oceans, rivers, lakes, and waterfalls) as well as settlements, battles, and sieges. This is usually done by adding the sound_emitter script to the entity which the sound should be played from. Since water is not an entity, an invisible entity is instead created to play sound from. Waterfalls usually have the sound attached to the waterfall's cliff / rock entity. For villages, different ambience is played depending on the village's resources (wheat, horses, mines, and more). In these cases, the sound_emitter script is attached directly to the resource's map icon rather than the village's map icon. Villages that don't have resources simply don't have ambience sound either. Certain resources, such as vineyards, currently do not have unique sounds, and therefore don't play anything despite having sound_emitter scripts attached. Any of this can, of course, be changed. Sound can be played form nearly any entity on the map, so there's a lot of freedom.
To make a sound play in a larger, asymmetrical area (seas and oceans) or to follow the path of a river, paths can be created to mark the area. The sound entity can then be hooked onto these paths by adding a path_converger script to the entity and linking it to the path. For rivers, these paths usually consist of one line following the center of the river, whereas oceans and seas often use paths to outline the edges of the water. Certain lakes are small and symmetrical enough that paths are not needed, and instead modify the value of Overrided Max Distance in the sound_emitter script to cover an area.
An alternative to using both a sound_emitter and a path_converger is to simply use the SoundSpline script instead. This script is essentially a combination of the two scripts into one. The Native campaign map does not use this method, so it was presumably added after the creation of the map.
When playing a sound on the map, any custom added sounds can be used, as well as any sounds from the base game.
Below is a list of all native campaign map sound codes for usage:
Category: campaign_bed (2D constant ambient sounds)
event:/map/ambient/bed/aqua
event:/map/ambient/bed/arid
event:/map/ambient/bed/boreal
event:/map/ambient/bed/canyon
event:/map/ambient/bed/lush
event:/map/ambient/bed/mountain
event:/map/ambient/bed/snow
Category: campaign_node (3D positional sounds)
event:/map/ambient/node/settlements/cattleranch
event:/map/ambient/node/settlements/docks
event:/map/ambient/node/settlements/farms
event:/map/ambient/node/settlements/horseranch
event:/map/ambient/node/settlements/lumberjack
event:/map/ambient/node/settlements/mines
event:/map/ambient/node/settlements/orchard
event:/map/ambient/node/settlements/plantation
event:/map/ambient/node/settlements/sheepfarm
event:/map/ambient/node/siege/ballista_fire
event:/map/ambient/node/siege/ballista_hit
event:/map/ambient/node/siege/boulder_hit
event:/map/ambient/node/siege/mangonel_fire
event:/map/ambient/node/siege/trebuchet_fire
event:/map/ambient/node/battle
event:/map/ambient/node/battle_raid
event:/map/ambient/node/battle_siege
event:/map/ambient/node/battle_siege
event:/map/ambient/node/lake
event:/map/ambient/node/river
event:/map/ambient/node/sea
event:/map/ambient/node/waterfall
event:/map/army/caravan
event:/map/army/horse
event:/map/army/horse_slow
event:/map/army/infantry
event:/map/ambient/bed/aqua
event:/map/ambient/bed/arid
event:/map/ambient/bed/boreal
event:/map/ambient/bed/canyon
event:/map/ambient/bed/lush
event:/map/ambient/bed/mountain
event:/map/ambient/bed/snow
Category: campaign_node (3D positional sounds)
event:/map/ambient/node/settlements/cattleranch
event:/map/ambient/node/settlements/docks
event:/map/ambient/node/settlements/farms
event:/map/ambient/node/settlements/horseranch
event:/map/ambient/node/settlements/lumberjack
event:/map/ambient/node/settlements/mines
event:/map/ambient/node/settlements/orchard
event:/map/ambient/node/settlements/plantation
event:/map/ambient/node/settlements/sheepfarm
event:/map/ambient/node/siege/ballista_fire
event:/map/ambient/node/siege/ballista_hit
event:/map/ambient/node/siege/boulder_hit
event:/map/ambient/node/siege/mangonel_fire
event:/map/ambient/node/siege/trebuchet_fire
event:/map/ambient/node/battle
event:/map/ambient/node/battle_raid
event:/map/ambient/node/battle_siege
event:/map/ambient/node/battle_siege
event:/map/ambient/node/lake
event:/map/ambient/node/river
event:/map/ambient/node/sea
event:/map/ambient/node/waterfall
event:/map/army/caravan
event:/map/army/horse
event:/map/army/horse_slow
event:/map/army/infantry
How sound is played for parties, sieges, and towns is currently unknown. I have searched every map icon entity for towns and siege camps, but not found any scripts playing sound. Playing sound for parties presumably happens through modifying files, however I have not found this yet.
Here's a tutorial on playing sound on the campaign map:
- Open the Modding Kit, enter Edit Mode, go to File > Open Scene > Open Other Scene.
- Go to the SceneObj folder, find Main_map, and open the scene.xcscene.
- Select the entity you want to play sound from (the inspector will open on the far right side).
- For water, create a new invisible entity by pressing Add Empty Entity in the toolbar, then move it on top of the water.
- Open the Scripts tab, add a new script, and select sound_emitter towards the bottom of the list.
- If you plan to attach it to a path later, use the SoundSpline script instead. This is explained in the optional steps later in this tutorial.
- Open the new sound_emitter tab within Scripts and enter the name of the sound you wish to play in Event Path (use a custom sound or see list of Native campaign map sounds above).
- Enable Play On Startup (unless you want a custom trigger) and enter the desired minimum and maximum distances for the sound to be heard from. You can also change the volume and pitch. These all have default values to begin with, so changing the values will just override.
Optional steps to set a path for the sound:
- Select the entity and set Mobility to Dynamic in the inspector.
- Press Add Path in the toolbar, name it, and select it (should be selected by default).
- Press Add Path Point in the toolbar and place the points to draw a path.
- Note: The first and last path points cannot be connected, only placed on top of each other. Make sure the path is selected when you add the points.
- Select the sound entity created earlier and add the path_converger script.
- Enter the name of the created path in Path Name.
- When moving the camera, the sound entity will now follow the path of the path it is linked to and play sound along it.
- Alternatively, instead of adding a path_converger on top of a sound_emitter, you can simply delete the sound_emitter and instead use the SoundSpline script which contains the properties of both scripts combined in one.
2.1.4 Playing Sound In Scenes
Playing sound in a scene is essentially the same as adding sound to the campaign map except different scripts may be used. Native scenes often play ambient sounds in settlements by adding the AmbientSoundEmitter script to various entities in a scene. City scenes, for example, create an invisible market_ambient_sound entity in the middle of the market, a city_ambient_sound entity in the middle of the city, and a plains_ambient_sound in the middle of the area outside of the walls. Villages create a village_ambient_sound entity, and castles just use plains ambience as well.
These entities play the following sound codes:
- market_ambient sound
- event:/mission/ambient/area/market
- city_ambient_sound
- event:/mission/ambient/area/city
- plains_ambient_sound
- event:/mission/ambient/area/plains
- village_ambient_sound
- event:/mission/ambient/area/village
With the AmbientSoundEmitter script, different sound codes can be set for the various seasons as well as whether the scene is in a siege state. The game will dynamically switch between these sound codes depending on which factors are true at the time. Native city scenes often use this to switch to winter ambience (event:/mission/ambient/area/winter) in the winter season while playing the default city ambience in the other seasons. For sieges, it changes to plains ambience in order to make the city sound less alive during a time of war.
Entities using the AmbientSoundEmitter script can, of course, also be hooked up with a path_converger script to make the sound follow a path and cover a larger area (see 2.1.3 Playing Sound on the Campaign Map for more information on this).
Examples of other exterior scene ambience uses are arenas, rivers, and forests. For interior ambience, there are sounds for caves, dungeons, keeps, shops, taverns, and more. Other than ambient loops, there is also ambience for details such as fountains, windmills, and certain buildings. Particles for torches, fireplaces, and similar entities are also played in scenes. These are, however, not added directly to the entity, so they will be covered in the next part (2.1.5 Playing Sound For Particles).
Below is a list of all scene ambience loops from Native.
These can also be found by searching for "event:/mission/ambient/" in \Mount & Blade II Bannerlord\Sounds\GUIDs.txt.
Exterior scenes
event:/mission/ambient/area/_rain
event:/mission/ambient/area/_snowstorm
event:/mission/ambient/area/_template
event:/mission/ambient/area/arena
event:/mission/ambient/area/city
event:/mission/ambient/area/desert
event:/mission/ambient/area/forest
event:/mission/ambient/area/lake
event:/mission/ambient/area/market
event:/mission/ambient/area/mediterranean
event:/mission/ambient/area/plains
event:/mission/ambient/area/sea
event:/mission/ambient/area/taiga
event:/mission/ambient/area/village
event:/mission/ambient/area/wetlands
event:/mission/ambient/area/winter
event:/mission/ambient/area/winter_desert
Interior scenes
event:/mission/ambient/area/interior/cave
event:/mission/ambient/area/interior/dungeon
event:/mission/ambient/area/interior/generic
event:/mission/ambient/area/interior/keep
event:/mission/ambient/area/interior/shop
event:/mission/ambient/area/interior/tavern
Multiplayer scenes
event:/mission/ambient/area/multiplayer/city_mp_01
event:/mission/ambient/area/multiplayer/city_mp_02
event:/mission/ambient/area/multiplayer/desert_town_mp_01
event:/mission/ambient/area/multiplayer/forest_mp_01
event:/mission/ambient/area/_rain
event:/mission/ambient/area/_snowstorm
event:/mission/ambient/area/_template
event:/mission/ambient/area/arena
event:/mission/ambient/area/city
event:/mission/ambient/area/desert
event:/mission/ambient/area/forest
event:/mission/ambient/area/lake
event:/mission/ambient/area/market
event:/mission/ambient/area/mediterranean
event:/mission/ambient/area/plains
event:/mission/ambient/area/sea
event:/mission/ambient/area/taiga
event:/mission/ambient/area/village
event:/mission/ambient/area/wetlands
event:/mission/ambient/area/winter
event:/mission/ambient/area/winter_desert
Interior scenes
event:/mission/ambient/area/interior/cave
event:/mission/ambient/area/interior/dungeon
event:/mission/ambient/area/interior/generic
event:/mission/ambient/area/interior/keep
event:/mission/ambient/area/interior/shop
event:/mission/ambient/area/interior/tavern
Multiplayer scenes
event:/mission/ambient/area/multiplayer/city_mp_01
event:/mission/ambient/area/multiplayer/city_mp_02
event:/mission/ambient/area/multiplayer/desert_town_mp_01
event:/mission/ambient/area/multiplayer/forest_mp_01
2.1.5 Playing Sound For Particles
The game mostly seems to play sound for fire particles (e.g torches, fireplaces, fire on buildings in sieges). These particles can be found in the various particle_systems XML files in \Modules\Native\ModuleData. A sound can be assigned to specific particles by adding a sound_code in the particle effect's code.
A quick example of this is line 2 in particle_systems_basic.xml.
<effect name="invalid_particle" guid="{39cdecb3-046b-4a8b-8e71-533bb7f6c882}" sound_code="event:/mission/ambient/detail/fire/fireplace">
Not all Native particles play sounds, but simply adding a sound_code to the effect tag will allow it to play a sound. As with playing a sound anywhere else, this sound_code can be set to the name / ID of any custom or Native sound. It will then be built into the particle when it's added to a scene in-game.
3.1 Extracting Sounds From Native
TaleWorlds uses FMOD software which has been integrated into the game for the developers to use. This means that mostly all sounds used in the game can only be found in .bank files and not easily be opened. The game's sounds are found in \Mount & Blade II Bannerlord\Sounds which contains the following items:
- PC = Folder containing the main sound assets in .bank files.
- VO = Folder containing story mode voiceovers in .ogg files.
- GUIDs.txt = Document defining all Native sounds and their sound codes.
To extract .bank files, a tutorial can be found here ("Getting audio files from .bank and .fsb files" on YouTube). This can be useful for exploring file naming, formats, bitrates, bit depths, mixing, and more.
Last edited: