Welcome to the TWC Wiki! You are not logged in. Please log in to the Wiki to vote in polls, change skin preferences, or edit pages. See HERE for details of how to LOG IN.

AI Personalities

From TWC Wiki
Jump to navigationJump to search
Rome:Total War & Remastered - Modding Index

M2TW Modding Index



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

AIPersonalityTypes.png


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

AIPersonalityNames.png

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
YOU can help us improve this Wiki! ~ Look for ways to help and editing advice. ~ If you need further advice, please post here.