In Europa Universalis II, the AI files are the game files that set the preferences afor each AI Country (Europa Universalis II). They are found in the AI files directory. A country's AI file can be set in the game scenario or in revolt.txt. It is possible to change a country's AI file via event, though this is not done in Vanilla EUII.

Possible Settings Edit

We will be using to show the coding for each of the sections. This is the file that is used for an ai that does not have an ai file set anywhere in the game files. The file starts with comments:

# Europa Universalis.
# Default AI preferences used by all countries unless otherwise stated.
# Johan Andersson 21-12-98
# Modified by Henrik Fĺhraeus 30-09-01

Colonization Edit

# Under continent and region headings you specify where this country is supposed to colonize. If none, it doesn't colonize at all.
continent = { }
region = { }
area = { }

Any continent, region, or area can be specified by name inside the brackets. If the name contains a space, it must be in quotes (e.g. "North America"). If all three of these are left blank, an AI will try to explore and colonise the Americas first, and then look elsewhere.

# The amount of provinces we try to colonize at the same time
expansion = 0

This figure has two effects. Firstly, it affects whether an AI will explore or colonise. Set at 0, the AI will almost never do either. At 1-2, they will do so to a limited extent. At 3 and over, they will do so a lot. It also affects how many colonies and trading posts the AI will create at any one time. Once it has this many colonies or trading posts it will not create any new ones. Once a colony reaches 1000 population, or a trading post reaches level 6, it is no longer counted towards this limit. If the limit is high compared to the areas on the AI's list, then it will start colonising areas that are not on that list.

# % of the time we prefer to establish a tradingpost if both are good.
tradingpost = 20

This setting is self-explanatory

# Bonus for areas to establish colonies adjacent to previous ones.
neighbour = 50

This setting can have a negative value - which will make the AI spread out his colonies. With a positive value, the AI will tend to spread out from their existing colonies, even if they are not the areas the modder wanted them to colonise.

# Bonus/Penalty for establish colonies adjacent to other countries.
enemies = -50

The effects of this are self-explanatory. Modders will usually want to set this value to 0, as there are very few instances where it would be useful to have an AI decide where to colonise depending on whether the colony is next to an occupied province or not.

Trade Edit

# 100 = max trader rate, lesser means slower focus on sending a trader.
traders = 100

This affects the chance that an AI will send a trader to a centre of trade. Often they will send a trader anyway, due to a lack of other things to spend their money on.

# 100 = Total monopolist, will refuse trade as much as possible.
monopoly = 25

This affects how often an AI will choose to enact a trade embargo if you send traders to a centre of trade that they control. It does not affect their likelihood to declare an embargo if you are at war with them. It can be set to a negative value in order to reduce the chances of this happening.

War and Religion Edit

# 100 = Total warmonger, 0 = absolute pacifist
war = 10

This affects the chances of an AI declaring war, and can be set to a negative value to make it much less likely. AIs with higher values may still be reluctant to declare war on an economically more powerful neighbour. When modding, remember that AIs that are very aggressive usually end up less powerful.

# If ferocity is set to on, it means a country will fight till either -100% or +100% at warscore. It happens in the Napoleonic Era. 
ferocity = no

By making an AI very reluctant to make peace, this setting will probably hurt the AI a lot. For a modder, it is most useful as a temporary measure to prevent easy peace as part of an event chain.

#if possible we WILL go counter reform
counterreform = no

This setting does not always work reliably. As a modder, it is more reliable to create this effect by using events.

#Which countries to conquer if possible. (to guide nation historically) Use tags, of course.
combat = { }

This setting may cause an AI to declare war on its historical enemies during the wrong time period.

#How important is it to gather troops close to base
base = 0.1
#How important is it to be as close to target position when gathering troops.
front = 5.0

It is not clear how these two values work.

#Evaluation factors for conquer plans 
conquer = 
	# multiply enemy province value 
	enemy = 5.0 
	# multiplying supply factor 
	supply = 0.1 
	# factor for distance to not owner provinces 
	distance = 0.5 
	# factor for owned provinces 
	owner = 2.0 
	# Multiplier for provinces not in supply. 
	notsupply = 1.0 
	# Multiplying the base constant for conquer. 
	base = 1.0 

The enemy value measures tax value, the higher the value the more likely he is to focus on capturing high value provinces.

The supply value make him more or less likely to split his forces over two provinces. if the value is high (up to 100), he is more likely to concentrate his attack on a single province.

The distance value determines how likely an AI is to fight wars a long way from "home". The higher the value, the further away they are likely to take a war.

The owner value determines whether an AI will focus on capturing enemy provinces or defending/liberating his own, though it is often not the determining factor.

Notsupply should be high for aggressive AIs, or ones that should be conquering provinces with low tax values (a major factor in the supply of a province), as it affects the chances of an AI trying to attack a province with low supply.

The base figure affects a country's general aggression. Warmongers should have this set high.

# Modifiers for garrison plans 
garrison = 
	fortress = 1.0 
	strategic = 3.0 
	size = 1.0 
	supply = 2.0 
	war = 5.0 

These settings have relatively little effect during a war. Set them higher to set an AI to put its troops in provinces with lots of that value. It is not known what the war variable measures.

Generic AI Files Edit

This section explains AI files that are not country-specific, and are used by multiple AI factions.

Peaceful Edit

This is for AIs that are largely passive. They are not expected to be aggressive, expansionist, or strong traders.

Their colonisation settings are set to not colonise. There are no specific areas, expansion is set to 0, the neighbour bonus is reduced to 10, and the neighbour bonus to -1. Trade settings are identical to the default.

War is set to 0 and ferocity to no. Close to base is increased to 2, and close to target position is reduced to 1. Owned provinces is put up to 2.5, and all other war settings are identical to the default.

Trader Edit

This AI file is used for countries that are primarily traders. They have an expansion value of 0, so will very rarely colonize. If they do, they will prioritise America, the Caribbean, and West Africa, have a 90% chance of creating trading posts, and 0 bonus/penalty for founding colonies next to existing ones, or next to other countries.

They have the maximum chance of sending traders, and minimal chance of refusing trade.

They are less keen to go to war than the default AI (having a war value of only 5), but their other war settings are identical to the default.

Anti-French Edit

This AI is used in the 1795 scenario for the anti-Napoleonic forces. The AI file contains no settings for colonisation or trade.

Countries using this have ferocity on (so they will fight until one side reaches 100 warscore) and the maximum warmonger of 100. They have a single target country: France.

They are less likely to specifically target provinces with high tax value (2.0 compared to default of 5.0), less likely to siege two provinces at once (0.5 against 0.1), more likely to fight away from their capital (4.0 vs 0.5), less likely to defend/liberate their own provinces (1.0 vs 2.0), more likely to attack low supply provinces (4.0 vs 1.0), and are generally more aggressive (7.0 vs 1.0).

External Links Edit

idontlikeforms's AI bible

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.