Implement Audio and Effects

Introduction

We need to support a handful of sound effect types in the game. Each type is it's own channel so that the player can control it from the options.

Sound Types

The types that are supported are:

  • User Interface sounds, such as hovers and clicks (UI Sounds, out of ammo sounds)
  • Item Usage (Item Use, reloads, firing charge ups, firing sounds).
  • Explosions/Ricochet (Explosion Sounds).
  • Environmental Response (doors closing, opening, vehicle movement, footsteps, grenade bounces).
  • Environmental Ambient (sounds and noises placed within the map editor such as electronic hums, bird sounds, whatever).
  • Voice Announcements (Win/Lose announcements, Objective captured announcements, et cetera)
  • Music

Lastly, all of these should be controllable by one Master channel.

Rate Limiting

Some sounds like UI do not have a sound queue - it is expected that when a player hovers over the menu or presses down on it, that we will always play a sound.

However, certain channels might be overloaded, such as the one for item usage and explosives, especially when many players and many sources of the sounds are involved.

In these cases, we need to start dropping duplicate sounds that occur at consecutive game frames, and over all limit the number of sounds playing at once to some reasonable, small number.

As well, we need to prioritise enemy sounds over friendly ones, because the player needs to be more aware of what the enemy is doing than what the teammates are doing.

Local player sounds are always played.