Welcome to the TWC Wiki! You are not logged in. Please log in to the Wiki to vote in polls, change skin preferences, or edit pages. See HERE for details of how to LOG IN.

Difference between revisions of "Sound text files"

From TWC Wiki
Jump to navigationJump to search
(Format)
(Format)
Line 204: Line 204:
 
'''looped''' - overwrite the parameter in play_tracked_sound
 
'''looped''' - overwrite the parameter in play_tracked_sound
  
'''ducking''' - (found in M2TW but not use in vanilla RTW)
+
'''ducking''' - temporary lowering other sounds (not use in vanilla RTW but could be used in RTW)
  
 
'''retrigger X''' - delay before retriggering the sound, using for music (X is in second)
 
'''retrigger X''' - delay before retriggering the sound, using for music (X is in second)

Revision as of 11:08, 31 December 2020

Rome:Total War & Remastered - Modding Index

M2TW Modding Index



The sound text files are used to edit the sound in RTW and M2TW. They contain paths and usage instructions for all noises/voices samples and musics in the game, and are indispensable when modding sound and music in RTW and M2TW. In their final form, they make up the currently non-extractable (using Vercingetorix IDX unpacker) events archive ("Archive" refers to dat/idx files) in the data\sounds subfolder inside the M2TW install folder. As they cannot be extracted from events.dat, an archive containing the sound text files is available here.


Note: Format of these text files are the same in both RTW and M2TW are the same (and seem to be largely the same since Shogun:Total War) with some different in sound bank's vocal events, class type, element's format (mostly found in export_descr_sound_*.txt family) but most of them are the same. RTW's sound banks are categorized by cultures, but in M2TW are categorized by accent groups (which setting is done in additional file not exist in RTW). And only some sound banks in RTW support mp3 format, the rest have to use wav format. But in M2TW, all sound bank could support mp3.


Note: RTW and its expansions are coming with events archives but game engine would not generate new events archive and seem not crucial to existence of sounds in mod of RTW as it seem to able to able to load sounds according to text files without events archives loaded according to process monitor ("name of found" result) or archived is blank files (0 byte) without losing any of their sound content.

Usage

The sound text files available in the above available archive are to be extracted into the data subfolder inside the M2TW install folder, where they are then edited in any text editor to fit the modder's needs.

List of files

Below is a list of all of the sound text files. Click a filename to read detailed information and usage instructions for a file. In general, each of the files listed below is very intuitive and self-explanatory, meaning it won't take anyone a long time to figure out how it works.

Format

All sound files have the same operational structures due to they are originally single file (descr_sounds.txt) which split up for development ease with pattern as example for all sound files apart from descr_sounds.txt and descr_sounds_accents.txt which consider as header of all the sounds files contain many parameters which different from others and set for whole game.

Head of file.

 DEFAULT: modifiers

DEFAULT = setting which declare by this would be using for follow sound events unless specified in event or DEFAULT is declared in the same category again.

 required_samples_cutoff X

Limit sound sample which would load for each events (X = number of samples which would be load in each events)

 (specific bank setting, tend to have comment explanation when declare in file)
 source {text file name}

