Game Development Reference
In-Depth Information
function Play()
// Grab the current value for switch_name
// Then lookup the list in the hash map and
randomly play a sound
...
end
end
In order for this implementation to work, there needs to be a global way to get and
set switches. This way, the player run code can determine the surface and set the
switch prior to actually triggering the footstep cue. Then the footstep cue's Play
function can query the current value of the switch, and it will result in the correct
type of footstep sound playing.
Ultimately, the key component when implementing a sound cue system is to allow
for enough configurability to determine when and how sounds are played. Having
as many dynamic parameters as possible will give the audio designers far more
flexibility to create an immersive environment.
3D Sound
Although not an absolute requirement, 2D sound is typically positionless. This
means that for most 2D games, the sound will just play equally out of the left and
right speakers. Some 2D games might introduce some aspects of position into the
sound, such as panning or distance-based volume reductions, but it will depend on
the particular game.
For 3D sound, and 3D games by extension, position of the audio is extremely im-
portant. Most sounds are positional and have their characteristics change based on
theirrelativedistanceandorientationtothe listener ,orthevirtualmicrophonethat
picks up the audio in the 3D world.
That is not to say that 3D games don't utilize 2D sounds; they are still used for
elements such as user interface sounds, narration, ambient background effects, and
music. But any sound effects that occur in the world itself are typically represen-
ted as 3D sounds.
Search WWH ::




Custom Search