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

The Threat System: Difference between revisions

From ModEnc
Jump to navigation Jump to search
Crimsonum (talk | contribs)
m Reverted edits by Crimsonum (talk) to last revision by E1 Elite
DeathFish (talk | contribs)
m a wrong
 
(One intermediate revision by the same user not shown)
Line 17: Line 17:
! 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|[General]{{arr|r}}}}{{f|MyEffectivenessCoefficient|link}}
| {{Tt|[TechnoType]{{arr|r}}}}{{f|MyEffectivenessCoefficient|link}}
| {{sl|General|DumbMyEffectivenessCoefficient}}
| {{Tt|[General]{{arr|r}}}}{{f|DumbMyEffectivenessCoefficient|link}}
| {{Tt|[General]{{arr|r}}}}{{f|MyEffectivenessCoefficientDefault|link}}
|-
|-
! Target Effectiveness
! Target Effectiveness
| {{Tt|[General]{{arr|r}}}}{{f|TargetEffectivenessCoefficient|link}}
| {{Tt|[TechnoType]{{arr|r}}}}{{f|TargetEffectivenessCoefficient|link}}
| {{sl|General|DumbTargetEffectivenessCoefficient}}
| {{Tt|[General]{{arr|r}}}}{{f|DumbTargetEffectivenessCoefficient|link}}
| {{Tt|[General]{{arr|r}}}}{{f|TargetEffectivenessCoefficientDefault|link}}
|-
|-
! Special Threat Coefficient
! Special Threat Coefficient
| {{Tt|[General]{{arr|r}}}}{{f|TargetSpecialThreatCoefficient|link}}
| {{Tt|[TechnoType]{{arr|r}}}}{{f|TargetSpecialThreatCoefficient|link}}
| {{sl|General|DumbTargetSpecialThreatCoefficient}}
| {{Tt|[General]{{arr|r}}}}{{f|DumbTargetSpecialThreatCoefficient|link}}
| {{Tt|[General]{{arr|r}}}}{{f|TargetSpecialThreatCoefficientDefault|link}}
|-
|-
! Special Threat Value
! Special Threat Value
| {{Tt|[unit]{{arr|r}}}}{{f|SpecialThreatValue|link}}
| {{Tt|[TechnoType]{{arr|r}}}}{{f|SpecialThreatValue|link}}
| {{Tt|[unit]{{arr|r}}}}{{f|SpecialThreatValue|link}}
| {{Tt|[TechnoType]{{arr|r}}}}{{f|SpecialThreatValue|link}}
|
|-
|-
! Target Strength
! Target Strength
| {{Tt|[General]{{arr|r}}}}{{f|TargetStrengthCoefficient|link}}
| {{Tt|[TechnoType]{{arr|r}}}}{{f|TargetStrengthCoefficient|link}}
| {{sl|General|DumbTargetStrengthCoefficient}}
| {{Tt|[General]{{arr|r}}}}{{f|DumbTargetStrengthCoefficient|link}}
| {{Tt|[General]{{arr|r}}}}{{f|TargetStrengthCoefficientDefault|link}}
|-
|-
! Target Distance
! Target Distance
| {{Tt|[General]{{arr|r}}}}{{f|TargetDistanceCoefficient|link}}
| {{Tt|[TechnoType]{{arr|r}}}}{{f|TargetDistanceCoefficient|link}}
| {{sl|General|DumbTargetDistanceCoefficient}}
| {{Tt|[General]{{arr|r}}}}{{f|DumbTargetDistanceCoefficient|link}}
| {{Tt|[General]{{arr|r}}}}{{f|TargetDistanceCoefficientDefault|link}}
|}
|}


Line 77: 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".


Floating-point coefficients
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

IsThreatRatingNode

  • According to the description in this entry, this tag is actually invalid and there are doubts about it.