Game Development Reference
In-Depth Information
How it works...
In the first part of the recipe, we varied a single sound by changing its pitch slightly every
time it was played. This will still sound repetitive and it is recommended to have several
premade variants of a sound and use it in combination with this technique to get more out
of them.
At the time of writing this, filters are not developed past LowPassFilter and have a
limited use. It can still be used to cut the dryness of the sound and make it more muffled, as
if heard through a wall, for example.
Having a sound file with a sequence of footsteps, like the one in the test-data library is fine
for some types of games. They work best when you know how far a character will move
each time, such as in an RTS or turn-based game. In an FPS, however, where we don't
know how fast or far a player decides to move, it's better to have footstep sounds split up
and played individually based on movement speed.
Using an Environment class is a great way to add immersion to sounds without having
to bake the effect into the sound file. Controlling the effect unless it's level-wide can be a
bit trickier. For example, you may want more reverb outside than in a furnished room. One
way could be to use the trigger system from earlier in the chapter and big bounding
volumes triggering a change in environment as the player enters their area.
In this example, we used the setDryFilter method of the audioNode . This will not
modify any reverb coming from the environment. To do that, we have to use setRever-
bFilter .
Search WWH ::




Custom Search