ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

ApproachTargetResetMultiplier

From ModEnc
Jump to navigation Jump to search
Tiberian Dawn The Covert Operations Red Alert Counterstrike Aftermath Tiberian Sun Firestorm HyperPatch Red Alert 2 Yuri's Revenge Ares Generals Zero Hour Tiberium Wars Kane's Wrath
Flag: ApproachTargetResetMultiplier
File(s): rules(md).ini
Values: Signed integers: All whole numbers from -2147483648 to 2147483647; in rare cases, only from -32768 to 32767.
Default: 1
Applicable to: General


Multiplier that decides how far a moving target must drift from the unit's current route before the unit gives up its destination and recalculates - effectively how "sticky" a chasing unit is.

Notes

Reverse-Engineered Content
The following page/section possibly contradicts several ideas accepted by the community. However, it contains information reverse-engineered from the game's executable code, not observations or theories, and as such should be considered more likely to be correct.

It works as a threshold: while chasing, the game measures the distance from the unit's current Destination to the Target, and if distance > (range − 128 when range >= 512, or the range itself otherwise) × ApproachTargetResetMultiplier the unit drops its destination and recalculates.

It only works together with CanRecalcApproachTarget: this multiplier sets how far away a recalculation is allowed, and that flag decides whether the unit may recalculate at all. Neither takes effect if the unit is not in the approach/pursuit flow.

Increasing the value makes chasing smoother: with a larger multiplier the unit recalculates less often, so the "stop-and-recalc" stutter when chasing a moving target is reduced; lowering it makes the unit recalculate more eagerly and stutter more.

Large values make the unit keep chasing an old point: the bigger the multiplier, the longer the unit keeps its current destination after the target relocates, so turning to a drastically different direction becomes sluggish.

It only affects chasing a moving target, not firing or stationary combat: once the target is within range the unit fires directly regardless of this value.

Bugs/Side-Effects/Unexpected Limitations

It is an integer in vanilla, so fine-tuning between ranges is not possible.

Trivia

Westwood set [General]ApproachTargetResetMultiplier=1.5 in vanilla Red Alert 2, but since this flag only supports integers, it was rounded down to 1. This is why in the original game, a pursuing unit recalculates its path once the target runs roughly a weapon range away, rather than recalculating only after the target runs 1.5 times the range away.

See Also