This week I started working on a new ambiance sound system to be used for playing sounds while walking through the adventure maps. The final design consists of 3 parts:
Each map the player will be exploring will also contain various zones within them that will indicate different types of walking paths. Each path will have a series of sounds used for footsteps (not loops). When the player moves in/out of each of these zones, their footstep sounds will be updated based upon their current path type (grass, dirt, stone etc).
To reduce loop exhaustion, I don’t use looping sounds, but instead a series of individual step sounds for each type that are randomly chosen upon each “step” taken. This gives a much more even flow of step sounds.
Using similar zones to footsteps/paths, the 2D ambiance sounds will also be area’s within the map in which certain “overall” sounds will be played. These zone’s are custom to each map and allow for things such as wind blowing through tree’s when in heavier forest or the general sound of frogs/birds/etc in the background.
Also similar to the footsteps, the list of available sounds in any given “zone” are played randomly with also another random “delay” until the next time it’s played. This helps space things out far better and makes for a more “natural” feel to the sounds.
The general concept is based upon sound “waves” that expand outward from various points on the map. These waves allow for multiple sounds to be played within it at various predefined or random intervals and delays. Each wave is also able to choose from a list of sounds to play upon looping instead of always looping the same sound over and over.
Below is a debug screen shot showing a sound wave attached to the chest (just made up). The blue circle represents the “start sound” point with the volume at a low setting. As the player draws closer to the red circle the volume slowly increases until it reaches the max level. As they pass out of the circles, the volume will again reduce as they draw further away from the center.