Home
Screenshots
Downloads
Forums
Docs
Servers
Stats
IRC Chat
Mods

Special Special    Search Search    Login/Logout Login

Main Page » Ambient Sound Files
Ambient Sound Files

Contents

Description

Ambient sounds are pretty much any sound that isn't played directly from a weapon. They can be played either from a specific point on the landscape, or they can be played from the different objects in a landscape placement group. Sounds can either be played after a set range of time or they can be looped continuously.

Ambient sound files are typically referenced from within a texture file by adding the following:

  <ambientsounds>
     <ambientsound>data/landscapes/ambientsound*.xml</ambientsound>
     <ambientsound>data/landscapes/ambientsound*.xml</ambientsound>
  </ambientsounds>

However, as of v41, ambient sounds can also be constructed within a landscape include file as well.


File Layout

The ambient sound files should typically be located under your game installation's (or mod's) /data/landscapes folder, although you can put them anywhere you wish. They are usually named ambientsoundmyfilename.xml, where myfilename is the name of the ambient sound or group of sounds, but again, its at your discretion whether or not to follow convention.

The basic layout of each ambient sound file will look like this:

<ambientsound>

  <sound>
     <position type="..."> An ambient sound position type
        ...
     </position>
     <timing type="..."> An ambient sound timing type
        ...
     </timing>
     <sound type="file"> The sound file and its properties
        ...
     </sound>
  </sound>
  <sound>
     ...
  </sound>

</ambientsound>


Each sound will have it's own <sound></sound> tags and all the necessary info for each sound such as its position and timing are contained within those tags. More detail on what each sound will contain can be found in the following section.


Sound Position

Each <sound> tag can contains a position type. The position type determines where the sound is played from in the world. The current types of positiong available are: group, absolute, set, water and ambient. Descriptions are in yellow.

Group Position

This group type can play sounds from all objects in a placement group contained in a placements file.

  <position type='group'>
     <name>groupname</name>
        Name of the placement group containing the objects that the sound should come from
     <falloff>#</falloff>
        Controls the rate at which the volume decreases as you get further from the sound
        higher value = sound travels less far
        lower value = sound travels farther
  </position>

Absolute Position

This position type plays the sounds from a specific point on the landscape.

  <position type='absolute'>
     <position>
        Coordinates to play the sound from
        <A>#</A>
           North/South value, 0 = south edge
        <B>#</B>
           East/West value, 0 = west edge
        <C>#</C>
           Altitude, 0 = seafloor level
     </position>
  </position>

Set Position

I think its similar to group but sets sounds to keep playing from a specific member of that group? Not sure

  <position type='set'>
     <maxsounds>3</maxsounds>
        Maximum number of simulataneous sounds
     <name>boids-f16</name>
        Name of the group to bind this sound definition to
  </position>

Water Position

Plays sounds from the water near the camera?

  <position type='water'>
     <falloff>#</falloff>
        Controls the rate at which the volume decreases as you get further from the sound   
  </position>

Ambient Position

I believe it plays the sound from a set position relative to the camera at all times. So instead of fading in and out as the player moves around, it will sound the same from any position.

  <position type='ambient'></position>

Sound Timing

In addition to a position type, each <sound> tag has a timing type as well. The timing type determines when and how often these sounds will be played. The types available currently are repeat and looped.

Repeat Timing

  <timing type='repeat'>
     Sound will be repeated after a specified amount of time passes each time.
     <min>60</min>
        Minimum amount of time before the sound is played each time
     <max>120</max>
        Maximum amount of time before the sound is played each time
  </timing>

Looped Timing

  <timing type='looped'></timing>
     Sound is played over and over in a continuous loop.
  The sound tag specifies which sound to play and it's settings.

Sound Files

Once you've setup where the sound plays from and how often it plays, its time to set what sound(s) to play. Currently WAV and OGG files are supported.

  <sound type='file'>
     <file>data/wav/misc/citysounds.wav</file>
        The location and name of the sound file to play
        The sound can be a WAV or OGG file
     <gain>1.0</gain> (optional)
        Amount to increase/decrease the sound by (2.0 = 200%)
     <rolloff>#</rolloff> (optional)
        Affects distance the sound travels (default = 1.0)
        Higher value means the sound won't travel as far
        Setting to 0 means the sound never gets quieter
     <referencedistance>#</referencedistance> (optional)
        Used to calibrate the sound rolloff (default = 75.0)
        Distance at which the sound's volume will drop by half
  </sound>

Closing Remarks

Ambient sound definitions are not terribly complex, but when used properly they can add a nice bit of realism to any landscape setup. They are especially powerful when used in conjunction with many of the other landscape files.




Edit this pagePage historyWhat links hereRelated changes
Donate to Scorched3D Visit Scorched3D at SourceForge.net Get it from CNET Download.com! 5 Stars
© Copyright 2008 Gavin Camp. All Rights reserved.