Audio Systems
Overview
NeoFPS has a number of audio systems for specific cases. Some are specific or important to first person shooter games, while others are features that are missing from Unity and have had simple versions implemented in order to provide a more complete game experience out of the box.
Systems
Footsteps
In first person games, more than any other genre, footsteps are an important part of the immersive experience. NeoFPS uses a number of tools that tie footsteps to the character motion states and give designers full control over how the character's feet interact with the world.
Character Audio
NeoFPS has a customisable system that allows code and events to trigger character specific audio clips. The clips are identified using generated constants, which allows developers to expand the availabe clips with ease.
Character audio is implemented through a combination of the FpsCharacterAudioHandler MonoBehaviour and the FpsCharacterAudioData ScriptableObject.
Surface Audio
NeoFPS has a simple in-development system for identifying surfaces (LINK). The SurfaceAudioData ScriptableObject is used in a number of places throughout NeoFPS to specify audio for things such as footsteps, bullet hits and slides.
Contact Audio
The ClipSetContactAudioHandler MonoBehaviour is a simple component that can be added to physics objects in order to play audio on collisions. The audio is picked at random from a set of valid clips. You can also use a SurfaceContactAudioHandler MonoBehaviour which uses the surface system to pick the correct audio to play.
Audio Effects
NeoFPS uses a behaviour attached to the character camera that allows you to apply audio effects to its listener. The FpsCharacterAudioEffects behaviour can be assigned a number of AudioEffectsPreset assets which each represent a named preset such as "Underwater" or "Injured". You can then set the strength of each preset via the behaviour's API. An example use of this is the SetAudioEffectStrength motion graph behaviour (used to apply the underwater effect in the swimming demo).