Skip to content

TargetDistanceCoefficient

Weights a candidate target by how far beyond weapon range it lies, and not at all inside it.

Specification
Applies to
AircraftTypeBuildingTypeInfantryTypeUnitType
File
rules.ini
Section
[<ObjectType ID>]
Value
floating point
When omitted
ComputedTakes the value of TargetDistanceCoefficientDefault in [General], which is itself 0 when that key is absent too.

The coefficient multiplies the distance from the candidate to the edge of weapon range, and that figure is clamped at zero, so the term contributes nothing at all among candidates the object can already shoot. A negative value is what penalizes distance; a positive one rewards it and drives the object toward the farthest candidate it can find. It is read from the type of the object doing the choosing.

Range comes from the weapon this object would choose against that candidate, and falls back to GuardRange when no weapon resolves.

See alsotarget-selection