Destinations/Adding Sound/Soundscapes

From Valve Developer Community
Jump to: navigation, search
简体中文

A guide to adding new Soundscapes to your Destination


  • If it doesn't already, ensure your addon has a soundscapes_manifest.txt and soundscapes_template.txt file in the scripts directory under game/steamtours_addons/youraddon.
  • Rename soundscapes_template.txt to suit the addon, and then adjust the reference in soundscapes_manifest.txt on line 3 accordingly.
  • Sound files go in the content/youraddon/sounds/ folder.


Documentation on how to create custom soundscape entries exists here - Soundscape

Note:Unlike some other Valve titles, Destinations does not yet use reverb DSP.

The map entity required is documented here - Env_soundscape


Example

Here is an example of a workflow for a simple soundscape, with a looping ambient bed and some randomized spot sounds around the listener.

  • In your map, add an env_soundscape entity. Ensure the radius covers the info_player_start entity by moving it closer and/or adjusting the Radius property in Hammer.
  • In the new env_soundscape entity, set the Soundscape property to the name you want for your soundscape, for example - soundscape_whitelodge
  • Add your audio files to the sounds folder. In this case we'll say there is one looping .wav file called "forest.wav" and three ‘spot sound’ .wav files called "owl_01.wav", "owl_02.wav" and "owl_03.wav". Ensure looping sound files have loop markers set up.
  • Open your soundscapes script and add the following.
"soundscape_whitelodge"
{
                "playlooping"
                {
                                "volume"        "0.5"
                                "pitch"         "100"
                                "wave"          "sounds/forest.vsnd"
                }
                "playrandom"
                {
                                "volume"        "0.35"
                                "pitch"         "100"     
                                "time"          "10, 15"
                                "soundlevel"    "SNDLVL_50dB"
                                "position"      "random"
                                "rndwave"
                                {
                                       "wave"       "sounds/owl_01.vsnd"
                                       "wave"       "sounds/owl_02.vsnd"
                                       "wave"       "sounds/owl_03.vsnd"                                                  
                                }
                }
}

Note: The .vsnd extension is for the compiled version of audio files in Source 2. When the sound first plays, it will get compiled into a .vsnd automatically. You don't need to change the audio file extension by hand, just use .vsnd in the soundscape script.

  • Build the map and you'd now be able to hear forest.wav looping, and at randomized start times with a 10 to 15 second gap one of the owl files playing from a random position around the listener.
  • If you'd like the owl sound to emit from a single set location, swap "position" for "origin" and provide the "x, y, z" coordinates relevant to your map.
  • Adjust the volume, pitch, time and soundlevel to suit. The VConsole command 'cl_soundscape_flush' will allow you to reload the soundscape to hear tweaks.

Note: If the playlooping or playrandom entry does not include a position, soundlevel will not affect anything as there is no falloff of volume over distance.