View Full Version : Unit Sounds Tutorial


Vuldacon
Feb 24, 2008, 04:55 AM
Unit Sounds Tutorial by Vuldacon February 2008:

This is to try and offer a little help concerning Unit Sounds for Units but is only meant as general information to get you started.

To add a sound to any Unit, first make sure the sound is in .wav format or change it to .wav.

How to convert any .wav sound file to use for Civ3, PTW or Conquest:

On your computer, go to start then programs/accesories/multimedia or entertainment and click on SOUND RECORDER.

All Civ3 .wav file formats are at 22,050 Hz, 16bit Mono, 43 kb/s and Need to be set this way for proper in game use.

On the Recorder, Click on open and search for the .wav file you want to check or convert. Double left click the wav file and it will be in the Recorder.

Click on PROPERTIES. Here you will see the Audio Format of your sound listed.

On the screen you click [CONVERT NOW] Then under "Name" in this sound selection Box, use the Arrow Key and select "Radio Quality"(This is the Correct Format 22,050 Hz, 16bit Mono, 43 kb/s). Click OK then OK on the next box and save the sound as a new name or overwrite the original. Finished.

Alternately, you could search for the wav format (22,050 Hz, 16bit Mono, 43 kb/s)... [Use Arrow Button], select the format, hit ok and save. Note that you may either save as a different name or simply save and Over Write the .wav file where you found it...And your Finished!

...As for adding the sound to a Unit flc...name the sound what ever you like and then type the name Exactly as it is into the .INI file (located in the Units Folder) for the Unit. The sound will be typed in the appropriate place (on the bottom half, Under "[Sound Effects]" ) inside the .INI file. Here is an Example of that part of the .INI where I added the Attack sound for the "Beholder" Unit:
[Sound Effects]
BLANK=
DEFAULT=
WALK=
RUN=BeholderRun.wav
ATTACK1=BeholderAttackA.wav
ATTACK2=BeholderAttackB.wav
ATTACK3=BeholderAttackC.wav
DEFEND=
DEATH=BeholderDeath.wav
DEAD=
FORTIFY=BeholderFortify.wav
FORTIFYHOLD=
FIDGET=BeholderFidget.wav
VICTORY=BeholderVictory.wav
TURNLEFT=
TURNRIGHT=
BUILD=
ROAD=
MINE=
IRRIGATE=
FORTRESS=
CAPTURE=
STOP_AT_LAST_FRAME=
JUNGLE=
FOREST=
PauseROAD=
PauseMINE=
PauseIRRIGATE=
PauseFOREST=
[Version]
VERSION=1
[Palette]
PALETTE=

Note: you can check the timing needed (Length for the sound) by opening the flc that will be used for the sound in "Flicster" and reading the "Animation Time". Move the decimal point to the Left 2 and sometimes 3 spaces for the actual time. Example: Animation Time of the warrior is 1250. That is 1.25 seconds. Depending on where the decimal point is, use judgement on the timing concerning the placement of the decimal point. Generally not much more than a second is used and many under 1 second.

If you want to use an existing unit sound from the game you can type ..\the unit folder name\the name of the Sound.wav in the .INI and the game will use that sound. Example: ..\warrior\WarriorDeath.wav

Be Exact about typing the Folder name and the sound name. Computers are Exact and can only "understand" exactly what is there.

Example: for using the game warrior sounds: , type any sound you want to use in the .INI file like this example:

[Sound Effects]
BLANK=
DEFAULT=
WALK=
RUN=WarriorRun.amb
ATTACK1=..\warrior\WarriorAttackA.amb
ATTACK2=..\warrior\WarriorAttackB.amb
ATTACK3=
DEFEND=
DEATH=..\warrior\WarriorDeath.wav
DEAD=
FORTIFY=..\warrior\WarriorFortify.wav
FORTIFYHOLD=
FIDGET=..\warrior\WarriorFidget.wav
VICTORY=..\warrior\WarriorVictory.wav
TURNLEFT=
TURNRIGHT=
BUILD=
ROAD=
MINE=
IRRIGATE=
FORTRESS=
CAPTURE=
STOP_AT_LAST_FRAME=
PauseROAD=
PauseMINE=
PauseIRRIGATE=
[Version]
VERSION=1
[Palette]
PALETTE=

