##############################################
#                                            #
#		AI FILE SCRIPTING                    #
#                                            #
#		Default values used as examples      #
#                                            #
##############################################

# GENERAL FACTORS

# This is the Maximum odds that a Front is considered to need against an enemy,
# which affects the number troops it receives:
max_front_ratio = 4 	# 4-1 odds

# These two govern the proportion of troops that is given to Garrison duty in war time:
max_garrison_prop = 0.2 # 20%
min_garrison_prop = 0.1 # 10%

# The "war monger" value affects the propensity of a country for declaring wars:
war = 50

# 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.
neutrality = 0 # Total neutrality at about 100 to 150

# Country tags listed with a value specifying how much we want to destroy them.
combat = {
	ENG = 60
	FRA = 70
}
# Countries listed here are considered withing our 'sphere of influence'. We will strive to guarantee their independence.
protect = {
	TUR = 100
	DAN = 100
}
# Countries listed here are considered our natural allies. We will try to befriend and ally with them.
befriend = {
	TUR = 100
	DAN = 100
}

# Provinces with an assigned priority. These are strategic goals for the AI (it will try to take them in wars and demand them in peace treaties.)
target = {
	324 = 50 # 1 - 100
}

# 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 = { }
}

# FRONT AI FACTORS

front = {
# Value from 1 to 3 detemining the recklessness of the Front AI.
	recklessness = 1
# Count enemy units less than X days from a target province in odds calculations
	enemy_reinf_days = 6
# Proportion of troops in the front held as reserves.
	reserve_prop = 0.2 # 20%
# Front requests more troops if outnumbered by this factor by AI nations
	panic_ratio_vs_ai = 1.5
# Front requests more troops if outnumbered by this factor by human nations
	panic_ratio_vs_human = 1
# Will attack at these odds or better
	base_attack_odds = 2.5
# If stalemated for a long period, may go as low as these attack odds
	min_attack_odds = 1.000
# Don't use more force than necessary to reach these odds
	max_attack_odds = 3.000
# Send more troops into embattled provinces if the attacking force is at these odds or more
	reinforce_odds = 1.000
# Break off attacks and withdraw at these odds
	withdraw_odds = 0.500
# 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.
# NOTE(!): In practice, "reactive" is the most defensive and slow of the schemes. The other two are more offensive, despite the name.
	distrib_vs_ai = defensive
	distrib_vs_human = defensive

# 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.
# EXAMPLE:
	enemy_handicap = {
		ENG = 100
		FRA = 120
	}

# 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.
# EXAMPLE:
	state_multiplier = {
		122 = 20			# +20 prio for all provinces in the state that contains province 122
	}
}

# 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_army_size 		=	-1
# May specify a certain number of divisions. -1 is dynamic scheme.
	desired_navy_size 		=	-1

	mob_inf_perc			=   75
# Percentage of infantry divisions that should be built to the mob pool.
	mob_inf_perc			=	75.000

# Army force balance (%)
#	ARMY:
	infantry = 				75
	cavalry = 				15
	dragoon = 				10
	irregular = 			0
#							100

# Naval force balance (%)
#	NAVY:
	submarine = 			0  # Submarines
	line = 					10 # Ships-of-the-Line
	fast =					30 # Fast/Escort ships
	transport = 			60 # Transports
#							100

# 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 (values above 2 are not recommended.)
}

