Adding ambient Sounds to your Map

From The DarkMod Wiki
Jump to navigationJump to search

written by greebo

Ok, I will try to explain how to get a nice ambient sound into your map. Note that this ambient sound can be heard everywhere in your level. If you want to have certain areas playing certain ambients, this won't do the trick for you.

Choose your Ambient Sound

All the Dark Mod ambient sounds are saved in the /sound/ambient/ambience folder. Fire up your preferred Media Player and pick one that's suitable for your map. We will use the sound darknessfalls.ogg for this tutorial.

The according sound shaders are stored in the /sound/tdm_ambient_ambience.sndshd file. Open it with the text editor of your choice and find the name of the sound shader. Our chosen sound is defined in this block:

darknessfalls
{
     description "Made by Darkness_Falls"
     sound/ambient/ambience/darknessfalls.ogg
}

The string outside of the curly braces is the name of the sound shader. We will need it for accessing it later via DarkRadiant.

Create a Speaker

Open up your map in DarkRadiant and right-click somewhere in the orthogonal view and choose "Create Entity...":

createentityss3.jpg

Select speaker. And voilà, the newly created green box is your speaker. You can drag it anywhere you want in your map, the actual place is irrelevant to the ambient.

createdspeakerib9.jpg

Set the correct Key/Values

The following key/values have to be set:

s_shader      <Name of the sound shader to be played>
s_looping     1
s_global      1
s_omni        1
s_volume      30

In the Entity Inspector it should look like this:

entityinspectoreo1.jpg

A short explanation what these values do:

  • s_shader is the name of the sound shader being played. Nothing special here, just beware of typos.
  • s_looping should be set if you want to repeat your sound over and over. If this is set to 0, your sound will stop after one playback.
  • s_global this the key that makes the sound ambient, so it can be heard everywhere. There is no need for s_min or s_max as the sound plays with the same volume everywhere.
  • s_omni this makes the sound play from every direction, as it is supposed to do for an ambient.
  • s_volume the volume of your sound. Note that the right volume heavily depends on the loudness of the actual ogg file and the nature of the ambient being played. Just experiment a bit with this value until you're satisfied.

Save the Map and test it

This is all there is to say, I believe. If you have problems with hearing your chosen ambient, be sure to check for typos in both the entity keys as well as in the sound shaders.

See also