Note: .amb files are files that tell the game the sequence of how several sound bytes are played. IF you want to place an actual copy of any game unit sounds into your new unit folder and the existing unit uses an .amb file, be sure to copy the .amb file and ALL of the sounds that go with the .amb file into your new unit folder.

You can open the .amb file with WordPad to see the sounds it uses but generally, you can see those sounds by looking at all of the sounds used in the Folder and selecting the ones that go with the flc such as Attack.

Run Sounds are the Most difficult to have play back correctly for units so .amb files are preferred. It is possible to make Run Sounds that will work without .amb files but they require a great deal of experimenting and "Trial and Error" tests for a Unit in the Game. Sometimes you will have to set more "silence" (See "One other thing" below) after sound bytes for a sound to make the timing work well. Other Times you will want to completely fill in the entire length for a sound you are making so there is no silence at all in it. Silence is the Blank areas in a sound .wav where you do not hear anything between sound bytes that you do hear such as between Gun Shots on the same sound .wav for an attack. There seem to be "Triggers" I will call them, that tend to make the Game engine play or loop at that sound byte place in the sound .wav. An example of this is if I place an abrupt sound in or after a smoother sound byte that takes place close to the same time as the length of the animation the sound .wav is for. The Sound will loop at that place even if the sound continues longer. IF this does not make sense, it is like when you have a Run Sound that is looping somewhere in the middle of the sound you have and also playing again after the unit stops Running...when the animation is finished. This also happens with Attacks when a Unit Moves away from battle and the Attack sound plays again while the Unit is Running away. Now there are other things that cause this to happen besides a "Trigger" in the sound such as Animation Time vs the Length of the Sound being used.

Even the CIV Game Units do not always play correctly in a game, even the ones that use .amb files, so just try to do the best you can with sounds for your units.

There are several other factors concerning creating sounds that work well with flcs for the game. It all has to do with the way the Game Engine plays the sounds in a loop and what needs to be handled and adjusted for the sound to play well with the Unit Flc. Basically sound bytes are applied to the sound in the areas where the action takes place in the animation. Very basically, animations and the sounds will tend to be the same general length but again, there are other factors that can change this.

Example: IF you have a Good Sound Program that will allow you to open a sound and adjust the sound bytes in the .wav:

Count the Frames in the animation for each action starting with the first frame. Multiply each frame by the Flc Speed (add a 0 in front of the Flc Speed) and in this example I am using an Attack that has 6 Gun Shots in the animation. The Shots take place on Frames 1, 2, 4, 5, 7 and 9. The Attack Flc Speed is set to 65 so this is .065 for each Frame. This means Frames 1=0 to .065, 2=.065 to .130 and this is the length of the First two attack Frames where the Unit shoots. Then skip 3= .130 to .195 that has no shot, Now add Frames 4 and 5. Starting the sound for Frame 4= .195 to .260 and from frame 5= .260 to .325. Skip Frame 6= .325 to .390 no shot and then start the sound on frame 7= .390 to .455, Skip frame 8= .455 to .520 no shot and start the sound on frame 9= .520 to .585
...To Clairify, IF Your Unit action starts on Frame 2, for example, you would use the biginning of frame 2 to start your sound byte, which is also the end of Frame 1. IF the Unit action only takes place on Frame 2 and does not continue then you would use the Length of time for just one frame of your animation for the sound Byte in the sound you are making. Use "Silence" for all other Frames so the sound will play silence through those no sound areas. See "One other thing" Below.

Note, in this example, that each Frame plays .065 of a second so the frames where the unit shoots will last .065 each. You can have an echo and even overlap the sound bytes but the initial "Blast" for the shot action starts at the beginning of the frame where the unit shoots.

If you use an existing unit sound for a New unit, you must at least match the Number of Frames and Flc Speed with another Unit that has the same figures. Not only this but the frames where the actions take place is important to have the sound byte placed where it needs to be to match the frame where the action happens. Sounds are many sound bytes combined and mixed, etc... so the, generally, 1 second sounds we have for units are actually many different sound bytes all put together with timing for the animation actions.

IF you do not have a Good sound Program, you can at least generate storyboards of existing Game Units and look where the actions take place. You can then animate your Unit where the action takes place on the same frame and be sure to use the same number of frames and Flc Speed as the Unit you want to use the sounds from. You can then Use the sounds from the existing unit for your New Unit.

The CIV Game Units tend to use many animations set at 66 Flc Speed. Without having to understand or explain why, it is best to use what the Game uses well for animation Flc speeds and sounds.

One other thing I want to mention is that when you use a blank space between sound bytes in a sound you are putting together such as separate Gun Shots in a single sound, use an inaudible sound that the game engine will play but that cannot be heard to fill the Blank space. The Reason is to Prevent the Game Engine from skipping through the Blank areas as IF the space of silence is not there. I use this in all areas where there is any Blank space in a sound file. I call it "Silence.wav" and keep it for use. I will attach this 2 second length "Silence.wav" to this Tutorial... Get it Here (http://forums.civfanatics.com/downloads.php?do=file&id=8532)

...there is more to sounds than most know or want to believe but we can keep it as simple as possible by handling units in a manner that will allow existing unit sounds to work well with them...otherwise we need to get a good sound program and learn how to use it. :) This is about as complicated as Learning how to use "Poser" or other animation programs but with some effort and experience, you can do it. There are several Sound Programs you can find on the Internet for Free that you can put to good use if you cannot afford an expensive Sound Program. A Google Search can provide what is available.

...Hope this was clear and helps explain some aspects of what to consider when applying sounds to your Units.

...Good Luck.

Cheers,
Vuldacon

Blue Monkey
Feb 24, 2008, 09:18 PM
Very clear & with the details that true first timers need but often are assumed to be common knowledge or buried in another thread. Thanks.

T-mun
Mar 01, 2008, 08:18 AM
Everything useful is gathered here, that's a really cool idea. The same should be done for graphics and anims (reminders of all the basics you need). I didn't read it all but my attention was caught by the "silence.wav": I'm not sure I understand what's the use of it. I've never used the Sound Recorder from MS so I'm not aware of its particularity. In other "Sequencers" like Protools or Cubase/Nuendo (and others) you can put small wave samples anywhere you want, even with long blanks between them and then export a big wave file with silences where you had put them. Anyway a major cause of trouble is that your samples may be cut harsh and the program will do some "clipping" when reading them. For example: Footstep-pook-footstep-pook-breath-pook-footstep-pook-etc (where "pook" is an electronic clipping). If samples are short then it's played fast and you mainly hear the pooks make the sound of an old 56k modem connecting... the only way (that I know) to deal with it is to make very small "fade-in/fade-out" on each sample. Audacity can deal with it, not sure the Sound Recorder can. Audacity is a free audio editor that can be found here (http://audacity.sourceforge.net/). Hope that helps. I'll post a pic ASAP so things will be easier to understand (a good pic is better than a long talk).

Vuldacon
Mar 01, 2008, 10:31 AM
Good info themanuneed... I use several sound programs so I am not speaking about MS Recorder. The "Silence.wav" is to fill in the Blank areas...at least I have found that without it, the CIV Game Engine tends to skip any Totally Blank areas in a Sound as if they are not there. This causes problems when there is a need for the Blank Spaces to be "played" for timing such as between Gun Shots or Foot Steps, etc... IF there is something else that can be done I would like to know about it.

T-mun
Mar 01, 2008, 01:06 PM
:huh: That's really weird... I just can't imagine such a thing. How does the sound engine know there is a blank ? It should play the wave from start to end! You mean it detects silences and SKIP them ? But what's the use of this ? Video games are definitely made by people who don't know anything about sounds... I've never seen a game that didn't have a weird sound engine. The fact is that good sounds are heavy files. So they need a way to read crappy sounds and make them seem great. There's always a dll that plays that part. Baaaaaad stuff...