Indicated sound banks (not include value setting) would be continue on file as name indicate

 BANK: { bank name }
   ignore {advice's text name}
   restricted {sample's file name}
 (specific bank setting, tend to have comment explanation when declare in file)

BANK = declare category of sound as engine recognised, sound files tend to contain only 1 BANK per file

Note: Some sound events are not part of sound banks (such as narration and stratmap_anims}

Category inside the bank (not all banks would have all categories below, see specific sound files for detail)

 mount { mount type in descr_mounts.txt }
 animal { wardogs, pigs }
 unit { unit's type in EDU or unit's category or unit's class }
 exclude_unit { unit's type in EDU or unit's category or unit's class }
 class { engine class name }
 type { water/enviro type }
   daytime { day_time in descr_daytypes.txt }
   weatherevent { weatherevent in descr_daytypes.txt }
   precipitate { precipitate type in descr_daytypes.txt }
   wind { wind level in descr_daytypes.txt }
     season { summer, winter, etc }
       climate { parameter as defined by descr_climate.txt }
         terrain { battle map terrain as generated on battlemap by descr_geography.db }
 type { unit type in EDU }
 mount { mount type in descr_mounts.txt }
 animal { wardogs, pigs }
 unit { unit's type in EDU or unit's category or unit's class }
 exclude_unit { unit's type in EDU or unit's category or unit's class }
   class { unit's voice_type }
     anim { animation sound event }
 unit { unit's type in EDU or unit's category or unit's class }
   stage { ready, aim, fire }
 type { ambient animal type }
   action { animal action }
 type { event type according to descr_event_images.txt }
 type { interface type }
   mode { interface type's mode }
 culture { culture according to descr_cultures.txt }
   state { music state }
 text { exporting Campaign Advice } (using by BANK: ADVICE)
 action { strat map action }
   type { agent's type }
 type { disaster type }
 season { summer, winter, etc }
   terrain { strat map terrain }
     climate { climate according to descr_climates.txt }
       ambient
       looped
 what { settlement, port, landmark }
   culture { culture according to descr_cultures.txt }
     level { settlement/port level }
     wonder { wonders' type }
 category { ambient, major, gate, wall }
   type { battle map buildings/ambient }
     what { fire/transition }
       transition { transition type }
 what { ambient }
 weapon_type { weapon sound type: knife, sword, spear, axe, mace, club }
 unit { unit's type in EDU or unit's category or unit's class }
 weapon {EDU's attack Weapon type = melee, thrown, missile, or siege_missile} {EDU's attack damage types = piercing, blunt, slashing or fire}
   hit { armour type: flesh, leather, wood, metal, building, ground, water }
   hit ground { list of terrain types }
   hit building { building types }
   death_hit { flesh, leather, wood, metal, building, ground, water }
   fly
   flaming fly
   flaming hit { flesh, leather, wood, metal, building, ground, water }
 culture { culture according to descr_cultures.txt }
   element {  prebattle_speech element }
     VnV { trait X }
     relationship { Hates/Neutral faction_type }
     present { faction_type }
     helping { faction_type }
     situation { situation type }
     type { type name }
     odds { odds type }
     condition { condtion type }
     omen { omen type }
     reinforcement { reinforcement status }
   notification { battle event notification }
   class { unit's voice_type }
     vocal { vocal type }
       engine { engine_type }
       unit { unit_type or unit's category or unit's class }
       exclude_unit { unit_type or unit's category or unit's class }
   type { strat map's agent type }
     vocal { vocal type }

Sound event body, apart from trigger by game itself, they could be triggered by script.

  event { event name } modifiers
      folder { base path }
      {sample name}     modifiers (any of probability, volume etc)
      {sample name} ...
      folder { base path , in case files have different location}
      {sample name}     modifiers (any of probability, volume etc)
      {sample name} ...
  end
 

{sample name} = name of sound sample file (if extension is .wav, extension could be omitted)

List of modifers (X indicated value for setting)

3d - sound has distance/direction modification

1d - sound has no distance/direction modification

Streamed - read from disk instead of embedded file in memory at the game startup

looped - overwrite the parameter in play_tracked_sound

ducking - temporary lowering other sounds (not use in vanilla RTW but could be used in RTW)

retrigger X - delay before retriggering the sound, using for music (X is in second)

minDist X - minimum distance which would hear the sound (X must more than 1.0)

maxDist X - maximum distance which sound would still be heard

priority X - (X = between 0 to 9999)

Volume X - modifier to based sound volume set in the preference (X = between -100 to 0 db)

probability X -

minPitch X -

maxPitch X -

dry_level X - (X = 0 to 1 }

wet_level X - (X = 0 to 1 }

delay X - delay in seconds before next 3d sounds start playing

randomdelay X - delay within seconds before next 3d sounds start playing

probradius X -

fadein X -

fadeout X -

pref X - sound preference setting to be use for events below (X = sfx/speech/music/INTERFACE }

pan X - 2D events only, from 0 (hard-left) to 1.0 (hard-right) 0.5 - default

ignore_pause X -

distancepriority X -

effect_level X -

rndvolume X -


The end of File may contains....

 include {text file name}

Indicated extension of sound file (include value setting) to be continue on file as name indicated

Loading

Note that the sound text files cannot be loaded by using any special commands such as file_first.io. Instead, the game will, upon launch (i.e. by running medieval2.exe), detect whether a valid events archive (events.dat and events.idx) exists in the data\sounds subfolder.

  • If one exists, and is valid, the sound text files will be ignored.
  • If one exists, but is invalid (such as one created using Vercingetorix IDX extractor), or is missing altogether, the game will create a new events archive using the sound text files. Similarily, no changes will be made to valid Music, SFX and Voice archives. Events archive is not generated in RTW.

In order to make changes any of the archives, they must be renamed or moved to another folder so the game can't find them upon launch. If the game tries to build new archives, but the sound text files are missing, the result will be 1kB archives and no sound in the game. Note that this will never happen if valid archives are present in the data\sounds folder.

  • Sound text files and all sound files they reference to are loaded only once upon startup.
  • Sound files with wrong paths in text files would not report error upon exit in RTW but could be detected by using process monitor and only included result that "PATH NOT FOUND" and path contain either .mp3 and .wav while excluded all process name that not from game file .exe you run with. Sound files would always loaded from inside .dat files (memory-embedded) first before start looking sound files inside data\sound folder, so file which it loaded from inside .dat files would not appear as entry from process monitor.

Beiss