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

Difference between revisions of "TargetDistanceCoefficientDefault"

From ModEnc
Jump to: navigation, search
 
(Update)
Line 1: Line 1:
{{DeeZireInclusion}}<br />
+
{{Flag
Coefficient applied to an objects threat rating when considering engaging a target which is out of range of any of its weapons. This has the effect of the object engaging in pursuit of its intended target. Although a percentage value is put in here, you get more effectiveness when you put a true coefficient in (e.g. convert 200 to 2.0).
+
|name={{PAGENAME}}
 +
|files={{Categ|rules(md).ini}}
 +
|types={{Categ|General}}
 +
|ts=yes
 +
|fs=yes
 +
|hp=yes
 +
|ra2=yes
 +
|yr=yes
 +
|ares=yes
 +
}}
 +
 
 +
{{f|TargetDistanceCoefficientDefault|link}} specifies the threat rating scan range globally in General section. TechnoTypes (units/infantries etc.) can override this global value with [[TargetDistanceCoefficient]] in their sections. Enemy target selection is affected depending upon if the enemy object is inside the scan range or outside the scan range. The effect of this threat rating is only witnessed in cases where the subject is free to choose its target and applies to cases like the AI script actions of Attack TargetType (0,n). Vanilla game rules(md).ini has this value set to -10. This value is a kind of percentage of the map size (longest length from corner to corner) which can be converted to number of cells for scan range. For the lower negative values like -10, it more or less evens out at specific number of cell range for various map sizes. For the largest negative number of -1, the range covers the entire map except few cells short of the map size.
 +
 
 +
Values and its cells ranges:
 +
-11                        about 35 cells (or closer to 1/11th map size)
 +
-10                        about 39 cells (or closer to 1/10th map size)
 +
-9                          about 43 cells (or closer to 1/9th map size)
 +
-8                          about 49 cells (or closer to 1/8th map size)
 +
-7                          about 1/7th map size
 +
-6                          about 1/6th map size
 +
-5                          few cells short of 20% map size
 +
-4                          few cells short of 25% map size
 +
-3                          few cells short of 1/3rd map size
 +
-2                          few cells short of half of map size
 +
-1                          few cells short of entire map size, decimal negatives like -0.1 or -0.9 are same as -1
 +
0 and above                no range
 +
 
 +
=== Effect on AI Script actions of Attack TargetType (0,n) in TS/RA2/YR games ===
 +
 
 +
 
 +
'''Target selection when the objects are outside the threat rating scan range:'''
 +
 
 +
When the enemy objects are outside threat rating scan range, select the object which was built first. Built first unit could mean, the target could be one of starting units, if those are not present then it could be the free units that comes with buildings like harvesters. In pre-placed units/structures, the first built is the first in their respective lists in the map files. After the first selected target is destroyed, next target will be the nearest object from its current location. Any value in [[SpecialThreatValue]] does not affect the target selection.
 +
 
 +
On 0,1 (Attack anything) - Attack the first unit/aircraft/infantry/building produced by the enemy in that order. Meaning if no unit exists then the first aircraft produced by that enemy and so on. After that attack target is destroyed, attack the next nearest object from its current location.
 +
 
 +
On 0,2 (Attack buildings) - Attack the first building produced by the enemy. After that attack target is destroyed, attack the next nearest building from its current location.
 +
 
 +
On 0,5 (Attack vehicles) - Attack the first unit produced by the enemy. After that attack target is destroyed, attack the next nearest unit from its current location.
 +
 
 +
Similar is the case for other Attack TargetType (0,n) script actions.
 +
 
 +
'''Target selection when any enemy object(s) is/are within the threat rating scan range:'''
 +
 
 +
When the enemy objects are available within the threat rating scan range, select the nearest. If more than 1 object are equidistant, then give preference to the object with [[SpecialThreatValue]]=1. In equidistant case, if both the objects have same value in [[SpecialThreatValue]] then select the one which was built first by the enemy. After that attack target is destroyed, attack the next nearest unit from its current location.
 +
 
 +
