A soundscape is not totally something in which you can place and edit inside your map. It is true that default soundscapes already exist, however making your own can create better ambience and be better suited for the environment in which you want to create.
For example there is already a soundscape that sounds like a windy tunnel by the sea, however it might not be suited for your map as you might just want a slightly windy tunnel with less volume.
Soundscapes can be entity-point based or entity-brush based by the entities of trigger_soundscape and env_soundscape, however a trigger_soundscape needs to work with a point entity of env_soundscape_triggerable.
For the beginning we need to first play around with soundscapes to figure out how they work. In the Hammer editor either create a new map or edit another map in which you want to insert a sound-scape in.
Using the entity tool create a env_soundscape.
In the property that says soundscape we need to type in the soundscape we want. As it describes it refers to a text file called 'soundscapes.txt
' located in the scripts folder (In deathmatch it would be Steam/steamapps/*account*/half-life 2 Deathmatch/hl2dm/scripts).
However we are going to browse through the Half-Life 2 soundscapes used by the game. You can find the appropriate name for a soundscape using GCFscape
, which is a java program which can browse through the steam packs to obtain and see directories and files. Using GCFscape open the GCF called 'source engine'
located in your Steam/steamapps folder.
By browsing through the GCF in the directory hl2/scripts you will find a number of files. all the files with soundscapes_* are the files in which we are looking for. Soundscapes_manifest.txt is just a file which conjoins all the soundscapes into one file.
' I found a random soundscape in which I want to use called 'test_tvset
Lets break down the code here:
DSP refers to the amount of sound echo, or sound effect that is gained from a space. The only way DSP can actually be changed is through a soundscape. E.g. a metal room would create more echo than a room covered in carpet, however a soundscape could make the metal room not echo at all and a carpet room do quite the opposite.
"playlooping" and "playrandom" are two different things.
' is the normal code you would place in a soundscape. These are only meant for long looping sounds or looping sounds such as machinery, water lapping etc. If this is given to a sound that is not looping it would only loop for a couple of seconds then stop.
' is used for non looping sounds but are played randomly through the map at times. This could be a chirp a bird hoot, drips of water and other sounds such as a gust of wind.
'Playrandom' cannot be placed in a 'playlooping' and vice-versa - it will not work.
In the 'playrandom' code the "time" value has 2 numbers, this is so it can randomly choose between the values, i.e it will either delay playing one of the random wav sounds every 0.1 seconds or 0.3 seconds, with the pitches accordingly.
"rndwave" is the list of sound files that are to be randomly played in the soundscape.
In the 'playlooping' code it has variables the same as any ambient_generic or a sound-playing entity. Its volume is 0.15 (a digit from 0-1, 1 being the loudest) therefore it is fairly quiet, pitch is at 100 (or default sound pitch) and the sound name or 'wave' is set to "test/temp/soundscape_test/tv_music.wav".
The things we want to pay attention to is the variables 'position
' and 'attenuation
'. These are individual to the soundscape entity. Attenuation is the amount of time the soundscape can fade, or change when the player journeys beyond the radius of the soundscape or is closer in a radius of another soundscape. Usually slower attenuations sound better.
Position here is the most important value. If we go back to the env_soundscape entity we created in the hammer editor we see that it also has a 'position' value.
This is because env_soundscape's use a number of points to reference the different sound points, usually they are info_target
s. Env_soundscapes do not need an info_target to play the ambience as it can play from the env_soundscape entity itself. These are used to separate different sounds inside the same soundscape.
Create an 'info_target' using the entity tool and name it SS_0 (for soundscape 0).
Go to your env_soundscape and inside the property 'position 0' put in the name of your info_target (SS_0).
If you want the same soundscape somewhere else which is beyond the radius of the soundscape just copy and paste the env_soundscape and create another info_target, changing its name name (or position).
The reason for having multiple positions in an env_soundscape is to reference different ambience. However stupid this may sound env_soundscapes can only have 1 reference point therefore every time you want to have an outside sound/inside sound etc. you will have to create another soundscape entity.
If you want to make a soundscape that only has 1 point then it is smarter to use an ambient_generic or do not reference to an info_target at all (of course removing the "position" line in the soundscapes.txt so it plays at the soundscape: this means that if a point is not referenced in the code it will play at the env_soundscape entity).
Taking the test_tvset soundscape as an example I can add more code to make other ambient sound areas. Instead of having the code under "playrandom" to the same position I could change this 'position' to '1' therefore not making the sound in the same place as 'position 0'.
"time" "0.1, 0.3"
For this to work I need you to create a text file called 'soundscapes.txt
' inside your Steam/steamapps/*account*/half-life 2 Deathmatch/hl2dm/scripts folder. Copy and paste the code into the text file and save it.
Place another info_target inside your map, this time call it SS_1. This is because we want to place the random noises somewhere.
Inside your soundscape in the property that says 'Position 1
' put the name of your second info_target (SS_1).
When compiled and tested your map; it should play the ambient noises around the areas in which you placed the info_targets. One is annoying music the other random 'hey' noises.
Usually to make individual soundscape files for a map you need to have the file called soundscapes_*mapname*.txt
. So if your map name is called dm_box-of-fun your soundscape file would be called soundscpes_dm_box-of-fun.txt
. However if you are to publish the map you need to add the file into the .bsp file when you compile it.
Using a program named Pakrat
. You can add any custom files to your .bsp, just remember to change the directory to the right place by click the view button in the top menu then 'As Tree'. Click the 'add' button at the bottom and find your soundscape file. Click 'Yes to all' then click edit.
That's all my help for today, for figuring out a env_soundscape_triggerable try other sources :P. Good luck.