Audio modding: Difference between revisions

From Total War Modding
No edit summary
(Audio modding update)
Line 1: Line 1:
After a long time, Audio modding is now possible (for Warhammer 3 at least!)
= WH3 Audio Modding =
After a long time, Audio modding is now possible. This is entirely down to the years of research into audio and work developing the tools by Ole and ChaosRobie.


== Wwise ==
The main tools used in audio modding are:
The total war games uses an audio engine called Wwise. This is a very powerful, but complex system. If you want to audio modding, you also need to get a basic understanding of the tool.
- Audio Explorer
- Audio Project Compiler
- Dialogue Event Merger
- Dat Builder
- Bnk Patcher
- File Converters
- Wwiser


Its higly recommended that you read '''[https://github.com/bnnm/wwiser/blob/master/doc/WWISER.md this]''' and spend some time exploring the data using the "Audio Explorer" tool
The wiki for everything but the Audio Explorer is still being written.


=== WWise Naming ===
Some of these tools do the same thing just in different ways so you should read up on them individually.
The first thing to understand, there is no names in wwise. When a wwise project is compiled (saved for use) the tool converts all the names into ids. This is why the game has a ton of files called 9484940112.wem. At some point they were named Karl_Eating_Goblins.wem and so on, but that name is converted (hashed)


=== Wwise event structure ===
= The Basics =
Everything in wwise starts with an event (apart from music which is party controlled by some strange script). '''The game will typically refer to the events, either in script, anim.meta file or db.'''
== Introduction to Wwise ==
The Total War games use an audio engine called Wwise. It is a very powerful but complex system. In short Wwise produces these things called soundbanks (.bnk files). Soundbanks store the information about how audio is played in the game.


There are two event types, '''Event''' and '''Dialog_event'''. After the event there is a chain of object that leads you to the actual audio played.  
If you want to mod audio it would probably be a good idea to have some understanding of the basics of Wwise. Some of this is covered below, however for a more foundational understanding read the [WWiser documentation](https://github.com/bnnm/wwiser/blob/master/doc/WWISER.md).  


For example this basic '''Event''' will play a random sound from a collection of two.
== Wwise Objects ==
In Wwise there things called objects. The most basic objects we will interact with are Events, Containers, Sounds, Actor Mixers.


Karl_Eating_Goblin_Event => Karl_Eating_Goblin_Event_ActionPlay => Random Container => Soundx.mp3 and soundy.mp3.  
=== Events ===
Everything apart from music and VO starts with an Event. The game will typically refer to the Events, either in script, anim.meta file or db.


They follow a basic pattern most of the time. Event => Action => Container (optional) => Sound(s)
There are two event types, Event and Dialog_Event. After the event there is a chain of object that leads you to the actual audio played.


For more information look at wwisers documentation (without the project, there would be no audio modding) => https://github.com/bnnm/wwiser/blob/master/doc/WWISER.md
For example this basic Event will play a random sound from a collection of two.


Karl_Eating_Goblin_Event => Karl_Eating_Goblin_Event_ActionPlay => Random Container => Soundx.mp3 and soundy.mp3.
They follow a basic pattern most of the time. Event => Action => Container (optional) => Sound(s)


The second event type is a '''Dialog_Event'''. It has nothing to do with dialog, its a lookup table that results in container or sound object.  
The second event type is a '''Dialog_Event'''. It has nothing to do with dialog, its a lookup table that results in container or sound object.  
Line 46: Line 58:
|678
|678
|}
|}
When the even is triggered, the game sets a set of variables which are used to lookup the child node, which typically points to a Container which in turn points to sounds
When the Dialogue_Event is triggered, the game sets variables (States) which are used to lookup the child node, which typically points to a Container which in turn points to sounds.


Currently Dialog_Events can not be modded, but soon...
So for example if you are playing as the Empire, and as Karl Franz, and you move on the campaign map, the game sees that you've just moved the big man. The Dialogue_Event for this particular condition is activated and follows the path of the provided variables, e.g. Culture: Empire, Voice Actor: Franz and plays the audio for Franz moving his army on the campaign map.


The last important bit is the '''ActorMixer''' object. This object controls who owns the sounds. Is it a UI sound, game sound, battle sound and so on. This is important to make the sound play as not all ActorMixer has their volume set at all times
=== Containers: ===
One type of Container is a Random Container. They are an organisational and control tool for sound objects. When triggered a Random Container would play one of its sounds, you guessed it, at random!


== Exploring Wwise in AssetEditor. ==
=== Sounds: ===
In AssetEditor there is a tool for exploring the audio data, called "Audio Explorer". This can be used to learn about how wwise works. It has multiple use case.  
Sound objects are how sound files are represented within WWise.
 
