Edit me

Introduction

Vehicle attenuation is the system where people outside and inside of a vehicle hear each other at reduced volumes. The old implementation was to simply use the insideSoundCoef in the vehicle config. This value was used by the game engine to determine the sound level heard internally.

Arma 3 has introduced new config options for sound attenuation that replace the previous system.

Attenuation config

Attenuation effect types

Every vehicle has a config property attenuationEffectType which references an attenuation effect. Each attenuation effect has its own class in ConfigFile >> CfgSoundEffects >> AttenuationsEffects. We added new config parameters for these effects to define the attenuation used in ACRE2.

ACRE2 defines two attenuation values in CfgSoundEffects:

  1. acreAttenuation: A value ranging 0-1 which is used to determine the attenuation between people inside and outside of the vehicles.
  2. acreAttenuationTurnedOut: A value ranging 0-1 which is used to determine the attenuation between people inside (turned in) and turned out in the same vehicle (refers to isTurnedOut command).

If the value is 1, the sound will be blocked completely and if it is 0 no sound will be absorbed.

If a config for a specific attenuationEffectType does not exist, the default values acreDefaultAttenuation and acreDefaultAttenuationTurnedOut will be used. The default config can be found on GitHub.

Compartments

ACRE2 also provides a system to adjust the attenuation between compartments. A compartment is a virtual space where vehicle seats can be grouped together. A vehicle can have multiple compartments. BI already provides compartments. Each compartment is called CompartmentX where X is a number. It is up to the developer of the vehicle to use compartments.

ACRE2 adds compartment config parameters for every vehicle that look something like this:

class CfgVehicles {
    class ParentVehicle;
    class MyVehicle: ParentVehicle {
        class ACRE {
            // Attenuation between players inside (turned in) separate in compartments
            class attenuation {
                class Compartment1  {
                    Compartment1 = 0;
                    Compartment2 = 0;
                    Compartment3 = 0;
                    Compartment4 = 0;
                };
                class Compartment2  {
                    Compartment1 = 0;
                    Compartment2 = 0;
                    Compartment3 = 0;
                    Compartment4 = 0;
                };
                class Compartment3  {
                    Compartment1 = 0;
                    Compartment2 = 0;
                    Compartment3 = 0;
                    Compartment4 = 0;
                };
                class Compartment4  {
                    Compartment1 = 0;
                    Compartment2 = 0;
                    Compartment3 = 0;
                    Compartment4 = 0;
                };
            };

            // Attenuation between a turned out player and turned in player sitting in separate compartments
            class attenuationTurnedOut {
                class Compartment1  {
                    Compartment1 = 0;
                    Compartment2 = 0;
                    Compartment3 = 0;
                    Compartment4 = 0;
                };
                class Compartment2  {
                    Compartment1 = 0;
                    Compartment2 = 0;
                    Compartment3 = 0;
                    Compartment4 = 0;
                };
                class Compartment3  {
                    Compartment1 = 0;
                    Compartment2 = 0;
                    Compartment3 = 0;
                    Compartment4 = 0;
                };
                class Compartment4  {
                    Compartment1 = 0;
                    Compartment2 = 0;
                    Compartment3 = 0;
                    Compartment4 = 0;
                };
            };
        };
    };
};

In this case the attenuation class defines the attenuation between players inside (turned in) separate compartments and attenuationTurnedOut between a player which is turned out and one that is sitting inside in a separate compartment.

If two players talk with each other from separate compartments, the attenuation between the speaker and the local unit (listener) is first determined by the speaker compartment class and then by the listener compartment parameter (... >> _speakerCompartment >> _listenerCompartment).

Illustration

IFV with one compartment

Let’s illustrate all the attenuation systems. First we will keep it simple and look at a vehicle with only one compartment. The following picture represents all possible scenarios a player can talk to another one. A connection of the same color is the same scenario. For easier explanation, we will consider the vehicle an IFV or tank but the concepts are applicable to other types of vehicles too.

IFV attenuation with one compartment
Attenuation system in an IFV with one compartment.

Let’s start with the person outside the vehicle named Bob who talks to Tom (violet ). Because Tom is turned out, the attenuation is 0 (hardcoded). If Bob talks to Kim or vice versa (pink ) the attenuation value is acreAttenuation which is defined in the config ConfigFile >> CfgSoundEffects >> AttenuationsEffects >> TankAttenuation >> acreAttenuation. In our case this value is 0.6.

Because everyone is in one compartment, there is no attenuation (hardcoded) between Chad, Jim and Kim (blue ).

Tom and Hans are turned out. All players turned out have no attenuation (hardcoded) between them (green ). If Tom or Hans talk to someone inside e.g. Jim (brown ) the attenuation value is acreAttenuationTurnedOut defined in ConfigFile >> CfgSoundEffects >> AttenuationsEffects >> TankAttenuation >> acreAttenuationTurnedOut, so 0.3.

IFV with two compartments

Now let’s split the vehicle in two compartments. Hans and Chad will be in Compartment1 and Jim, Kim, Tom will be in Compartment2. The scenarios for Bob did not change, so we leave him out.

IFV attenuation with two compartments
Attenuation system in an IFV with two compartments.

Chad talks to Jim (red ). Because they are in separate compartments the attenuation value is looked up in the config ConfigFile >> CfgVehicles >> myTank >> ACRE >> attenuation >> Compartment1 >> Compartment2 (from the perspective of Jim) which is 1 meaning that Jim cannot hear Chad.

The same applies between Hans and Jim (yellow ) but the config ConfigFile >> CfgVehicles >> myTank >> ACRE >> attenuationTurnedOut >> Compartment1 >> Compartment2 is looked up which is also 1.

Debugging

You can toggle the ability to view attenuation behaviour at runtime to diagnose issues with compartment configs. It will draw the current attenuation value over all units and a hint will be shown with information about your crew (and their detected compartments) as well as the attenuation values of units outside of a vehicle. You’ll also get a short rundown of the configured compartment connection attenuation values for the current vehicle.

Attenuation debug info dialog
Attenuation debug info dialog

Usage

Use the debug console in a mission or editor preview with some units and/or vehicles placed down and execute call acre_sys_attenuate_fnc_toggleDebugInfo;.