Jump to content

IsBaseDefense: Difference between revisions

From ModEnc²
en>E1 Elite
No edit summary
Rain-Islet (talk | contribs)
m [bot] Batch update {{Bugs}} templates.
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Flag
{{Flag
|name={{PAGENAME}}
|name={{PAGENAME}}
|files={{Categ|ini=Rules}}
|files={{Categ|ini=Rules}}, {{Categ|ini=ai}}, {{Categ|Maps}}
|types={{Categ|BuildingTypes}}
|types={{Categ|BuildingTypes}}, {{Categ|TeamTypes}}
|values={{Values|Boolean}}
|values={{Values|Boolean}}
|default=No
|default=No
Line 11: Line 11:
|yr=yes
|yr=yes
}}
}}
IsBaseDefense can have values of 'yes' or 'no'.
==In {{ts}}==
<tt>IsBaseDefense=yes</tt> 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, of buildings with <tt>IsBaseDefense</tt> set. 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'''
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. This setup also enables the building of at least some defenses outside of the normal threat assessment regime, but possibly influenced by [[ThreatPosed]] values on them.


IsBaseDefense=yes on a building makes it a base defense structure. AI uses buildings with this flag set, to build base defenses. Total number of base defense structure to be built in relation to the base size is determined by the values in [[GDIBaseDefenseCoefficient]] and [[NodBaseDefenseCoefficient]]. Depending on the type of weapon attached to these buildings, that is whether it is ground or anti-air weapon, AI distributes the count among these base 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.


AI also uses this flag to identify base defense structures for target selection used by AI scripts as well as superweapons.
==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.


'''In RA2'''
Defensive teams can be produced even without the AI choosing an enemy, see: [[AIHateDelays]].


It is similar to TS. But to determine the base defense counts, RA2 uses [[AlliedBaseDefenseCounts]] and [[SovietBaseDefenseCounts]].
The AI uses <tt>IsBaseDefense</tt> to identify structures for base defense target selection in {{ini|ai}} scripts, as well as for [[SuperWeapons]].  


'''In YR'''
For more on AI targeting, see: [[ScriptTypes/ScriptActions]].


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]].
=={{bugs}}==
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.


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.
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]].
 
===On TeamTypes===
 
IsBaseDefense=yes on a TeamType makes it a base defense team. These type of teams could be produced even without AI choosing an enemy. Total of such teams is subject to the limits set by [[MinimumAIDefensiveTeams]] and [[MaximumAIDefensiveTeams]] under [General] section.

Latest revision as of 17:29, 2 July 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, of buildings with IsBaseDefense set. 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. This setup also enables the building of at least some defenses outside of the normal threat assessment regime, but possibly influenced by ThreatPosed values on them.

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.

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.

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

For more on AI targeting, see: ScriptTypes/ScriptActions.

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.