Jump to content

IsBaseDefense: Difference between revisions

From ModEnc²
m 10 revisions imported
ATHSE (talk | contribs)
cleanup aisle 8
Line 11: Line 11:
|yr=yes
|yr=yes
}}
}}
==In {{ts}}==
{{f|IsBaseDefense|yes}} on a building makes it a base defense structure, and the AI chooses from available [[BuildingTypes|buildings]] with this set when selecting a base defense to build. The total number of base defense structures to be built in relation to the base size is determined by the values in [[GDIBaseDefenseCoefficient]] and [[NodBaseDefenseCoefficient]]. See [[MaximumBaseDefenseValue]] for more information on how the AI distributes this number along the available defense structures.


==On Buildings==
==In {{ra2}}==
RA2 uses [[AlliedBaseDefenseCounts]] and [[SovietBaseDefenseCounts]] to determine the preferred base defense counts. However there is a slight exception to this, [[BuildDummy]] is a list of low-tier defensive buildings to build between other core structures, and is not included in the defense count limits. Technically any auxiliary buildings can be added to <tt>BuildDummy</tt> as filler structures, to form part of the building queue.


===In {{ts}} and {{fs}}===
Since RA2 has both a basic defense list with [[BuildDefense]], and a high-tier [[BuildPDefense]] list for excess power conditions, expected as the AI base develops, <tt>BuildDummy</tt> actually allows three tiers of defensive structures, and more of them than the counts would suggest.


{{f|IsBaseDefense|yes}} on a building makes it a base defense structure. The AI uses buildings with this flag set to build base defenses. The total number of base defense structures to be built in relation to the base size is determined by the values in [[GDIBaseDefenseCoefficient]] and [[NodBaseDefenseCoefficient]]. See [[MaximumBaseDefenseValue]] for more information on how the AI distributes this number along the available defense structures.
==In {{yr}}==
The <tt>IsBaseDefense=yes</tt> isn't used for building AI base defenses. Instead they are built according to the lists provided in [[AlliedBaseDefenses]], [[SovietBaseDefenses]] and [[ThirdBaseDefenses]]. [[AlliedBaseDefenseCounts]], [[SovietBaseDefenseCounts]] and [[ThirdBaseDefenseCounts]] determine how many of each. Proportions of these buildings is calculated based on the values of [[AntiInfantryValue]], [[AntiArmorValue]] and [[AntiAirValue]] and influenced by [[AIForcePredictionFudge]], for fine-grained control.


The AI also uses this flag to identify base defense structures for target selection used by AI scripts as well as superweapons.
The AI targeting uses both the base defense buildings defined above, and any building having <tt>IsBaseDefense=yes</tt> set to identify the structure as a target. For more on AI targeting, see: [[ScriptActions]].


===In {{ra2}}===
==In {{ini|ai}} and Maps==
<tt>IsBaseDefense|yes</tt> on a [[TeamTypes|TeamType]] assigns it as a defensive team. The total number of such teams is subject to the limits set by [[MinimumAIDefensiveTeams]] and [[MaximumAIDefensiveTeams]] under the [General] section.


Similar to TS, except RA2 uses [[AlliedBaseDefenseCounts]] and [[SovietBaseDefenseCounts]] to determine the base defense counts.
Defensive teams can be produced even without the AI choosing an enemy, see: [[AIHateDelays]].


===In {{yr}}===
==Notes==
 
The AI uses <tt>IsBaseDefense</tt> to identify structures for base defense target selection in {{ini|ai}} scripts, as well as for [[SuperWeapons]].
YR doesn't use IsBaseDefense=yes for building AI base defenses. Base defense buildings are built depending on the list provided in [[AlliedBaseDefenses]], [[SovietBaseDefenses]] and [[ThirdBaseDefenses]]. [[AlliedBaseDefenseCounts]], [[SovietBaseDefenseCounts]] and [[ThirdBaseDefenseCounts]] determine the total counts. Proportions of these buildings is calculated based on the values of [[AntiInfantryValue]], [[AntiArmorValue]] and [[AntiAirValue]] and influenced by [[AIForcePredictionFudge]].
 
YR AI uses both the specific base defense buildings as mentioned above and any building having IsBaseDefense=yes to identify base defense structure for target selection.
 
==On TeamTypes==
 