The above cases are for the first target selection only when the AI team executes the script action of Attack TargetType (0,n). These 0,n script action are repetitive in nature, meaning that after the first selected target is destroyed, the units will go on to attack the next nearest object of its TargetType.  
 +
 
 +
 
 +
When there are objects both inside and outside the threat rating scan range, the case of within scan range applies.
 +
 
 +
Irrespective of what values other threat rating coefficient flags hold like [[MyEffectivenessCoefficientDefault]], there is no effect seen when making target selection due to the strength, threat posed, weapon range/damage etc. of these enemy objects.
 +
 
 +
[[Category:INI Flags]]

Revision as of 07:42, 29 October 2018

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: TargetDistanceCoefficientDefault
File(s): rules(md).ini
Values: ERROR – No value types set! Please edit this page and fix the Flag template!
Applicable to: General


TargetDistanceCoefficientDefault specifies the threat rating scan range globally in General section. TechnoTypes (units/infantries etc.) can override this global value with TargetDistanceCoefficient in their sections. Enemy target selection is affected depending upon if the enemy object is inside the scan range or outside the scan range. The effect of this threat rating is only witnessed in cases where the subject is free to choose its target and applies to cases like the AI script actions of Attack TargetType (0,n). Vanilla game rules(md).ini has this value set to -10. This value is a kind of percentage of the map size (longest length from corner to corner) which can be converted to number of cells for scan range. For the lower negative values like -10, it more or less evens out at specific number of cell range for various map sizes. For the largest negative number of -1, the range covers the entire map except few cells short of the map size.

Values and its cells ranges:

-11                         about 35 cells (or closer to 1/11th map size)
-10                         about 39 cells (or closer to 1/10th map size)
-9                          about 43 cells (or closer to 1/9th map size)
-8                          about 49 cells (or closer to 1/8th map size)
-7                          about 1/7th map size
-6                          about 1/6th map size 
-5                          few cells short of 20% map size
-4                          few cells short of 25% map size 
-3                          few cells short of 1/3rd map size
-2                          few cells short of half of map size
-1                          few cells short of entire map size, decimal negatives like -0.1 or -0.9 are same as -1
0 and above                 no range

Effect on AI Script actions of Attack TargetType (0,n) in TS/RA2/YR games

Target selection when the objects are outside the threat rating scan range:

When the enemy objects are outside threat rating scan range, select the object which was built first. Built first unit could mean, the target could be one of starting units, if those are not present then it could be the free units that comes with buildings like harvesters. In pre-placed units/structures, the first built is the first in their respective lists in the map files. After the first selected target is destroyed, next target will be the nearest object from its current location. Any value in SpecialThreatValue does not affect the target selection.

On 0,1 (Attack anything) - Attack the first unit/aircraft/infantry/building produced by the enemy in that order. Meaning if no unit exists then the first aircraft produced by that enemy and so on. After that attack target is destroyed, attack the next nearest object from its current location.

On 0,2 (Attack buildings) - Attack the first building produced by the enemy. After that attack target is destroyed, attack the next nearest building from its current location.

On 0,5 (Attack vehicles) - Attack the first unit produced by the enemy. After that attack target is destroyed, attack the next nearest unit from its current location.

Similar is the case for other Attack TargetType (0,n) script actions.

Target selection when any enemy object(s) is/are within the threat rating scan range:

When the enemy objects are available within the threat rating scan range, select the nearest. If more than 1 object are equidistant, then give preference to the object with SpecialThreatValue=1. In equidistant case, if both the objects have same value in SpecialThreatValue then select the one which was built first by the enemy. After that attack target is destroyed, attack the next nearest unit from its current location.

The above cases are for the first target selection only when the AI team executes the script action of Attack TargetType (0,n). These 0,n script action are repetitive in nature, meaning that after the first selected target is destroyed, the units will go on to attack the next nearest object of its TargetType.


When there are objects both inside and outside the threat rating scan range, the case of within scan range applies.

Irrespective of what values other threat rating coefficient flags hold like MyEffectivenessCoefficientDefault, there is no effect seen when making target selection due to the strength, threat posed, weapon range/damage etc. of these enemy objects.