Vuldacon
Mar 01, 2008, 02:00 PM
Themanuneed... No you misunderstand the point. The "spaces" of silence in a sound need a wave in order to be "Played". IF they are simply totally Blank with no sound wave, this will be "read" as nothing and the timing for the actual sound bytes in the sound will not play correctly. At least this is what I have found that effects a sound with multiple sound bytes that use "spaces" of silence in a sound between them .

T-mun
Mar 06, 2008, 04:13 PM
That's just because the audio engine is very very poor in Civ3, I mean very "special". There cannot be a total blank inside a wave: there is still something. With any sound program you can make a perfect 0dB file (record a track without giving it an input to record from your sound card), let it last a few seconds and then read it with any sound player. The cursor will move and... you'll hear nothing. The cursor's move proves there IS something to read. No blank. In fact your "silence.wav" is noise, not silence. A very low noise that the bad audio engine interprets as a silence, which in fact is wrong. Which proves how bad it is :D Tadam! That's a highly theoretical demonstration :lol: I hope someone could understand it!

Vuldacon
Mar 06, 2008, 07:25 PM
Yes...I stated to use an "inaudible sound" between sound bytes such as Gun shots in the tutorial. I also realize that everything is read in a sound file including the silent areas by most playback equipment but for what ever reason, the CIV game does not seem to do this.
I am no sound expert by any stretch of the imagination and can only say that an inaudible sound has worked better than a totally silent space between sound bytes in a .wav for the CIV game units.
Try Testing some of the Original Sounds and you will discover that they have inaudible sound in "Blank" areas.

aaglo
Mar 07, 2008, 04:53 AM
I think it's pretty cool, that you ended up doing this tutorial :) - you've been a great help to us all, Vuldacon :)

Now, let me help you also.
I use this freeware program to create my unit sounds:
http://nch.com.au/wavepad/index.html

It has some simple effects to work with (echo, reverb, eq, reverse, speed&pitch changes).
The quality of some of the sounds is not amazing, but It'll work quite well.

Cheers :)

Bjornlo
Mar 07, 2008, 05:03 AM
I use audacity and Windows sound recorder. Audacity is free and you can get it from downloads.com. Sound Recorder is part of the OS.

With both, it is possible to make flat spots which are very very close to silent.

aaglo
Mar 07, 2008, 05:09 AM
That wavepad is also free, and you can insert silences with it too. Which are pretty silent to my ear... altough I play bass in a band, so you shouldn't take my word on that too seriously.. :p

Vuldacon
Mar 07, 2008, 05:33 AM
Thanks aaglo and Bjornlo... People can use the information you posted to obtain a free sound program they can use :goodjob:

This "Silence" sound issue is actually just an inaudible sound rather than a Totally Blank Space. IF the Sound is increased in Volume, it can be heard. As I stated, I am no Sound expert at all... themanuneed knows far more as a professional. This is all just my attempt to offer what I know (and think I know) to help with making unit sounds for the CIV Game. This is not any attempt to explain sound but rather an attempt to explain how to use it for CIV Game Units.
It is Best to apply a so called inaudible sound After making the Unit Sound as wanted with its level of Volume to keep the inaudible sound in the spaces inaudible :)

T-mun
Mar 12, 2008, 04:07 PM
That wavepad is also free, and you can insert silences with it too. Which are pretty silent to my ear... altough I play bass in a band, so you shouldn't take my word on that too seriously.. :pI didn't know this "wavepad", I'll take a look at it (I mean a hear). The site has other useful stuff, I'll try them. Private discussion "hey! I play bass too!" Being a professionnal in sound recording and live events for a few years made my ears a little less sensible too ;) Don't stay too close to your drummer, or put ear-plugs...

AnthonyBoscia
Dec 18, 2011, 02:21 PM
Useful and concise tutorial, Vuldacon.

I found that I wasn't the only one wondering where the sound recorder was on Windows 7. Turns out that it's hidden. I also can't find a way to make it open existing sounds. So I'm attaching the Sound Recorder from XP, which you described how to use in the first post. No installation needed, just unzip and go.