=== Actor Mixer: ===
Actor Mixers serve as an organisational and control tool for sound objects. It allows you to break sounds down into 'folders'. Mixers control who owns the sounds - if it's a UI sound, game sound, battle sound and so on. This is important to make the sound play as not all ActorMixer has their volume set at all times.
 
= Audio Explorer =
The Audio Explorer is a tool for exploring the audio data in the game. It has many use cases, for example learning how Wwise works or browsing for specific sound files.
   
   
[[File:AssetEditor audio tool.png|thumb|alt=]]  
[[File:AssetEditor audio tool.png|thumb|alt=]]  


=== Learn how wwise works ===
== Learning Wwise ==
The tool allows pretty much all wwise objects to be explored. This is very useful to learn how you later can use the compiler to add new sounds. Under extra you can pick between Events and Dialog_Events.
The tool allows pretty much all wwise objects to be explored. This is very useful to learn how you later can use the Audio Project Complier to add new sounds. Under extra you can pick between Events and Dialog_Events.


The left side shows the full graph of the selected event, while the right side shows a detailed view of the Wwise data of the selected node.  
The left side shows the full graph of the selected event, while the right side shows a detailed view of the Wwise data of the selected node.  


=== Find what sound file to replace for a given event (Finding the real name of the 213123123123.wem files) ===
== Finding Sounds ==
[[File:Audio explorer find soundname.png|thumb|alt=|How to make sense of the sound names in total war]]
[[File:Audio explorer find soundname.png|thumb|alt=|How to make sense of the sound names in total war]]
Using this tool its very easy to lean which sound file is linked to what event.  
Using this tool its very easy to lean which sound file is linked to what event.  
Line 69: Line 88:


If one takes the event "Play_Nor_Throgg_Dip_Dwf_Greet_Neg_02" which is for when Throgg talks to dwarfs, one can see that this is linked to the sound file "605570708.wem"
If one takes the event "Play_Nor_Throgg_Dip_Dwf_Greet_Neg_02" which is for when Throgg talks to dwarfs, one can see that this is linked to the sound file "605570708.wem"
=== Learn which audiomixer and audio bus is used for a group of sounds ===
[[File:Audio explorer find mixer.png|thumb|alt=|How to find the correct ActorMixer for adding custom sounds]]
All sounds have to be connected to a mixer (which in turn is connected to a bus). Not all busses have their volume set at all times. For example the UI and Battle bus is not both enabled at the same time. Because of this its important that the correct mixer is selected when adding new sounds. When selecting a Sound node on the left side, "Parent structure" is added on the right side. Here you can see the mixers and busses connected to the sound. you typically want to use the fist id of the first ActorMixer with an audio bus for the "RootAudioMixer" setting in your custom audio project.
=== Adding new Audio ===
We have tried to make adding new sounds as simple as possible. This is done using the Audio Compiler in AssetEditor. AssetEditor tries to fill out as much data as possible, to make it as simple as possible.
[[File:Audio compiler.png|thumb|The Audio Compiler]]
The format looks like this:
{
  "Settings": {
    "BnkName": "campaign_diplomacy",
    "RootAudioMixer": "54848735",
    "Language": "English(uk)"
  },
  "Events": [
    {
      "Name": "Play_Foo",
      "Sound": "Audio\\WWise\\729867288.wem"
    },
    {
      "Name": "Play_Bar",
      "Sound": "Audio\\WWise\\906470917.wem"
    }]
}<br />
{| class="wikitable"
|+Project explanation
!Attribute
!Description
!Example Value
|-
|Settings.BnkName
|The name of the created bnk file. Files can not be renamed as the file reference the name internally.
|customfaction_campaign_diplomacy
|-
|Settings.RootAudioMixer
|The mixer the sounds should belong to. See "Learn which audiomixer and audio bus is used for a group of sounds"
|54848735, which is the id for diplomacy lines
|-
|Settings.Language
|If the file is a language bnk, this needs to be set to the same name as one of the audio folders in the game
|English(uk)
|-
|Events
|A list of all the events
|
|-
|Event.Name
|The name which the game will use to find the sound
|Play_Foo
|-
|Event.Sound
|The path to the audio file in a packf
|Audio\\WWise\\906470917.wem
|-
|Event.FileSystemSound
|The path to the audio file on disk. It will be auto converted to a wem
|C:\\Users\\username\\soundLib\\wet-fart-6139.mp3
|}
Coming features:
* Support for adding dialog_events
* Support for containers like random.
* Fixed names for known ActorMixers


== File Types ==
== Researching Dialogue_Events ==
Wem => The audio file format used by wwise
You can browse for specific Dialogue_Events to see what type of sounds they play in vanilla.


Bnk => The sound database used by wwise
Let's say you want to make your own voice acting for a character of yours. You have looked through the list of all the Dialogue_Events, and you want to look more into what exactly the voice acting for the `battle_vo_order_attack` Dialogue_Event sounds like in vanilla.