{{f|IsBaseDefense|yes}} on a [[TeamType]] makes it a base defense team. This type of team can be produced even without the AI choosing an enemy (see [[AIHateDelays]] for multiplayer maps and Make enemy trigger action for singleplayer maps). The total number of such teams is subject to the limits set by [[MinimumAIDefensiveTeams]] and [[MaximumAIDefensiveTeams]] under the [[General]] section.


{{bugs}}
{{bugs}}
Although the TS AI automatically builds buildings with {{f|IsBaseDefense|yes}} set, it cannot use such buildings as [[Prerequisite|prerequisites]] for other buildings unless the defense structure also has {{f|AIBuildThis|yes|link}} set.
Although the AI automatically builds buildings with {{f|IsBaseDefense|yes}} set in TS, it cannot use such buildings as [[Prerequisite|prerequisites]] for other buildings, unless the defense structure also has {{f|AIBuildThis|yes|link}} set.


As the AI tries to build base defense teams first, failure to be able to build [[MinimumAIDefensiveTeams]] with {{f|UseMinDefenseRule|yes|link}} will result in an AI that is unable to build any of its applicable teams listed in [[AITriggerTypes|AI Triggers]]
As the AI attempts to build base defense teams first, failure to build [[MinimumAIDefensiveTeams]] with {{f|UseMinDefenseRule|yes|link}}, may result in an inability to build any teams demanded by [[AITriggerTypes|AI Triggers]].

Revision as of 10:51, 12 April 2025

Tiberian Dawn Red Alert Tiberian Sun Firestorm Red Alert 2 Yuri's Revenge
Flag: IsBaseDefense
File(s): Rules(md).ini, ai(md).ini, Maps
Values: Boolean values: yes or no, true or false, 1 or 0
Default: No
Applicable to: BuildingTypes, TeamTypes


In Tiberian Sun

IsBaseDefense=yes on a building makes it a base defense structure, and the AI chooses from available buildings with this set when selecting a base defense to build. The total number of base defense structures to be built in relation to the base size is determined by the values in GDIBaseDefenseCoefficient and NodBaseDefenseCoefficient. See MaximumBaseDefenseValue for more information on how the AI distributes this number along the available defense structures.

In Red Alert 2

RA2 uses AlliedBaseDefenseCounts and SovietBaseDefenseCounts to determine the preferred base defense counts. However there is a slight exception to this, BuildDummy is a list of low-tier defensive buildings to build between other core structures, and is not included in the defense count limits. Technically any auxiliary buildings can be added to BuildDummy as filler structures, to form part of the building queue.

Since RA2 has both a basic defense list with BuildDefense, and a high-tier BuildPDefense list for excess power conditions, expected as the AI base develops, BuildDummy actually allows three tiers of defensive structures, and more of them than the counts would suggest.

In Yuri's Revenge

The IsBaseDefense=yes isn't used for building AI base defenses. Instead they are built according to the lists provided in AlliedBaseDefenses, SovietBaseDefenses and ThirdBaseDefenses. AlliedBaseDefenseCounts, SovietBaseDefenseCounts and ThirdBaseDefenseCounts determine how many of each. Proportions of these buildings is calculated based on the values of AntiInfantryValue, AntiArmorValue and AntiAirValue and influenced by AIForcePredictionFudge, for fine-grained control.

The AI targeting uses both the base defense buildings defined above, and any building having IsBaseDefense=yes set to identify the structure as a target. For more on AI targeting, see: ScriptActions.

In ai(md).ini and Maps

IsBaseDefense|yes on a TeamType assigns it as a defensive team. The total number of such teams is subject to the limits set by MinimumAIDefensiveTeams and MaximumAIDefensiveTeams under the [General] section.

Defensive teams can be produced even without the AI choosing an enemy, see: AIHateDelays.

Notes

The AI uses IsBaseDefense to identify structures for base defense target selection in ai(md).ini scripts, as well as for SuperWeapons.

Bugs/Side-Effects/Unexpected Limitations Although the AI automatically builds buildings with IsBaseDefense=yes set in TS, it cannot use such buildings as prerequisites for other buildings, unless the defense structure also has AIBuildThis=yes set.

As the AI attempts to build base defense teams first, failure to build MinimumAIDefensiveTeams with UseMinDefenseRule=yes, may result in an inability to build any teams demanded by AI Triggers.