GROUND BRANCH

GROUND BRANCH

 This topic has been pinned, so it's probably important
JohnJ  [developer] Aug 22, 2018 @ 1:05pm
AI Settings Explanation
Here is a basic explanation of the current AI settings available in AISettings.ini, straight from the AI guy.


DefaultAISettings explaination
==============================

ADSR Envelopes
--------------

You'll notice there are ADSR values in this file for the different senses (currently sight, hearing, incoming fire, damage, point of interest)
Note: there are likely to be more senses implemented later

ADSR - Attack, Decay, Sustain, Release. This is typically used in music software to shape the response to an input sound trigger. It is called an "ADSR Envelope". The "SenseClass" is the script descriptor for where the Sense class is implemented. Basically don't touch this.

In GB, Attack is basically the time it takes to go from 0..1 over time, so larger values take longer. Smaller values are quicker. This means that if you want the sight sense to immediately activate a response, you lower the value.

The code calculates attack as: OutputValue += (1.0f / Attack) * DeltaTime; (OutputValue being the overall 0..1 of the envelope), so it essentially determines the rate at which the OutputValue climbs from 0..1
So the range for Attack is any number between 0.0001 and MAXFLOAT, where MAXFLOAT is 3.40282347E+38f (basically a large floating point number)

Once the OutputValue of the ADSR Envelope reaches 1.0, then it transitions to the decay phase, which decays the OutputValue down to the sustain value at the rate specified in Decay. Decay should therefore be in the range 0..1 with 0 meaning that there is no sustain and 1 meaning that the OutputValue stays at 1.0 until whatever is triggering the sense ceases.

The sustain phase activates when the OutputValue reaches the Sustain value. It then maintains that value until the trigger state of the sense changes to false.

Once the sustain phase deactivates (i.e. the thing triggering the sense is no longer sensed) then the OutputValue decays at the rate given by RELEASE with the following code: OutputValue -= (1.0f / Release) * DeltaTime; So once again you can consider this a "time" value. With larger values giving slower decay and smaller values giving faster decay. Again this value is bounded at 0.0001 to MAXFLOAT.

The value MaximumAmplitude, is the multiplication factor that is used to scale the 0..1 of OutputValue to the final ouput. So it is simply FinalOutputValue = OutputValue * MaximumAmplitude;


Other settings
--------------

The Perception System is based on a scoring system. All incoming perceptions (sight, hearing etc) are scored and added to an "activation" overall value. All scores are affected by the ADSR envelopes for the given sense. The summed score for all senses are added to the activation value.

The activation value is also decayed over time.

TacticalSenseActivationThreshold (currently 86.0) - this is the value above which "activation" is deemed to allow the actor being sensed to be perceieved by the AI. Essentially anything below this value the AI can be considered to not perceive them. Once perceived, the actor is passed on for Threat scoring.

TacticalSenseActivationDecayRate (currently 20.0) - this is the rate at which the overall perception "activation" value is reduced over time, activation is reduced by this value multiplied by the time delta. So a bigger value will reduce perception activation faster. Smaller values will mean the activation will reduce more slowly (and thus remain within the activation threshold for longer if already within it).

TacticalSenseActivationMax (currently 200.0) - this is the maximum upper bounds for the "activation" value, so we don't have to spend too long settling back down to zero. This value should always be greater than TacticalSenseActivationThreshold. The "activation" value is capped between zero and this value.



TacticalSenseSightThreatBaseValue (currently 120.0) - this is the MaximumAmplitude of the sight sense ADSR envelope this will be removed shortly due to changing to the new .ini file setup.


Note: The following are now deprecated and will be removed.
-----------------------------------------------------------

; How quickly should an ideal hearing sense activate the perception threshold (modified by curves)
TacticalSenseHeardFootStepBaseValue=1.0

TacticalSenseHeardFootStepBaseDecayValue=60.0

; How quickly should an ideal hearing sense activate the perception threshold (modified by curves)
TacticalSenseHeardGunfireBaseValue=1.0

TacticalSenseHeardGunfireBaseDecayValue=80.0

; How quickly should a bullet whizz activate the perception threshold
TacticalSenseWhizzCrackBaseValue=1.0

; How quickly should a bullet whizz activate the perception threshold
TacticalSenseWhizzCrackBaseDecayValue=1.0

; How quickly should damage activate the perception threshold
TacticalSenseTakeDamageBaseValue=1.0

TacticalSenseTakeDamageBaseDecayValue=1.0
Last edited by JohnJ; Aug 22, 2018 @ 1:09pm