Difference between revisions of "AI Personalities"
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{RTW M2TW Modding Logo}}<br> | |
+ | ==General== | ||
− | + | This article is based on research of Medieval II Total War. It has not been confirmed whether or not Rome Total War uses the exact same system. | |
+ | The data in the following tables is hardcoded and can not be modified (without the use of external programs). | ||
− | + | The faction header in descr_strat.txt contains what we will refer to as an "AI Personality". It can look like this: | |
+ | faction england, '''balanced smith''' | ||
− | *balanced | + | *The first name (balanced) controls a set of AI building preferences (no impact on repairing).<br> |
− | * | + | *The second name (smith) controls a set of AI recruitment preferences (no impact on retraining).<br> |
− | * | + | *Any first name can be combined with any second name, so fortified caesar is just as valid as bureaucrat napoleon.<br> |
− | * | + | *AI personalities do not influence aggression at all, merely the decisions on what to build and recruit.<br> |
− | * | + | *All decisions contain a random element, so biases are a statistical matter. |
− | |||
− | + | ==AI Building Preferences== | |
− | + | These biases are towards building properties, rather than buildings themselves. The game does not know what a "Blacksmith" is, for example, it only knows that it is a building which provides a weapon upgrade, and hence a craftsman AI would be more likely to build it than most other AI personality types.<br> | |
+ | The available first names are: | ||
+ | balanced | ||
+ | religious | ||
+ | trader | ||
+ | comfortable | ||
+ | bureaucrat | ||
+ | craftsman | ||
+ | sailor | ||
+ | fortified | ||
− | + | [[File:AIPersonalityTypes.png|300px]] | |
− | + | The following list of building properties have a weight of 0 in all 8 first names and have been excluded from the above table:<br> | |
+ | weapon_melee_simple<br> | ||
+ | construction_cost_bonus_military<br> | ||
+ | construction_cost_bonus_religious<br> | ||
+ | construction_cost_bonus_defensive<br> | ||
+ | construction_cost_bonus_other<br> | ||
+ | construction_time_bonus_military<br> | ||
+ | construction_time_bonus_religious<br> | ||
+ | construction_time_bonus_defensive<br> | ||
+ | construction_time_bonus_other<br> | ||
+ | construction_cost_bonus_wooden<br> | ||
+ | construction_cost_bonus_stone<br> | ||
+ | construction_time_bonus_wooden<br> | ||
+ | construction_time_bonus_stone<br> | ||
+ | free_upkeep<br> | ||
+ | pope_approval<br> | ||
+ | pope_disapproval<br> | ||
+ | archer_bonus<br> | ||
+ | cavalry_bonus<br> | ||
+ | heavy_cavalry_bonus<br> | ||
+ | gun_bonus<br> | ||
+ | navy_bonus<br> | ||
+ | recruitment_cost_bonus_naval<br> | ||
+ | retrain_cost_bonus<br> | ||
+ | weapon_projectile<br> | ||
+ | income_bonus<br> | ||
+ | recruitment_slots<br> | ||
− | |||
+ | Note: | ||
+ | *Bigger bonuses get preferred over smaller ones. This is why the AI really loves buildings with income_bonus in many mods.<br> | ||
− | * | + | *recruit_pool, agent & agent_limit are missing from both lists. It seems recruit_pool always has the highest priority, but this needs further investigation.<br> |
− | * | + | *The properties have been listed disregarding their ingame functionality. Some of them are dummy effects (e.g. trade_fleet) or do not provide any bonuses (e.g. taxable_income_bonus), but they still influence the AI's preference to construct any buildings containing them.<br> |
− | * | + | *The order of the properties in the EDB does NOT matter, despite previous claims. This has been confirmed by memory editing the preference weights. |
− | |||
− | + | ==AI Recruitment Preferences== | |
− | + | This one is a bit more complex, so read carefully.<br> | |
− | + | When the unit database (EDU) is loaded, the game combines unit category and class to know which weight to apply. It also calculates a value for the unit that is based on a unit's stats. Note that I say value, it has nothing to do with cost or upkeep (!). This value can not be seen anywhere in the game without the use of external programs. Soldier count has the biggest impact on a unit's value. That is why large units tend to get recruited more often than small ones, which can be amended by using recruit_priority_offset in Medieval II Total War: Kingdoms. | |
+ | It has to be stressed that this unit value is far more influential than the preferences set by the AI personality. For example a stalin personality will still prefer a very good light infantry unit over a bad heavy infantry one. These biases only come into full effect when units are of equal or similar value.<br> | ||
+ | The available second names are: | ||
− | + | Available in both Rome: Total War and Medieval II: Total War | |
+ | smith | ||
+ | mao | ||
+ | genghis | ||
+ | stalin | ||
+ | napoleon | ||
+ | henry | ||
+ | caesar | ||
− | |||
− | [[Category:RTW | + | Available in Medieval II: Total War only |
+ | richard | ||
+ | heinrich | ||
+ | subotai | ||
+ | knud | ||
+ | guy | ||
+ | doge | ||
+ | robert | ||
+ | wyvadslaw | ||
+ | vlad | ||
+ | roger | ||
+ | alfonso | ||
+ | arslan | ||
+ | tahar | ||
+ | saladin | ||
+ | tzar | ||
+ | |||
+ | [[File:AIPersonalityNames.png|300px]] | ||
+ | |||
+ | 4 of the recruitment personalities also contribute to the '''building''' preferences, namely: | ||
+ | *caesar: weapon_artillery_mechanical + 100 | ||
+ | *napoleon: weapon_melee_blade, weapon_missile_gunpowder + 100 | ||
+ | *stalin: armour, weapon_missile_gunpowder, weapon_artillery_gunpowder + 100 | ||
+ | *genghis: weapon_missile_mechanical + 100 | ||
+ | |||
+ | |||
+ | Note: | ||
+ | *There is a tendency towards producing troop mixtures (according to what is already in the garrison) that might obscure the bias.<br> | ||
+ | |||
+ | *No evidence has been found to suggest that AI factions respond to troop compositions of their neighbours or enemies.<br> | ||
+ | |||
+ | *Weapon attributes do not matter for categorizing, so a heavy infantry unit with the spear attribute is still considered to be heavy infantry.<br> | ||
+ | |||
+ | *skirmish infantry (the unit class skirmish, not what the unit does!) is grouped into light infantry<br> | ||
+ | |||
+ | *skirmish cavalry & spearmen cavalry are grouped into light cavalry<br> | ||
+ | |||
+ | *weights for non_combatants and handlers have been excluded from the table<br> | ||
+ | |||
+ | *ships have a value of 0 in all profiles | ||
+ | |||
+ | |||
+ | |||
+ | [[Category:RTW Text Editing & Scripting]] | ||
[[Category:M2TW Modding]] | [[Category:M2TW Modding]] |
Latest revision as of 07:10, 23 October 2023
General
This article is based on research of Medieval II Total War. It has not been confirmed whether or not Rome Total War uses the exact same system. The data in the following tables is hardcoded and can not be modified (without the use of external programs).
The faction header in descr_strat.txt contains what we will refer to as an "AI Personality". It can look like this:
faction england, balanced smith
- The first name (balanced) controls a set of AI building preferences (no impact on repairing).
- The second name (smith) controls a set of AI recruitment preferences (no impact on retraining).
- Any first name can be combined with any second name, so fortified caesar is just as valid as bureaucrat napoleon.
- AI personalities do not influence aggression at all, merely the decisions on what to build and recruit.
- All decisions contain a random element, so biases are a statistical matter.
AI Building Preferences
These biases are towards building properties, rather than buildings themselves. The game does not know what a "Blacksmith" is, for example, it only knows that it is a building which provides a weapon upgrade, and hence a craftsman AI would be more likely to build it than most other AI personality types.
The available first names are:
balanced religious trader comfortable bureaucrat craftsman sailor fortified
The following list of building properties have a weight of 0 in all 8 first names and have been excluded from the above table:
weapon_melee_simple
construction_cost_bonus_military
construction_cost_bonus_religious
construction_cost_bonus_defensive
construction_cost_bonus_other
construction_time_bonus_military
construction_time_bonus_religious
construction_time_bonus_defensive
construction_time_bonus_other
construction_cost_bonus_wooden
construction_cost_bonus_stone
construction_time_bonus_wooden
construction_time_bonus_stone
free_upkeep
pope_approval
pope_disapproval
archer_bonus
cavalry_bonus
heavy_cavalry_bonus
gun_bonus
navy_bonus
recruitment_cost_bonus_naval
retrain_cost_bonus
weapon_projectile
income_bonus
recruitment_slots
Note:
- Bigger bonuses get preferred over smaller ones. This is why the AI really loves buildings with income_bonus in many mods.
- recruit_pool, agent & agent_limit are missing from both lists. It seems recruit_pool always has the highest priority, but this needs further investigation.
- The properties have been listed disregarding their ingame functionality. Some of them are dummy effects (e.g. trade_fleet) or do not provide any bonuses (e.g. taxable_income_bonus), but they still influence the AI's preference to construct any buildings containing them.
- The order of the properties in the EDB does NOT matter, despite previous claims. This has been confirmed by memory editing the preference weights.
AI Recruitment Preferences
This one is a bit more complex, so read carefully.
When the unit database (EDU) is loaded, the game combines unit category and class to know which weight to apply. It also calculates a value for the unit that is based on a unit's stats. Note that I say value, it has nothing to do with cost or upkeep (!). This value can not be seen anywhere in the game without the use of external programs. Soldier count has the biggest impact on a unit's value. That is why large units tend to get recruited more often than small ones, which can be amended by using recruit_priority_offset in Medieval II Total War: Kingdoms.
It has to be stressed that this unit value is far more influential than the preferences set by the AI personality. For example a stalin personality will still prefer a very good light infantry unit over a bad heavy infantry one. These biases only come into full effect when units are of equal or similar value.
The available second names are:
Available in both Rome: Total War and Medieval II: Total War
smith mao genghis stalin napoleon henry caesar
Available in Medieval II: Total War only
richard heinrich subotai knud guy doge robert wyvadslaw vlad roger alfonso arslan tahar saladin tzar
4 of the recruitment personalities also contribute to the building preferences, namely:
- caesar: weapon_artillery_mechanical + 100
- napoleon: weapon_melee_blade, weapon_missile_gunpowder + 100
- stalin: armour, weapon_missile_gunpowder, weapon_artillery_gunpowder + 100
- genghis: weapon_missile_mechanical + 100
Note:
- There is a tendency towards producing troop mixtures (according to what is already in the garrison) that might obscure the bias.
- No evidence has been found to suggest that AI factions respond to troop compositions of their neighbours or enemies.
- Weapon attributes do not matter for categorizing, so a heavy infantry unit with the spear attribute is still considered to be heavy infantry.
- skirmish infantry (the unit class skirmish, not what the unit does!) is grouped into light infantry
- skirmish cavalry & spearmen cavalry are grouped into light cavalry
- weights for non_combatants and handlers have been excluded from the table
- ships have a value of 0 in all profiles