Dat => A lookup table for connecting event names to wwise
So search the Audio Explorer for a Dialogue_Event e.g. `battle_vo_order_attack`.


Json => Projectfile for the audio compiler.
Then browse to a voice actor of your choosing, for example Karl Franz. There you can see what his voice acting for this Dialogue_Event sounds like and make your own for your character in a similar vein.

Revision as of 17:46, 28 January 2024

WH3 Audio Modding

After a long time, Audio modding is now possible. This is entirely down to the years of research into audio and work developing the tools by Ole and ChaosRobie.

The main tools used in audio modding are: - Audio Explorer - Audio Project Compiler - Dialogue Event Merger - Dat Builder - Bnk Patcher - File Converters - Wwiser

The wiki for everything but the Audio Explorer is still being written.

Some of these tools do the same thing just in different ways so you should read up on them individually.

The Basics

Introduction to Wwise

The Total War games use an audio engine called Wwise. It is a very powerful but complex system. In short Wwise produces these things called soundbanks (.bnk files). Soundbanks store the information about how audio is played in the game.

If you want to mod audio it would probably be a good idea to have some understanding of the basics of Wwise. Some of this is covered below, however for a more foundational understanding read the [WWiser documentation](https://github.com/bnnm/wwiser/blob/master/doc/WWISER.md).

Wwise Objects

In Wwise there things called objects. The most basic objects we will interact with are Events, Containers, Sounds, Actor Mixers.

Events

Everything apart from music and VO starts with an Event. The game will typically refer to the Events, either in script, anim.meta file or db.

There are two event types, Event and Dialog_Event. After the event there is a chain of object that leads you to the actual audio played.

For example this basic Event will play a random sound from a collection of two.

Karl_Eating_Goblin_Event => Karl_Eating_Goblin_Event_ActionPlay => Random Container => Soundx.mp3 and soundy.mp3.

They follow a basic pattern most of the time. Event => Action => Container (optional) => Sound(s)

The second event type is a Dialog_Event. It has nothing to do with dialog, its a lookup table that results in container or sound object.

Enemy_spotted dialog event
UnitVoiceActor UnitType SpottedFacton Child
Orc_Female_1 Ranged Human 123
Orc_Male_1 Ranged DarkElf 456
OrC_Male2 Melee Orc 678

When the Dialogue_Event is triggered, the game sets variables (States) which are used to lookup the child node, which typically points to a Container which in turn points to sounds.

So for example if you are playing as the Empire, and as Karl Franz, and you move on the campaign map, the game sees that you've just moved the big man. The Dialogue_Event for this particular condition is activated and follows the path of the provided variables, e.g. Culture: Empire, Voice Actor: Franz and plays the audio for Franz moving his army on the campaign map.

Containers:

One type of Container is a Random Container. They are an organisational and control tool for sound objects. When triggered a Random Container would play one of its sounds, you guessed it, at random!

Sounds:

Sound objects are how sound files are represented within WWise.

Actor Mixer:

Actor Mixers serve as an organisational and control tool for sound objects. It allows you to break sounds down into 'folders'. Mixers control who owns the sounds - if it's a UI sound, game sound, battle sound and so on. This is important to make the sound play as not all ActorMixer has their volume set at all times.

Audio Explorer

The Audio Explorer is a tool for exploring the audio data in the game. It has many use cases, for example learning how Wwise works or browsing for specific sound files.

Learning Wwise

The tool allows pretty much all wwise objects to be explored. This is very useful to learn how you later can use the Audio Project Complier to add new sounds. Under extra you can pick between Events and Dialog_Events.

The left side shows the full graph of the selected event, while the right side shows a detailed view of the Wwise data of the selected node.

Finding Sounds

How to make sense of the sound names in total war

Using this tool its very easy to lean which sound file is linked to what event.

Say you want to make a mod that replaces all of Throggs diplomacy lines. Doing a search in the database will give you all the events used, you can then look that up in the events view.

If one takes the event "Play_Nor_Throgg_Dip_Dwf_Greet_Neg_02" which is for when Throgg talks to dwarfs, one can see that this is linked to the sound file "605570708.wem"

Researching Dialogue_Events

You can browse for specific Dialogue_Events to see what type of sounds they play in vanilla.

Let's say you want to make your own voice acting for a character of yours. You have looked through the list of all the Dialogue_Events, and you want to look more into what exactly the voice acting for the `battle_vo_order_attack` Dialogue_Event sounds like in vanilla.

So search the Audio Explorer for a Dialogue_Event e.g. `battle_vo_order_attack`.

Then browse to a voice actor of your choosing, for example Karl Franz. There you can see what his voice acting for this Dialogue_Event sounds like and make your own for your character in a similar vein.