Sunday, September 7, 2008

Ambience Sounds

hi, this week i added ambience sounds, so i could place sounds in the scene which will be played based on their properties defined in the map file.
unlike other sounds, those sounds usually played automatically (some ambient creepy sounds), or by triggering some triggers/events (like opening a door, or using an elevator)
here is an example of sound entity defined in the map:
{
"origin" "753.48 2078.26 66.7"
"classname" "speaker"
"angle" "315.181274"
"s_shader" "sound/ambience/music.ogg"
"s_looping" "1"
"s_shakes" "0.000000"
"name" "speaker_2"
"s_volume" "-6.000000"
"s_mindistance" "512.000000"
"s_maxdistance" "1200.000000"
"s_occlusion" "0"
"s_waitfortrigger" "0"
"soundgroup" ""
"wait" "0.000000"
"random" "0.000000"
"s_global" "0"
}

ok, so what are all those properties do? here is a quick info:
origin - the position in 3d space of the sound (if ambient this will be ignored)
classname - internal use, basically its the type of the entity
angle - control the spread of the sound
s_shader - sound shader or sound media file (.wav, .ogg, .mp3)
s_looping - need to loop or not (repeat the sound over and over)
s_shakes - shake factor controlling how strong the view will be shake when playing the sound (also based on the loudness of the sound)
name - name of the sound/speaker entity
s_volume - volume of sound (in decibels)
s_mindistance, s_maxdistance - minimum and maximum audible distance for the sound
s_occlusion - is this sound need to take care of geometry occlusion or not
s_waitfortrigger - sound will be played only when the right trigger will be triggered
soundgroup - the group the sound belongs to, useful for setting volume for few sounds, for example, all music sounds added to group "music" so if we want to mute the music in the game we just mute the group called "musics" and its done.
wait - delay between playing the sound again
random - random factor added to wait when needing to play the sound again
s_global - is this sound need to be heard every where (makes the sound ambient - used for music), if its ambient the sound will ignore his 3d properties.
so as you can see it is very easy to define ambient sounds in the scene, those sounds adding alot to the game play and make the game more realistic.
for now, geometry occlusion is not supported maybe i will add it next time.

No comments: