Modding AIs
From VickyWiki
Default values used as examples
[edit] General factors
max_front_ratio = 4 # 4-1 odds
This is the Maximum odds that a Front is considered to need against an enemy, which affects the number troops it receives
max_garrison_prop = 0.2 # 20% min_garrison_prop = 0.1 # 10%
These two govern the proportion of troops that is given to Garrison duty in war time
war = 50
The "war monger" value affects the propensity of a country for declaring wars
neutrality = 0 # Total neutrality at about 100 to 150
The tendency of a nation to create and accept alliances, and accept military access. The higher the value, the more "neutral" the nation. NOTE: this does not affect the tendency of a nation to start wars.
ferocity = no
If 'yes', makes a country want all or nothing in peace negotiations
combat = { }
Country tags listed here are considered our ancestral enemies and the scum of the Earth
protect = { }
Country tags listed here are considered withing our 'sphere of influence'. We will strive to guarantee their independence.
befriend = { }
Country tags listed here are considered our natural allies. We will try to befriend and ally with them.
[edit] Naval AI factors
admiral = {
target = { }
}
invasion = {
base = 1.000
random = 1.000
coastal = 1.000
beach = 1.000
distance = 1.000
pocket = 1.000
island = 1.000
enemy = 1.000
adjacentenemy = 1.000
target = { }
}
[edit] Front AI factors
front = {
To start off this section
recklessness = 1
Value from 1 to 3 detemining the recklessness of the Front AI.
enemy_reinf_days = 6
Count enemy units less than X days from a target province in odds calculations
reserve_prop = 0.2 # 20%
Proportion of troops in the front held as reserves.
panic_ratio_vs_ai = 1.5
Front requests more troops if outnumbered by this factor by AI nations
panic_ratio_vs_human = 1
Front requests more troops if outnumbered by this factor by human nations
base_attack_odds = 2.5
Will attack at these odds or better
min_attack_odds = 1.000
If stalemated for a long period, may go as low as these attack odds
max_attack_odds = 3.000
Don't use more force than necessary to reach these odds
reinforce_odds = 1.000
Send more troops into embattled provinces if the attacking force is at these odds or more
withdraw_odds = 0.500
Break off attacks and withdraw at these odds
distrib_vs_ai = defensive
distrib_vs_human = defensive
Distribute front forces using the 'defensive', 'even' or 'reactive' schemes:
- 'Reactive' attempts to match enemy strengths
- 'Even' ignores the enemy and tries to maintain an even distribution of troops along the front.
- 'Defensive' distributes forces according to the industrial/national value of the provinces.
enemy_handicap = {
ENG = 100
FRA = 120
}
Countries we do not counter-attack for a certain number of days. NOTE: These values are ignored for human-controlled enemies. CAUTION: Values apply for _every_new_ war with a set nation.
state_multiplier = {
122 = 20 # +20 prio for all provinces in the state that contains province 122
}
Extra front priority for certain states. Only used by the 'defensive' distribution scheme. NOTE: These values are added to the normal priorities. For comparison, each POP is worth 1, each factory 4, the capital 20.
}
Remember to close the section as well
- GARRISON AI FACTORS
- The Garrison AI assigns a priority to each province within the domain. It then adds the priorites of
- all provinces and attempts to distribute a number of divisions to each province that corresponds to
- PROV_PRIO / TOTAL_PRIO.
- The Garrison AI is also responsible for balancing troops between overseas areas.
garrison = {
- Province Priorities:
- The priority of our capital city
capital = 100
- The priority of provinces along borders with human players (ignored if they are allies)
human_border = 200
- The priority of provinces along borders with the country we intend to attack soon
war_target = 100
- The priority of provinces along borders with countries that are pissed because we hold some of their
- national provinces.
claim_threat = 100
- Multiplier on the revolt risk in provinces. The prio of these provinces is X * revolt risk.
militancy_multiplier = 5.000
- Overrides all other border priorites and set priorities against specific countries.
- EXAMPLE:
country_priorities = {
ENG = 30
FRA = 0
}
- Override all other priorites and set for specific provinces
- EXAMPLE:
province_priorities = {
1345 = 100 # Province 1345 gets prio 100
}
- Overseas Troop Allocation Factors:
- In overseas warzones, we want these odds against enemy forces
war_zone_odds = 2.0
- If we have overseas areas, multiply our home need by this.
home_multiplier = 0.5
- Peace time multiplier for overseas areas.
overseas_multiplier = 0.33
- If an area contains a specific province, multiply the basic need by value (overrides overseas_multiplier, but if it is the home area it is ignored.)
- EXAMPLE:
area_multiplier = {
1345 = 0.5 # overseas_multiplier in the region containing province 1345 set to 0.5
}
- No more divisions than this should remain in our home area in peace time
home_peace_cap = 10000
}
- ARMAMENTS AI FACTORS
military = {
- May specify a certain number of divisions. -1 is dynamic scheme.
desired_mil_size = -1
- Percentage of infantry divisions that should be built to the mob pool.
mob_inf_perc = 75.000
- Force percentages that the AI should strive to uphold in the military:
- NOTE: For ship types that obsolete each other, the values are added together.
- LAND:
infantry = 40 cavalry = 20 dragoon = 5 irregular = 0
- 65
- NAVY:
submarine = 0
- --------- 0 # Submarines
dreadnought = 0 battleship = 0 ironclad = 10 monitor = 0 manowar = 10
- --------- 20 # Ships-of-the-Line
heavy_cruiser = 0 cruiser = 5 commerce_raider = 0 frigate = 0
- ---------- 5 # Escort/Fast ships
steamer_transport = 0 clipper_transport = 10
- ---------- 10 # Transports
- Brigade preferences:
- (% of eligible division types that should be built with a certain brigade type)
artillery = 25 engineer = 5 barrel = 0 cuirassier = 0 hussar = 0 hq = 0 guard = 0 regular = 0
- Sum of these should be <= 100
torpedo_boat = 0 destroyer = 0 corvette = 0 minelayer = 0 minesweeper = 0
- Sum of these should be <= 100
}
- FACTORY AI FACTORS
- this is a multiplier to how important it is to build a certain factory. Ingame its divided by the number currently built.
factory = { [factory_tag] = 1.0 #multiplier. }
- Tech AI Factors
technology = {
preference = { #tech id's of techs we want.. }
#probability for selecting that tech.. army = 1.0 navy = 1.0 culture = 1.0 commerce = 1.0 industry = 1.0 }
- Reform AI
reform = {
voting_rights= { 1.0 #none 1.0 #landed 1.0 #wealth 1.0 #suffrage } press_rights= { 1.0 #state press 1.0 #censorship 1.0 #free press } political_parties= { 1.0 #none 1.0 #right-to-ban 1.0 #all allowed } trade_unions= { 1.0 #none 1.0 #non-socialist 1.0 #socialist-only 1.0 #all } public_meetings= { 1.0 #NO 1.0 #YES } maximum_workhours= { 1.0 #NO 1.0 #14 1.0 #12 1.0 #10 1.0 #8 } minimum_wages= { 1.0 #none 1.0 #trinkets 1.0 #low 1.0 #acceptable 1.0 #good } safety_regulations= { 1.0 #none 1.0 #trinkets 1.0 #low 1.0 #acceptable 1.0 #good } health_care= { 1.0 #none 1.0 #trinkets 1.0 #low 1.0 #acceptable 1.0 #good } unemployment_subsidies= { 1.0 #none 1.0 #trinkets 1.0 #low 1.0 #acceptable 1.0 #good } pension_funds= { 1.0 #none 1.0 #trinkets 1.0 #low 1.0 #acceptable 1.0 #good }
}
- Construction AI Factors
construction = {
#Some guiding factors.. fortress_pref = x #how often for forts railroad_pref = x #how often for railroads colonize_pref = x #how often for colonies. factory_pref = x # how often to build factories
countrylist = { ENG FRA ... } #list of countries to build borders against...
fortress = {
#prov_id = priority
327 = 200.0
240 = 100.0
}
}
- Railroad factors
factory = { max = x # number of simultaneous builds.. -1 = unlimited target = { #prov_id = priority 327 = 200.0 240 = 100.0 } }
- Colony factors
colony = { size = x # number of areas at the same time.
#This is what we will get pissed if someone else colonies, primary = { #order is important here, as we want to... "gold coast" } secondary = { #what to colonize when all primary taken. } }
- PEACE NEGOTIATION FACTORS
peace = { quiet_factor = 1.0 # Tendency to offer peace after long periods of inactivity in the war. ferocity = 1.0 # Reluctance to end a war no matter what. Ferocious nations will fight to the bitter end. }

