[template MGAICapitalTerritoryTemplate]
{
	;; Additional importance the AI gives its capital
	int	additional_importance = 0.75

	;; Additional importance the AI gives territories next to its capital
	int	additional_neighbor_proximity_importance_depth = 1
	int	additional_neighbor_proximity_importance_max = 1

	;; The required "attack victory chance" required for this AI player to attack this territory
	fixed	required_attack_strength_ratio = 0.50

	;; How much stronger the defender thinks his territory should be to feel "safe" from attackers
	fixed	desired_defense_threat_ratio	= 0.99    ;.8
}

[template MGAITerritoryTemplate]
{
	;; To specify which territory we are talking about
	string	ids

	;; Additional importance the AI gives this territory
	int	additional_importance	= 0.20

	;; Additional importance the AI gives territories
	int	additional_neighbor_proximity_importance_depth	= 1
	int	additional_neighbor_proximity_importance_max	= 1

	;; The required "attack victory chance" required for this AI player to attack this territory
	fixed	required_attack_strength_ratio	= 0.50

	;; How much stronger the defender thinks his territory should be to feel "safe" from attackers
	fixed	desired_defense_threat_ratio	= 0.99    ;.8
}


[Template MGAITemplate]
{
	string		ids
	localized	name 	= "#mg_ai_MGAITemplate_name"

	;; Additional importance the AI gives to all enemy territories
	int	additional_attack_occupied_importance = 0.20			;; slight preference to attack battles we can win with enemy army
	int	additional_attack_unoccupied_importance	= 0.10		;; slight preference to expand instead of defend

	;; Additional importance the AI gives to all friendly territories
	int	additional_defense_importance 	= 0.50

	;; How much importance to give to the production of the territory (production * multipler) = additional_importance
	int	production_importance_multiplier	= 0.99

	;; If the actor has to go this many moves or more to be able to attack, then he will just go defend someplace instead
	int	no_attack_distance		= 2

	;; The number of territories away an actor excerts influence to
	int	max_influence_depth		= 2

	;; Influences an actor's likelihood of being applied to a goal each additional territory away (used for defense calculations)
	fixed	actor_distance_influence_multiplier = .90

	;; Influences an actor's likelihood of being applied to a goal each additional territory away (used for attack calculations)
	fixed	actor_distance_strength_multiplier = .65
 
	;; How much to factor in how hard it is to defend the territory once taken into the AIs attack decision
	;; The closer this number to 1, the more the AI player looks at how hard it is to defend assuming it wins
	;; The closer this number to 0, the more the AI player just looks at how valuable this territory would be to take
	fixed	attack_defendability_factor	= .95

	;; How much extra importance to give to territories that are on the border of this player
	int	additional_border_importance	= 0.99

	;; How much extra importance to give to taking territories that would reduce the number of borders of this player
	int	additional_border_reduction_importance	= 0.75

	;; We do not look at goals less than this percent lower than the highest priority
	fixed	goal_cutoff_ratio = 0.75

	;; The MGAI either ONLY purchases tech or ONLY purchases armies or ONLY upgrades each turn now.   
	;; This is ok because in general a player can at most purchase one thing or upgrade just one or 
	;; two things in a single turn.   This does not guarantee that the player will in fact upgrade 
	;; or purchase something, just that he will only TRY to upgrade or purchase something.   In many 
	;; cases, he might actually decide to save money for a more expensive purchase.
	fixed	purchase_army_probability = .85
	fixed	purchase_tech_probability = .15

	[Map]
	{
		string		ids = worldmap
		
		;; NOTE:
		;; The capital specifiers here override the territory specifiers below
		;; So you should NOT specify the capital territories below!  Everything that
		;; is valid for a Capital is also valid for a Territory and vice versa.
		[Capital Template=MGAICapitalTerritoryTemplate]
		{
			;; Additional importance the AI gives its capital
			additional_importance	= 3

			;; Additional importance the AI gives territories next to its capital
			additional_neighbor_proximity_importance_depth	= 1
			additional_neighbor_proximity_importance_max	= 1

			;; The required "attack victory chance" required for this AI player to attack this territory
			required_attack_strength_ratio	= 0.50 	;; If we lose this, attack till you take it back!

			;; How much stronger the defender thinks his territory should be to feel "safe" from attackers
			desired_defense_threat_ratio	= 0.99	;; Use more than normal armies to protect it
		}

		[FriendlyCapital Template=MGAICapitalTerritoryTemplate]
		{
			;; Additional importance the AI gives any friendly capital
			additional_importance	= 1

			;; Additional importance the AI gives territories next to that friendly capital
			additional_neighbor_proximity_importance_depth	= 1
			additional_neighbor_proximity_importance_max	= 1

			;; The required "attack victory chance" required for this AI player to attack this territory
			required_attack_strength_ratio	= 0.50	;; Let your allies worry about it

			;; How much stronger the defender thinks his territory should be to feel "safe" from attackers
			desired_defense_threat_ratio	= 0.99  ;; Use more than normal armies to protect it
		}

		[EnemyCapital Template=MGAICapitalTerritoryTemplate]
		{
			;; Additional importance the AI gives any enemy capital
			additional_importance	= 3

			;; Additional importance the AI gives territories next to that enemy capital
			additional_neighbor_proximity_importance_depth	= 1
			additional_neighbor_proximity_importance_max	= 1

			;; The required "attack victory chance" required for this AI player to attack this territory
			required_attack_strength_ratio	= 0.50   	;; Might as well try whenever possible

			;; How much stronger the defender thinks his territory should be to feel "safe" from attackers
			desired_defense_threat_ratio	= 0.99  ;; Use lots of armies to protect it
		}

		;; Special territory default template so that we dont have to specify them all
		[DefaultTerritory Template=MGAITerritoryTemplate]
		{
			ids			= default
		}		
	}
}

[MGAI Inherit=MGAITemplate]
{
	ids 	= usa_worldmap_mgai
	name 	= "#mg_ai_usa_worldmap_mgai_name"
}

[MGAI Inherit=MGAITemplate]
{
	ids 	= gbr_worldmap_mgai
	name 	= "#mg_ai_gbr_worldmap_mgai_name"
}

[MGAI Inherit=MGAITemplate]
{
	ids 	= rus_worldmap_mgai
	name 	= "#mg_ai_rus_worldmap_mgai_name"
}

[MGAI Inherit=MGAITemplate]
{
	ids 	= ger_worldmap_mgai
	name 	= "#mg_ai_ger_worldmap_mgai_name"
	
}

[MGAI Inherit=MGAITemplate]
{
	ids 	= itl_worldmap_mgai
	name 	= "#mg_ai_itl_worldmap_mgai_name"
	
}

[MGAI Inherit=MGAITemplate]
{
	ids 	= jpn_worldmap_mgai
	name 	= "#mg_ai_jpn_worldmap_mgai_name"
}


