Sound Groups are collections of sounds for particular purposes, used by Entity Templates.

To use them in an entity template, use:

  <Sound>
    <SoundGroups>
      <walk>actor/human/movement/walk.xml</walk>
      <run>actor/human/movement/walk.xml</run>
      <attack>attack/weapon/sword.xml</attack>
      <death>actor/human/death/death.xml</death>
    </SoundGroups>
  </Sound>

A SoundGroup is defined in the following fashion:

<?xml version="1.0" encoding="utf-8" ?>
<SoundGroup>
	<Gain>1</Gain>
	<Priority>80</Priority>
	<RandGain>1</RandGain>
	<GainUpper>1</GainUpper>
	<GainLower>0</GainLower>
	<Path>audio/actor/fauna/death</Path>
	<Sound>camel_death_10.ogg</Sound>
	<Sound>camel_death_11.ogg</Sound>
</SoundGroup>

SoundGroup Attributes

Sound

  • Required
  • Type: String
  • Description: A file to play, without path. You can have more than one of this entry.

Path

  • Required
  • Type: String
  • Description: Base path to audio files

Gain

  • Optional
  • Type: Float
  • Default: 0.7
  • Description: Volume of effect in game. 1.0 is full volume, lower values are quieter. Cannot be set higher than 1.0.

RandOrder

  • Optional
  • Type: Boolean Integer
  • Default: 0
  • Description: If 0, then the sounds will be selected to play in the order defined in the soundgroup. If 1, they will be selected to play at random.

RandGain

  • Optional
  • Type: Boolean Integer
  • Default: 0
  • Description: If set to 1, then the Gain will be overridden by a value selected at random from between GainUpper and GainLower, with a different value being chosen each time a sound in this group is played.

GainUpper

  • Optional
  • Type: Float
  • Default: 1.0
  • Description: The upper bound of the RandGain

GainLower

  • Optional
  • Type: Float
  • Default: 0.8
  • Description: The lower bound of the RandGain

Looping

  • Optional
  • Type: Boolean Integer
  • Default: 0
  • If set to 1, this sound will loop indefinately.

Omnipresent

  • Optional
  • Type: Boolean Integer
  • Default: 0
  • Description: If set, this soundgroup will be played whether the source is onscreen or not. Volume will be affected by distance between camera and source.

Distanceless

  • Optional
  • Type: Boolean Integer
  • Default: 0
  • Description: If set, this soundgroup will be played whether the source is onscreen or not. Volume will not be affected by distance. Ideal for alerts and global sound effects.

HeardBy

  • Optional
  • Type: String
  • Possible Values: "owner"
  • Default: Unset/NULL
  • Description: Who should hear this sound. If not set, then everyone will hear the sound (distance/on-screen permitting). If set to "owner", then only the owner of the entity making the sound will hear it. No other values are permitted.

Pitch

  • Optional
  • Type: Float
  • Default: 1.0
  • Note: Must be larger than 0
  • Description: Desired pitch shift, where 1.0 equals same pitch out as in. Each reduction by 50 percent equals a pitch shift of -12 semitones (one octave reduction). Zero is not a legal value.

RandPitch

  • Optional
  • Type: Boolean Integer
  • Default: 0
  • Description: Whether or not Random Pitch-Shifting is enabled for this effect

PitchUpper

  • Optional
  • Type: Float
  • Default: 1.1
  • Description: Upper bound of the Random Pitch Shifting. See description for Pitch.

PitchLower

  • Optional
  • Type: Float
  • Default: 0.9
  • Description: Lower bound of the Random Pitch Shifting. See description for Pitch.

Priority

  • Optional
  • Type: Float
  • Default: 60
  • Description: The priority of the sound. In cases where there are too many sounds active for the system to play them all, or cases where two sounds need to be started in the same frame, higher priority sounds take precedance.
  • Recommended values:
    • 100 - emergency use only (undefined overhead)
    • 90 - required (voiceover, you are under attack warning)
    • 80 - rather important (battle sounds, death, destruction)
    • 70 - rather important (building)
    • 60 - not so important (resources)
    • 50 - fluff (ambient - birds, etc.)

Cones

Sounds in 0AD may be directional. This is simulated with the use of two cones, one inside the other. The sound is played at the volume set by <Gain/> inside the inner cone, with the sound attenuating (decreasing) between the edges of the inner and outer cones until it hits the volume set by <ConeGain/>. The direction of the cones are determined by which way the entity making the sound is facing. (Diagram may be needed)

ConeGain
  • Optional
  • Type: Float
  • Default: 0
  • Description: This is the volume of the effect outside the directional cone.
ConeInner
  • Optional
  • Type: Float
  • Default: 360.0
  • Description: Inside angle of the sound cone, in degrees. The default of 360 means that the inner angle covers the entire world, which is equivalent to an omnidirectional source.
ConeOuter
  • Optional
  • Type: Float
  • Default: 360.0
  • Description: Outer angle of the sound cone, in degrees. The default of 360 means that the outer angle covers the entire world. If the inner angle is also 360, then the zone for angle-dependent attenuation is zero.

Unused Attributes

These are not currently used by the Sound Manager (at least as best as this author can tell, anyhow)

Replacement

  • Optional
  • Type: String
  • Remarks: Haven't a clue what this is/was supposed to be. Clears grammar checks, but not actually read by pyrogenesis, nor is there a space reserved for it in the cpp object.

Threshold

  • Optional
  • Type: Float
  • Default: 3
  • Remarks: Read and stored in the cpp object, but not used.
  • Description: Intensity Threshold switching value. The Sound Manager was going to have this concept of "Intensity". Essentially, if you have one gatherer collecting wood, the system will play a (randomly selected from the group) sound effect of a single axe htting wood. A second gatherer joins in, and the system ends up playing two sounds from the same group within a short space of time. As the number of gatherers increases, then the system is suddenly having to play multiple sounds simultaneously from the same group, which apart from potentially not sounding good, isn't good for performance. To keep things simpler for itself, once the sound manager reaches the point where its playing a given amount of sounds or more simultaneously from the same audio group, then it will switch to playing a single sound effect of multiple hits. This value is, as far as I can determine, the threshold at which this group would stop and the one above it would start. The intensity system was never fully implemented, so this value is useless.

Decay

  • Optional
  • Type: Float
  • Default: 3.0
  • Remarks: Read and stored in the cpp object, but not used.
Last modified 9 years ago Last modified on May 22, 2015, 11:56:57 PM
Note: See TracWiki for help on using the wiki.