The Threat System: Difference between revisions
Creating (need |
m a wrong |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 5: | Line 5: | ||
== Related INI Flags == | == Related INI Flags == | ||
;{{ | ;{{f|IsThreatRatingNode|link}} : when a Building with this flag set is placed, its owner gains the "threat rating node" which is supposed to be the activator of the intelligent threat analysis logic. Through a bug in the game code, once a house gains this ability, it will not lose it even when the building in question is destroyed. | ||
;{{Sl|General|EnemyHouseThreatBonus}} : An additional weight applied when the owner of the targeted unit is the house's selected enemy house. | ;{{Sl|General|EnemyHouseThreatBonus}} : An additional weight applied when the owner of the targeted unit is the house's selected enemy house. | ||
The threat rating system also relies on multiple '''floating-point''' coefficients that can be applied to each unit describing its "effectiveness" and reliance on external factors such as distance from the target. These coefficients have two values, one applied under normal circumstances and one applied when the owner house has the "Threat Rating Node". | The threat rating system also relies on multiple '''floating-point''' coefficients that are defined globally which can be applied to each unit describing its "effectiveness" and reliance on external factors such as distance from the target. These coefficients have two values, one applied under normal circumstances and one applied when the owner house has the "Threat Rating Node". | ||
<!-- Yes, there are red links. If you feel like creating their pages, see the TechnoTypes->Applicable INI Flags for more details and defaults. --> | <!-- Yes, there are red links. If you feel like creating their pages, see the TechnoTypes->Applicable INI Flags for more details and defaults. --> | ||
{| class="table_descrowdesccol" width="100%" | {| class="table_descrowdesccol" width="100%" | ||
|+ ''' | |+ '''Floating-point coefficients''' | ||
! Coefficient name | ! Coefficient name | ||
! Flag name with ThreatRatingNode | ! Flag name with ThreatRatingNode | ||
! Flag name without ThreatRatingNode | ! Flag name without ThreatRatingNode | ||
! Flag name Global default value | |||
|- | |- | ||
! Self Effectiveness | ! Self Effectiveness | ||
| {{Tt|[ | | {{Tt|[TechnoType]{{arr|r}}}}{{f|MyEffectivenessCoefficient|link}} | ||
| {{ | | {{Tt|[General]{{arr|r}}}}{{f|DumbMyEffectivenessCoefficient|link}} | ||
| {{Tt|[General]{{arr|r}}}}{{f|MyEffectivenessCoefficientDefault|link}} | |||
|- | |- | ||
! Target Effectiveness | ! Target Effectiveness | ||
| {{Tt|[ | | {{Tt|[TechnoType]{{arr|r}}}}{{f|TargetEffectivenessCoefficient|link}} | ||
| {{ | | {{Tt|[General]{{arr|r}}}}{{f|DumbTargetEffectivenessCoefficient|link}} | ||
| {{Tt|[General]{{arr|r}}}}{{f|TargetEffectivenessCoefficientDefault|link}} | |||
|- | |- | ||
! Special Threat Coefficient | ! Special Threat Coefficient | ||
| {{Tt|[ | | {{Tt|[TechnoType]{{arr|r}}}}{{f|TargetSpecialThreatCoefficient|link}} | ||
| {{ | | {{Tt|[General]{{arr|r}}}}{{f|DumbTargetSpecialThreatCoefficient|link}} | ||
| {{Tt|[General]{{arr|r}}}}{{f|TargetSpecialThreatCoefficientDefault|link}} | |||
|- | |- | ||
! Special Threat Value | ! Special Threat Value | ||
| {{Tt|[ | | {{Tt|[TechnoType]{{arr|r}}}}{{f|SpecialThreatValue|link}} | ||
| {{Tt|[ | | {{Tt|[TechnoType]{{arr|r}}}}{{f|SpecialThreatValue|link}} | ||
| | |||
|- | |- | ||
! Target Strength | ! Target Strength | ||
| {{Tt|[ | | {{Tt|[TechnoType]{{arr|r}}}}{{f|TargetStrengthCoefficient|link}} | ||
| {{ | | {{Tt|[General]{{arr|r}}}}{{f|DumbTargetStrengthCoefficient|link}} | ||
| {{Tt|[General]{{arr|r}}}}{{f|TargetStrengthCoefficientDefault|link}} | |||
|- | |- | ||
! Target Distance | ! Target Distance | ||
| {{Tt|[ | | {{Tt|[TechnoType]{{arr|r}}}}{{f|TargetDistanceCoefficient|link}} | ||
| {{ | | {{Tt|[General]{{arr|r}}}}{{f|DumbTargetDistanceCoefficient|link}} | ||
| {{Tt|[General]{{arr|r}}}}{{f|TargetDistanceCoefficientDefault|link}} | |||
|} | |} | ||
By default, when a house is created, it is considered to have Threat Rating Node. So, with Threat Rating Node always available, the dumb coefficients are never used. | |||
== Threat Calculation == | == Threat Calculation == | ||
Line 74: | Line 84: | ||
[[Category: Systems]] | [[Category: Systems]] | ||
== See Also == | |||
[[IsThreatRatingNode]] | |||
*According to the description in this entry, this tag is actually invalid and there are doubts about it. |
Latest revision as of 17:54, 1 August 2024
The threat evaluation system was supposed to make the AI appear more 'intelligent' by targeting the more important threats first. In early development stages of Tiberian Sun this was planned as a Superweapon for GDI, but was scrapped, although the logic in all its incomplete glory remains in all later games up to and including Yuri's Revenge. As with various other logics, there is a lot of speculation surrounding this system.
Related INI Flags
- IsThreatRatingNode
- when a Building with this flag set is placed, its owner gains the "threat rating node" which is supposed to be the activator of the intelligent threat analysis logic. Through a bug in the game code, once a house gains this ability, it will not lose it even when the building in question is destroyed.
- [General]→EnemyHouseThreatBonus=
- An additional weight applied when the owner of the targeted unit is the house's selected enemy house.
The threat rating system also relies on multiple floating-point coefficients that are defined globally which can be applied to each unit describing its "effectiveness" and reliance on external factors such as distance from the target. These coefficients have two values, one applied under normal circumstances and one applied when the owner house has the "Threat Rating Node".
Coefficient name | Flag name with ThreatRatingNode | Flag name without ThreatRatingNode | Flag name Global default value |
---|---|---|---|
Self Effectiveness | [TechnoType]→MyEffectivenessCoefficient | [General]→DumbMyEffectivenessCoefficient | [General]→MyEffectivenessCoefficientDefault |
Target Effectiveness | [TechnoType]→TargetEffectivenessCoefficient | [General]→DumbTargetEffectivenessCoefficient | [General]→TargetEffectivenessCoefficientDefault |
Special Threat Coefficient | [TechnoType]→TargetSpecialThreatCoefficient | [General]→DumbTargetSpecialThreatCoefficient | [General]→TargetSpecialThreatCoefficientDefault |
Special Threat Value | [TechnoType]→SpecialThreatValue | [TechnoType]→SpecialThreatValue | |
Target Strength | [TechnoType]→TargetStrengthCoefficient | [General]→DumbTargetStrengthCoefficient | [General]→TargetStrengthCoefficientDefault |
Target Distance | [TechnoType]→TargetDistanceCoefficient | [General]→DumbTargetDistanceCoefficient | [General]→TargetDistanceCoefficientDefault |
By default, when a house is created, it is considered to have Threat Rating Node. So, with Threat Rating Node always available, the dumb coefficients are never used.
Threat Calculation
The basic algorithm estimating how much threat a certain object (Attacker) poses to a Defender works like this:
float Threat = Attacker's best weapon's Verses against Defender * Target Effectiveness; if(Attacker is currently targeting Defender) { // don't look at me, I didn't write the code Threat = Threat * (-1); } float tempValue = Special Threat Value * Special Threat Coefficient; Threat = Threat + tempValue; if(Defender is currently considering Attacker's owner house as the Enemy House) { Threat = Threat + [General]→EnemyHouseThreatBonus=; } tempValue = Defender's best weapon's Verses against Attacker * Self Effectiveness; Threat = Threat + tempValue; tempValue = Target Strength * Attacker's current health percentage; Threat = Threat + tempValue; tempValue = Target Distance * Distance between Defender and Attacker; Threat = Threat + tempValue; Threat = Threat + 100000.0;
Applicability
The threat rating logic is utilised when the object is selecting a target freely and when it is deciding whether or not to retaliate. However, both of those decisions are very complex and depend on a lot of other variables.
See Also
- According to the description in this entry, this tag is actually invalid and there are doubts about it.