Page 1 of 2 12 LastLast
Results 1 to 20 of 25

Thread: Sound Modification Tutorial (Not finished)

  1. #1
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,099

    Default Sound Modification Tutorial (Not finished)

    This is a work in progress. I'm using this thread as a temporary spot. When it's finished, I'll post it in the tutorials section.


    As the proud founder of Xenophonia, it is my great honor to present to you, the much awaited and anticipated... ta-tadadatada-daaaa!



    SPEECH MODIFICATION TUTORIAL



    (no-one has actually asked for one, but I figured it will probably be helpful to some people at some point or other.)

    Sections:
    Preparations
    In order to successfully unpack and edit the sound content of M2TW, you will need these:Since you'll likely be doing a lot of text editing, I strongly recommend getting a better text editor if you're still using Notepad/Wordpad. I used Notepad++ to make Xenophonia. I has color coding, multi-tabs, accurate tabulation and all that stuff you wish Notepad had.


    Unpacking
    First, unpack Vercingetorix' IDX extractor (shut up) into your M2TW\data\sounds folder.

    Before you run "extract_sounds.bat", you should know this:

    extract_sounds.bat extracts all of the game's sounds, including the sfx and the music. Is that really what you want? This tutorial only focuses on the in-game speech, so if you want to save some time (and disk space), edit "extract_sounds.bat" (e.g. using Notepad++) before continuing.

    My extract_sounds.bat extracts only the speech sounds, and it looks like this:
    Code:
    .\xidx.exe -x voice1 voice3
    pause
    Save the changes you just made, and now run it. Wait until the extraction has completed.

    Now is a good time to back up your data. Move events.*, voice1.* and voice3.* to another folder, rename them or whatever. Just make sure they stay out of harm's way, in case you screw up when modding.


    Modification
    Before we get started on how to modify the speech in the game, you should know this:

    Modifying the speech in this game is relatively harmless. If you screw up, you most likely won't be experiencing CTDs, bluescreens, or any of that stuff. The only problem you're going to run into are sounds not playing when they should. However, some people who have installed Xenophonia have run into CTDs, but I never have...

    As far as editing the text files goes, the one thing you should keep in mind is that pretty much everything is self-explanatory and exactly what it looks like. Just don't mess up the format and you should be fine. Another thing you should know before we continue are the abbreviations for filenames that I've set up. Writing out the full filenames every time you mention them is both tiring to me as a writer and to you as a reader, so here's a list:

    DSA: descr_sounds_accents.txt
    DSUC: descr_sounds_units_confirm.txt
    EDSP: export_descr_sounds_prebattle.txt
    EDSSOV: export_descr_sounds_soldier_voice.txt
    EDSSTV: export_descr_sounds_stratmap_voice.txt
    EDSUBE: export_descr_units_battle_events.txt
    EDSUV: export_descr_sounds_units_voice.txt

    These are the only files you will need to edit. The rest of the sound text files are not relevant to this tutorial. You do not need to edit them at all, but you must keep them where they are, or you won't be able to run your mod.

    Now that we've got all of this settled, what do you want to want to make a voice mod for?

    I've added a new unit to the game.
    I've added a new faction to the game.

    Enabling speech for a new unit
    If you've added a new unit to the game, you might have noticed that, unlike the vanilla units, it doesn't say anything when you click it in battle.

    The first thing you need to make sure of is whether your new unit is a Light, Heavy or General type of unit. Next, look up which factions are using this unit. Open up DSA. As you can see, all factions in the game are grouped into accents. Look up which of these groups contain the factions that use your new unit.

    Then open up EDSUV. This file uses a certain hierarchy system. As you can see, everything is grouped like this:
    • Accent group
      • Unit type (General/Heavy/Light)
        • Event
          • Folder
            • Samples


    More than one sample is used for most situations. The game will randomly select between the listed samples every time the event occurs.

    Once you've found the right accent group and the right unit type in that accent group, you should look for the row that reads "vocal Unit_Select". Below this line, you will find a list of units of this type. Using the same layout as the other units, add your unit to the bottom of this list, that is, directly above the next line to begin with "vocal". If you want, you can add your own sample for this unit. You'll probably want to use one of the built-in samples though. To do this, just list one or two of the generic samples that fits your unit.

    If making this one unit speak when clicked in battle, you're ready for re-packing.

    Enabling speech for a new faction

    This will be easier to explain by pretending I've created a new faction called "sweden", so let's pretend I have. Let's pretend this Swedish faction has been tested and works fine in the game - it's just none of the Swedish units or characters even say anything at all - they're completely silent. So, what do we do?

    Let's begin by opening DSA. As we can see, there's no mention of sweden here, so let's add it. For whatever reason, I feel comfortable with having the Swedes speaking English for now. I do this by adding the word "sweden" to the English accent group, like this:

    Code:
    accent English
        factions england, normans, saxons, sweden
    There - when we're done, the Swedes will, hopefully, speak English. Let's assume that the Swedish faction has 2 unique, new units that the English don't have - and let these two units be "Fattiga Riddare" (Light Cavalry) and "Yxgubbar" (Heavy Infantry). Let's assume these units work exactly the way they should in the game - except they don't say anything when you click them in battle.

    Let's open export_descr_unit.txt. Here we can look up both units. The entry for "Fattiga Riddare" reads:

    Code:
    type             Fattiga Riddare
    dictionary       Fattiga_Riddare      ; Fattiga Riddare
    category         cavalry
    class            light
    voice_type       Light
    and so on. As we can see here, the unit's name is "Fattiga Riddare" (although, if "type" had not been the same as "dictionary", I don't know which one we should pick.), and its voice type is "Light".

    (Some units also have an entry named "accent". I don't know what this is for, but I'm guessing it could be used to make certain units keep their accent even if hired by a foreign faction or something.)

    Looking up "Yxgubbar", here's what their entry reads:

    Code:
    type             Yxgubbar
    dictionary       Yxgubbar      ; Yxgubbar
    category         infantry
    class            heavy
    voice_type       Heavy
    and so on. Now that we've looked up the necessary info, let's add these units to the EDSUV.

    The first thing we need to do is to find the English accent group in this document. As it happens, they're first up. Next, we need to find the Heavy unit section in the English accent group. This is a really long document, so let's search for "class Heavy" instead of scrolling manually. We'll still have to scroll down a large number of pages to get to the unit select sounds, so let's do another search for "vocal Unit_Select". Let's add our new unit to the bottom of this list of units. Scroll down until you find the next row that starts with "vocal".

    We'll add these rows directly above it:

    Code:
    unit Yxgubbar
                                        event
                                                 folder data/sounds/Voice/Human/Localized/Battle_Map
                                                      English_Heavy_Generic_Heavy_Infantry_1.wav
                                                      English_Heavy_Generic_Heavy_Infantry_2.wav
                                        end
    I don't feel like recording a new sample for this unit, so I'll just use some generic ones. There are generic samples for most kinds of units for most factions. The game will randomly select between the 2 listed samples every time you select the unit. If I want, I can let the Yxgubbar have a sample of their own, so that they say "YXGUBBAR!" when I click them. All I need to do is put a new sample in the folder listed above (data/sounds/Voice/Human/Localized/Battle_Map), give the sample a proper name and change the code accordingly. It really is that simple.

    Now, naturally, I'd like to get those "Fattiga Riddare" to say something, too. The process is identical, only I'd need to find the corresponding spot in the "Light" class instead, so I'll leave that as self-explanatory.

    Now that this is done, the only thing you still have to do is re-pack, and then the sound should work for the Swedes.







    Repacking
    Several sleepless nights and hair-tearing has won this part of sound modification my pain-in-the-ass award. Ironically enough, it's also the easiest part, once you know how to do it.

    1. Make sure that all of the samples are in the right place: the Voice folder in M2TW\data\sounds, and the sound text files in M2TW\data.

    2. If you have edited any of the sound text files, make sure you've moved the events.dat and events.idx files away from the M2TW\data\sounds folder or renamed them - if they're still there, nothing will happen!

    3. If you have edited the samples or added new ones, also make sure you've moved the voice1.* and voice3.* files away from the M2TW\data\sounds folder or renamed them - if they're still there, nothing will happen!

    4. Don't use the idx extractor to re-pack the samples - it doesn't work. Instead, run the game, and the game will repack new dat and idx files in M2TW\data\sounds by itself. This takes a few minutes, and once it's done, you should quit the game from the menu, or you might experience all kinds of weird errors. The next time you start the game, you'll be fine.

    Now you'll have new events.* and voice*.* files in your m2tw\data\sounds folder. Don't remove these new files (unless you've made new changes or want to uninstall your mod), or you will have to sit and wait for the game to repack your files again! Also make sure to keep the sound text files where they are, because you can't extract them again in case you want to make changes to them. If you delete these text files by accident, you'll have to start over from scratch.

    If you've edited the subtitle files, you will need to load these by running the game using a bat file, one that most mods use. The bat file should look exactly like this one: (right click and save as). Put it in your m2tw folder and run it instead of medieval2.exe to get your new subtitle files working.
    Last edited by Beiss; July 25, 2007 at 10:52 PM.
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  2. #2

    Default Re: Sound Modification Tutorial (WiP)

    Thank You Soooooooooooo Much !!!!!!!!!!!!!!!!!!!!!!!!!!

  3. #3
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,099

    Default Re: Sound Modification Tutorial (WiP)

    Are you being sarcastic? It's not even finished...
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  4. #4

    Default Re: Sound Modification Tutorial (WiP)

    what if you want to change what an existing unit says?

  5. #5
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,099

    Default Re: Sound Modification Tutorial (WiP)

    Sadly enough, you'll have to do the whole unpack and repack procedure. The rest is easy though - just change the filename you find under the unit you want to change in the EDSUV to the name of the file you wish to use instead (or simply replace the original file).
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  6. #6

    Default Re: Sound Modification Tutorial (WiP)

    thank you...
    but it didnt help.
    i did one thing not, you had in the tutorial
    and that is restarting the game twice after re-packing...

    but there are still no voices, and even stupid weird errors
    for example i cant hear the sound which comes,
    when you click on an enemy to attack.
    nothing, just the sound of the horses

  7. #7
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,099

    Default Re: Sound Modification Tutorial (WiP)

    Alright. Can you tell me what you did exactly? What are the file sizes of the .dat and .idx files in your data/sounds folder?
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  8. #8

    Default Re: Sound Modification Tutorial (WiP)

    im sorry to say it that plain but i did exactly what you write above under the section : "Enabling speech for a new unit "
    so i dont know what i did wrong.
    what might be helpful is that i use americas...
    and not the normal mtw2 for my mod.

    so i unpacked the sound there in my mod,
    made the entry in the edsuv...
    like you described...
    then i put the "voice" folder in the
    data/sound and put my new files in the right section,
    then i deleted the voice.dat and .idx and the events.dat and idx.
    started game (he didnt took any time for calculating he started the game normally )
    and then i clicked quit, and did nothing else,
    restarted and made a battle, and then there were the bad problems...

    hoping for solution
    nessj

  9. #9
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,099

    Default Re: Sound Modification Tutorial (WiP)

    Ok. What size are the events.dat and .idx and voice.dat and .idx now?
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  10. #10

    Default Re: Sound Modification Tutorial (WiP)

    voice are both 1KB, so i know it has to be wrong but why
    events.dat is 1347KB and the idx is 14 KB

    i added only two .wav's for 1 new unit

    but i think i also once had a voice.dat with more than 10 KB and it still didnt work
    but never mind, first i try to do this now...

  11. #11
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,099

    Default Re: Sound Modification Tutorial (WiP)

    Alright. Delete those files again, run the game, and when you hit the main menu, quit the game, look for a file named system.log.txt and search it for "sounds". That should give you some clues. If not, post the file here and I'll take a look at it.
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  12. #12

    Default Re: Sound Modification Tutorial (WiP)

    so.. finally i tried it again, delete files, quit game, start game again, try if the voice-sounds work, they do not work,
    quit the game, watch the log, which not contains the word : "sound"

    12:30:04.968 [system.rpt] [always] CPU: SSE2
    12:30:04.968 [system.rpt] [always] ==== system log start, build date: Feb 25 2008 version development ===
    12:30:04.968 [system.io] [always] mounted pack packs/data_0.pack
    12:30:04.968 [system.io] [always] mounted pack packs/data_1.pack
    12:30:04.968 [system.io] [always] mounted pack packs/data_2.pack
    12:30:04.968 [system.io] [always] mounted pack packs/data_3.pack
    12:30:04.968 [system.io] [always] mounted pack packs/data_4.pack
    12:30:04.968 [system.io] [always] mounted pack packs/localized.pack
    12:30:06.218 [script.err] [error] Script Error in mods/Colonialism_Total_War/data/descr_rebel_factions.txt, at line 452, column 21
    rebel unit type 'Mounted Apache' not available to faction type 'Indian_Rebels' (see unit ownership)
    12:30:06.265 [script.err] [error] Script Error in mods/Colonialism_Total_War/data/export_descr_buildings.txt, at line 73, column 129
    unit(Town Militia) does not match up to the ownership for faction(nederland)
    12:30:06.265 [script.err] [error] Script Error in mods/Colonialism_Total_War/data/export_descr_buildings.txt, at line 138, column 111
    unit(Musketeers) does not match up to the ownership for faction(nederland)

    thats my log after editing the sounds...with the original sounds it is the same...
    or was it another file i should post here ?

    nessj

  13. #13
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,099

    Default Re: Sound Modification Tutorial (WiP)

    I wasn't aware you were doing this under a mod. You have to make sure the sound text files are in the right folder, in your case, mods/Colonialism_Total_War/data/ rather than M2TW/data.

    Is that your whole log file?
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  14. #14

    Default Re: Sound Modification Tutorial (WiP)

    it is my whole log file, after 1 custom battle...
    without campaign starting

    the sound text files of americas, which i downloaded from the TWC
    are in the right directory...
    in mods/col...../data/

  15. #15
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,099

    Default Re: Sound Modification Tutorial (WiP)

    How many sound text files do you have in that folder now?
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  16. #16

    Default Re: Sound Modification Tutorial (WiP)

    i made a picture for you so that you can see the names...


    hope that it helps you by figuring out my problem... id ont know why ? i did everything right like in your tutorial...
    but okay, this are the files...

    1 question :

    do i need the MTW2 Sound text Files installed ? i only installed the Kindoms sound text files...
    but i have a own soundfolder in my mod, as you know...
    a idea i just got...

  17. #17
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,099

    Default Re: Sound Modification Tutorial (WiP)

    Yeah, you need the original sound files too. All of the Kingdoms files are also in the original collection, but those won't work with Kingdoms, so don't overwrite the kingdoms ones you have already, or, unzip them again after you unzip the original ones, overwriting the originals.
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  18. #18

    Default Re: Sound Modification Tutorial (WiP)

    i cant try it out at the moment because the stupid windows activation,
    but thanks fpr the support a lot, and when it will not work i come back
    u dont want to make a dutch accent for my mod, no ?

  19. #19
    Beiss's Avatar Nemo nascitur...
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    3,099

    Default Re: Sound Modification Tutorial (WiP)

    Haha. I'd love seeing one, but we're done creating accents, I think.
    Under the patronage of Halie Satanus, Emperor of Ice Cream, in the house of wilpuri

  20. #20
    Live2sculpt's Avatar Senator
    Join Date
    Sep 2009
    Location
    MI, U.S.A.
    Posts
    1,153

    Default Re: Sound Modification Tutorial (WiP)

    Assuming a modder has new sets of mp3s to use, and no concern for hard-drive space, what is preventing someone from adding more languages for the factions to be associated to? Is there a hard-coded limit?

    If four new complete sets of voices for four different languages were added into the sounds/voices folder correctly(not just replacing/renaming vanilla sets), would the game cache them along with the rest normally?

    Speaking re modfoldered changes; If only some new voices were added to an existing vanilla voice, would the game read those new ones in the sounds/voices mod-folder first, and instantly resort to vanilla versions if no custom mp3's are present for the others?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •