Custom Soundscapes
What?
Sometimes it can be hard to find an official soundscape that fits your map. So a custom soundscape can be used to create the ambiance you want.
How?
I will write a very simple and short soundscape file. Hopefully it will be enough for you guys to see how easy it is to add a special feeling to any map.
Hold up! What is a Soundscape?!
This soundscape tutorial should help answer any questions about standard soundscapes.
----
Soundscapes are textfiles, meaning they are very lightweight. So it's a great way to make your map a little more unique without increasing the .bsp size!
It's amazing, so let's get started.
The first thing you need to do is create your soundscape file with a proper name and in the correct location.
A map named "ctf_examplemap_a3" must have its soundscape file named "soundscapes_ctf_examplemap_a3.txt".
cp_testmap_b1 -> soundscapes_cp_testmap_b1.txt
plr_tutorial_rc -> soundscapes_plr_tutorial_rc.txt
<yourmapname> -> soundscapes_<yourmapname>.txt
And the .txt goes in the tf/scripts folder. If you can't find it, go ahead and create it.
Nice! Now that all preparations are complete we can start working. Excuse the swedish interface, I hope it won't distract too much!
For this map I decided I wanted 2 custom soundscapes, one for outside and one for inside ambiance. It's of course possible to create more if needed.
dsp = Digital Signal Processor. Basically it adds echoes and reverb to playing sounds. Textures already do this automatically depending on their materialtype, and it's not really that important in tf2. I've never used anything but "1" (default behaviour) for my soundscapes. [List of dsp effects (thanks SgtBarlow)]
Let's actually add some sound... finally.
To find what sounds you can use, open the sound browser inside Hammer, it also tells you the file path.
... Let's explain what just happened.
Firstly, I added a "playlooping" rule/function. As expected from the name it will loop any sound endlessly.
Inside the brackets useful keyvalues are found/written.
"volume" is a float value between 0 (silent) and 1 (max volume).
"pitch" is a percentage value. A value of 100 means it will play the sound without any pitch modifications.
"wave" is the file path to the sound played.
This soundscape (example.outside) now plays are very generic outdoors sound. It's not very interesting to listen to. To spice it up a little we can mix in some more looping tracks. (just copy-paste the previous "playlooping" and switch the "wave" path.)
This should be exciting enough for background noise. But I want more birds. But a "playlooping" of a birdsong is very very VERY annoying to listen to, luckily there's another function called "playrandom".
"playrandom" is used for anything that isn't a looping sound.
Here we find some new keyvalues:
"time" is a value in seconds. The time between playing each sound.
"rndwave" is an array of "wave"s. Everytime the "playrandom" fires, it will pick a random sound to play from the ones listed.
You may notice theres 2 values in some of the keyvalues. These are optional intervals increasing the randomness of the sounds. Values are separated with a comma (,).
Between every 10 to 30 seconds it will play a sound. The sound will be between volume .5 to 1 but it will always have normal pitch (of course you can have random pitch too).
Perfect.
Now there is only 1 thing left, sound positions!
Thankfully they are incredibly easy to create. It's just a normal "playrandom" (or "playlooping") like the one we just created but with an extra keyvalue; "position".
"position" can be anything between 0 to 7. You can only have 8 soundpositions for each soundscape.
In my case I can have a maximum of 8 for "example.outside", and 8 for "example.inside". But I think 1 is enough this time.
"attenuation" is a float value between 0 and 1. It determines how fast the sound will fade when moving away from the soundposition.
That is basically all there is to it, now I can use the exact same method to make the "example.inside" soundscape. There are no limit to how many "playlooping" or "playrandom" you can have in a soundscape. Don't get too crazy with the random demoman burp soundpositions though
To put the soundscape in the map, just do it as you would with any valve soundscape, just put the name of your custom soundscape in the env_soundscape (for this tutorial it would be example.outside or example.inside).
When fine-tuning the soundscape it's a good idea to have tf2 running and just use console command "soundscape_flush" to reload the soundscape and hear any changes you made.
When packing a soundscape into your bsp remember that the filename must be the same as the map, ALWAYS! Very often I forget to change the version number on the soundscape when updating my maps... very frustrating.
It should be packed in the /scripts folder inside the bsp.
----
I hope this tutorial helps! If I missed something be sure to point it out, ask questions if you don't understand. Good luck!
What?
Sometimes it can be hard to find an official soundscape that fits your map. So a custom soundscape can be used to create the ambiance you want.
How?
I will write a very simple and short soundscape file. Hopefully it will be enough for you guys to see how easy it is to add a special feeling to any map.
Hold up! What is a Soundscape?!
This soundscape tutorial should help answer any questions about standard soundscapes.
----
Soundscapes are textfiles, meaning they are very lightweight. So it's a great way to make your map a little more unique without increasing the .bsp size!
It's amazing, so let's get started.
The first thing you need to do is create your soundscape file with a proper name and in the correct location.
A map named "ctf_examplemap_a3" must have its soundscape file named "soundscapes_ctf_examplemap_a3.txt".
cp_testmap_b1 -> soundscapes_cp_testmap_b1.txt
plr_tutorial_rc -> soundscapes_plr_tutorial_rc.txt
<yourmapname> -> soundscapes_<yourmapname>.txt
And the .txt goes in the tf/scripts folder. If you can't find it, go ahead and create it.
Nice! Now that all preparations are complete we can start working. Excuse the swedish interface, I hope it won't distract too much!
For this map I decided I wanted 2 custom soundscapes, one for outside and one for inside ambiance. It's of course possible to create more if needed.
dsp = Digital Signal Processor. Basically it adds echoes and reverb to playing sounds. Textures already do this automatically depending on their materialtype, and it's not really that important in tf2. I've never used anything but "1" (default behaviour) for my soundscapes. [List of dsp effects (thanks SgtBarlow)]
Let's actually add some sound... finally.
To find what sounds you can use, open the sound browser inside Hammer, it also tells you the file path.
... Let's explain what just happened.
Firstly, I added a "playlooping" rule/function. As expected from the name it will loop any sound endlessly.
Inside the brackets useful keyvalues are found/written.
"volume" is a float value between 0 (silent) and 1 (max volume).
"pitch" is a percentage value. A value of 100 means it will play the sound without any pitch modifications.
"wave" is the file path to the sound played.
This soundscape (example.outside) now plays are very generic outdoors sound. It's not very interesting to listen to. To spice it up a little we can mix in some more looping tracks. (just copy-paste the previous "playlooping" and switch the "wave" path.)
This should be exciting enough for background noise. But I want more birds. But a "playlooping" of a birdsong is very very VERY annoying to listen to, luckily there's another function called "playrandom".
"playrandom" is used for anything that isn't a looping sound.
Here we find some new keyvalues:
"time" is a value in seconds. The time between playing each sound.
"rndwave" is an array of "wave"s. Everytime the "playrandom" fires, it will pick a random sound to play from the ones listed.
You may notice theres 2 values in some of the keyvalues. These are optional intervals increasing the randomness of the sounds. Values are separated with a comma (,).
Between every 10 to 30 seconds it will play a sound. The sound will be between volume .5 to 1 but it will always have normal pitch (of course you can have random pitch too).
Perfect.
Now there is only 1 thing left, sound positions!
Thankfully they are incredibly easy to create. It's just a normal "playrandom" (or "playlooping") like the one we just created but with an extra keyvalue; "position".
"position" can be anything between 0 to 7. You can only have 8 soundpositions for each soundscape.
In my case I can have a maximum of 8 for "example.outside", and 8 for "example.inside". But I think 1 is enough this time.
"attenuation" is a float value between 0 and 1. It determines how fast the sound will fade when moving away from the soundposition.
That is basically all there is to it, now I can use the exact same method to make the "example.inside" soundscape. There are no limit to how many "playlooping" or "playrandom" you can have in a soundscape. Don't get too crazy with the random demoman burp soundpositions though
To put the soundscape in the map, just do it as you would with any valve soundscape, just put the name of your custom soundscape in the env_soundscape (for this tutorial it would be example.outside or example.inside).
When fine-tuning the soundscape it's a good idea to have tf2 running and just use console command "soundscape_flush" to reload the soundscape and hear any changes you made.
When packing a soundscape into your bsp remember that the filename must be the same as the map, ALWAYS! Very often I forget to change the version number on the soundscape when updating my maps... very frustrating.
It should be packed in the /scripts folder inside the bsp.
----
I hope this tutorial helps! If I missed something be sure to point it out, ask questions if you don't understand. Good luck!
Last edited: