Table des matières
Let's say you are creating a first-person shooter game where the player experiences a temporary loss of hearing when a flash-bang grenade goes off nearby. To imitate this type of effect, you will need to temporarily affect all sounds.
The best way to achieve the "temporary loss of hearing" effect is by using States. For example, you can create a State Group "GrenadeFX" that consists of two States: "Stunned" and "Normal". For the "Stunned" State, you can modify the Pitch, Volume, Low-pass Filter, and High-pass Filter values to create your "temporary loss of hearing" effect. This State Group can then be used on one or several control busses to affect your SFX, ambiances, music, and so on.
To add more realism, on the same control busses that use the "GrenadeFX" State Group, apply RTPCs to influence the intensity of the proximity effect. The properties of the State (Volume, Pitch, HPF, and LPF) and the RTPC are added so that you can reduce or increase their values based on the proximity of the grenade from the main character/microphone. To achieve this effect, you can do the following:
Create a new Game Parameter in the Game Syncs tab, such as "Grenade Proximity", and define a Min and Max distance that fits your game.
On the control busses where you are using the State Group "GrenadeFX", go to the RTPC tab and assign one or several properties to the Game Parameter "Grenade Proximity".
Map the values in such a way that the closer the grenade impact is to the character the more intense the Effect will be.
Fine-tune the State and RTPC values directly in the Soundcaster as you recreate an in-game simulation. For example, play music, ambient sounds, voice, and SFX, and then Switch the State Group from "Normal" to "Stunned". Don't forget to fine-tune the Transition Time between the different States.
Another way to add more realism is if you muffle the reverb tail effect when your character is in the Stunned State. By using RTPC on the reverb "LPF Cutoff Frequency" property and syncing it with the State changes, you will be able to match your reverb with the amount of LPF you set for the objects.