Code:
<?xml version="1.0"?>
<root>
<!--
// The trusted ally global parameters specify the minimum faction standing thresholds for a target faction to be
// considered a trusted ally. We can use target faction standing parameters directly in invasion/defend decisions
// but the trusted ally data allows us to use additional entry parameters: trusted_ally_enemy and trusted_ally_protectorate
// that we cannot measure directly for a target faction. An AI faction may also try and aid its trusted allies (hence the
// reverse checks on standings to avoid helping allies it shouldn't)
<trusted_ally_fs_threshold float="0.4"/> // min threshold for how much we like the target faction to consider them a trusted ally
<trusted_ally_target_fs_threshold float="0.4"/> // min threshold for how much the target faction likes us to consider them a trusted ally
<trusted_ally_target_human_fs_threshold float="0.0"/> // min threshold for how much the target (human) faction likes us to consider them a trusted ally
<trusted_ally_gs_threshold float="-1.0"/> // min threshold for how trustworthy we are to consider the target faction a trusted ally
<trusted_ally_target_gs_threshold float="-0.1"/> // min threshold for how trustworthy is the target faction to consider them a trusted ally
<trusted_ally_enemy_auto_war bool="false"/> // flag to indicate if a faction automatically goes to war with a trusted allies enemy
<use_cheat_overrides bool="true"/> // determines if cheat overrides (force peace with ai, force attack with humans) are applied
<invade_priority_fs_modifier float="-400.0"/> // modifies the final invade priority for new faction targets by += (faction_standing * modifier) {makes factions more likely to start war with disliked targets}
<invade_priority_gs_modifier float="0.0f"/> // modifies the final invade priority for new faction targets by += (global_standing * modifier) {makes factions more likely to start war with untrustworthy targets}
<invade_priority_assistance_offset int="200"/> // modifies the final invade priority for new faction targets where military assistance has been asked by += (offset) {makes factions more likely to start war with military assistance targets}
<invade_priority_min int="50"/> // min clamp for final invade priorities calculated
<invade_priority_max int="1000"/> // max clamp for final invade priorities calculated
// Each faction has an 'ai_label' specified in the campaign descr_strat.txt. This ai_label must correspond to a 'faction_ai_label'
// entry specified in this database (e.g. 'default', 'catholic', 'papal_states'). The 'default' ai_label should always exist
// and is used if a specified ai_label cannot be found. Note that each ai_label is independent (i.e. 'catholic' ai_label does
// not inherit any data from 'default') hence care should be taken when adding new entries to ensure that any relevant global
// entries are added to all other ai_labels. Additionally, the ai_labels can be tested through event conditions and set through
// a script command, potentially allowing ai behaviour to be changed dynamically in game depending on current game state.
<faction_ai_label name="default"> :: The label for a following set of campaign ai faction parameters
// The ai_labels specify the structure of the long term goal director (LTGD) which drives the high level campaign AI.
// At the start of every factions turn (or when diplomacy changes), the LTGD is re-evaluated as follows:
// for every target faction (all other factions), evaluate the defend decisions
// for every target faction, evaluate the invasion decisions
// any invasion priorities are modified by the faction standing (relationship) towards the target
// depending on current game state, a new target with a high invasion priority may be selected to invade
// the LTGD can be debugged with the preferences '[log] level = ai.ltgd trace' and '[ai] ltgd_logging = true.
// The 'defend_decisions' entry specifies a list of decision entries related to ai defence strategies. To evaluate a defence
// strategy, a set of parameters is built and the list of decision entries is iterated until an entry satisfies the min and max
// conditions for the set of parameters. As soon as an entry is satisfied (min <= current <= max), the iteration ends. The decision
// is taken from the default 'faction_attitude' parameters with certain parameters overridden. The 'min_entry' specifies the minimum
// thresholds specified for evaluation and the 'max_entry' specifies the maximum. Note that care should be taken when entering new
// entries since as soon as the thresholds for an entry are successfully met, the iteration ends. An exception to this is the use of
// the 'continue' faction_attitude parameter, which allows the decision iteration to continue (This is useful for changing certain
// parameters of the faction_attitude but allowing the process to continue so other entries can apply additional modifications).
<defend_decisions> :: List of ai defend decisions. when choosing a decision, code will iterate from first to last until a set of thresholds succeeds
<decision_entry> :: An individual decision entry
<min_entry :: The minimum threshold for decision comparison
frontline_balance="0.0" :: ratio of factions frontline military strength vs the target
military_balance="0.0" :: ratio of factions overall military strength vs the target
production_balance="0.0" :: ratio of factions overall production strength vs the target
target_num_enemies="0" :: the number of enemies the target has
num_enemies="0" :: the number of enemies the faction has
has_alliance_against="false" :: is the faction part of an alliance against target
military_balance_plus_enemies="0.0" :: ratio of factions overall military strength vs the target (plus all of its enemies)
alliance_military_balance="0.0" :: ratio of factions (plus its allies) overall military strength vs the target
strongest_neighbour="false" :: is the target the factions strongest neighbour
most_desirable="false" :: is the target the factions most desirable target
faction_standing="-1.0" :: how much does the faction like the target
target_global_standing="-1.0" :: how trustworthy is the target to the rest of the world
target_faction_standing="-1.0" :: how much does the target faction like this faction
global_standing="-1.0" :: how trustworthy is this faction to the rest of the world
target_religion="catholic" :: the religion of the target (see descr_religions.txt)
enemy_excommunicated="false" :: is the target excommunicated
excommunicated="false" :: is this faction excommunicated
num_turns_allied="0" :: the number of turns since the faction agreed to an alliance with the target
num_turns_ceasfire="0" :: the number of turns since the faction has agreed to a ceasefire with the target (-1 for no agreement)
stance="Allied" :: diplomatic stance with the target (Allied, Neutral, AtWar)
target_faction="england" :: target faction label (see descr_sm_factions.txt)
target_human="false" :: is the target a human player
target_is_shadow="false" :: is the target this factions shadow faction
turn_number="0" :: the game turn number (starting at 0)
is_protectorate="false" :: is the target our protectorate
is_protectorate_of_catholic="false" :: is the target a protectorate of a non-excommunicated catholic faction
free_strength_balance="0.0" :: ratio of factions free military strength vs the target
borders_all_our_regions="false" :: does the target border on all the factions region groups
target_weakest_neighbour="false" :: is the faction the targets weakest neighbour
has_ceasehostilities="false" :: does the faction have a cease hostilities mission against the target from the papal faction
is_neighbour="false" :: does the target neighbour on any of the factions regions
trusted_ally="false" :: is the target a trusted ally (they like us more than fs_thresh, and their global standing > gs_thresh, and they are allied)
trusted_ally_enemy="false" :: is the target an enemy of a trusted ally
trusted_ally_protectorate="false" :: is the target a protectorate of a trusted ally
num_settlements="0" :: how many settlements does the faction own
rand="0.0" :: a random value
difficulty="easy"/> :: the chosen difficulty for the current local player (easy, medium, hard, very_hard)
<max_entry :: The maximum threshold for decision comparison
frontline_balance="999.0"
military_balance="999.0"
production_balance="999.0"
target_num_enemies="999"
num_enemies="999"
has_alliance_against="true"
military_balance_plus_enemies="999.0"
alliance_military_balance="999.0"
strongest_neighbour="true"
most_desirable="true"
faction_standing="1.0"
target_global_standing="1.0"
target_faction_standing="1.0"
global_standing="1.0"
target_religion="heretic"
enemy_excommunicated="true"
excommunicated="true"
num_turns_allied="999"
num_turns_ceasfire="999"
stance="AtWar"
target_faction="slave"
target_human="true"
target_is_shadow="true"
is_protectorate="true"
is_protectorate_of_catholic="true"
free_strength_balance="999.0"
borders_all_our_regions="true"
target_weakest_neighbour="true"
has_ceasehostilities="true"
is_neighbour="true"
trusted_ally="true"
trusted_ally_enemy="true"
trusted_ally_protectorate="true"
num_settlements="999"
rand="1.0"
difficulty="very_hard"/>
<faction_attitude :: A list of modifiers to apply if min and max entries above are successful
defense="defend_normal" :: The long term defense type (defend_minimal, defend_normal, defend_raid, defend_frontline, defend_fortified, defend_deep)
defend_priority="0" :: The defensive priority of achieving stance against this faction (NOT USED AT PRESENT) (additive with previous decisions this turn)
invade="invade_none" :: The long term invade type (invade_buildup, invade_immediate, invade_raids, invade_opportunistic, invade_start, invade_none)
invade_priority="0" :: priority of achieving invasion against this faction (additive with previous decisions this turn). Compared with priority for decisions against all other factions to choose highest. Value modified internally by faction standing.
at_war="false" :: are we at war with this enemy
want_peace="false" :: do we want to be at peace with this faction
want_ally="false" :: do we want to ally with this faction
want_be_protect="false" :: do we want to be a protectorate of this faction
want_offer_protect="false" :: do we want to offer protectorate status to this nation
force_invade="false" :: must we invade now
alliance_against="0" :: how much do we want to have an alliance against this nation (additive with previous decisions this turn)
pts_desire="0" :: points total for measuring our desire for this faction's territory (additive with previous decisions this turn)
pts_alliance="0" :: points total for measuring how much we want to be allies with these people (additive with previous decisions this turn)
can_force_invade="true" :: can naval or forced invasion settings overwrite invade parameters
continue="false"/> :: do we stop evaluating decision entries (false) or continue
</decision_entry>
</defend_decisions>
// The 'invasion_decisions' entry specifies a list of invasion entries related to ai invasion strategies. This process
// is virtually identical to the defence decision process but is evaluated as a separate stage.
<invasion_decisions> :: List of ai invasion decisions. when choosing a decision, code will iterate from first to last until a set of thresholds succeeds (uses identical data to defend decisions)
<decision_entry> :: An individual decision entry
<min_entry/> :: The minimum threshold for decision comparison
<max_entry/> :: The maximum threshold for decision comparison
<faction_attitude/> :: A list of modifiers to apply if min and max entries above are successful
</decision_entry>
</invasion_decisions>
-->
<!--
//////////////////////
// GLOBAL AI PARAMS //
//////////////////////
-->
<trusted_ally_fs_threshold float="0.3"/>
<trusted_ally_target_fs_threshold float="0.3"/>
<trusted_ally_target_human_fs_threshold float="0.3"/>
<trusted_ally_gs_threshold float="-0.1"/>
<trusted_ally_target_gs_threshold float="-0.1"/>
<trusted_ally_enemy_auto_war bool="false"/>
<use_cheat_overrides bool="false"/>
<invade_priority_fs_modifier float="-400.0"/>
<invade_priority_gs_modifier float="-200.0f"/>
<invade_priority_assistance_offset int="200"/>
<invade_priority_min int="50"/>
<invade_priority_max int="1500"/>
<!--
///////////////////////////////////////
// DEFAULT AI PARAMS. DO NOT REMOVE //
///////////////////////////////////////
-->
<faction_ai_label name="default">
<defend_decisions>
<!--
DEFEND
-->
<decision_entry>
<!--
IF AT WAR AND EVEN > DEFEND FORTIFIED
-->
<min_entry stance="AtWar" military_balance="0.75" is_neighbour="true"/>
<max_entry stance="AtWar" military_balance="1.75" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND WEAKER > DEFEND DEEP
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" military_balance="0.75" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_deep" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND STRONGER > DEFEND FRONTLINE
-->
<min_entry stance="AtWar" military_balance="1.75" is_neighbour="true"/>
<max_entry stance="AtWar"is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_frontline" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY > DEFEND NORMAL
-->
<min_entry trusted_ally="true" stance="Allied" target_human="false" is_neighbour="true"/>
<max_entry trusted_ally="true" stance="Allied" target_human="false" is_neighbour="true"/>
<faction_attitude defense="defend_normal" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND NOT AT WAR > DEFEND FORTIFIED
-->
<min_entry target_human="true" is_neighbour="true"/>
<max_entry target_human="true" is_neighbour="true"/>
<faction_attitude defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND AT WAR > DEFEND DEEP
-->
<min_entry stance="AtWar" target_human="true" is_neighbour="true"/>
<max_entry stance="AtWar" target_human="true" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_deep" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF NOT NEIGHBOUR > DEFEND MINIMAL
-->
<min_entry is_neighbour="false"/>
<max_entry is_neighbour="false"/>
<faction_attitude defense="defend_minimal" continue="true"/>
</decision_entry>
<!--
DEFEND v SLAVES
-->
<decision_entry>
<!--
IF SLAVE AND NOT NEIGHBOUR > DEFEND MINIMAL
-->
<min_entry target_faction="slave" is_neighbour="false"/>
<max_entry target_faction="slave" is_neighbour="false"/>
<faction_attitude at_war="true" defense="defend_minimal" want_peace="false" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVE AND NEIGHBOUR AND EARLY GAME > DEFEND MINIMAL
-->
<min_entry target_faction="slave" is_neighbour="true"/>
<max_entry target_faction="slave" turn_number="30" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_minimal" want_peace="false" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVE AND NEIGHBOUR > DEFEND NORMAL
-->
<min_entry target_faction="slave" is_neighbour="true"/>
<max_entry target_faction="slave" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_frontline" want_peace="false" continue="false"/>
</decision_entry>
</defend_decisions>
<invasion_decisions>
<!--
DEFAULT
-->
<decision_entry>
<!--
DEFAULT INVADE NONE
-->
<faction_attitude invade="invade_none" continue="true"/>
</decision_entry>
<!--
DIPLOMACY
-->
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<max_entry turn_number="10"/>
<faction_attitude want_ally="false" pts_alliance="-5" continue="true"/>
</decision_entry>
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<min_entry turn_number="11"/>
<max_entry turn_number="20"/>
<faction_attitude want_ally="false" pts_alliance="-10" continue="true"/>
</decision_entry>
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<min_entry turn_number="21"/>
<faction_attitude want_ally="false" pts_alliance="-15" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry trusted_ally="true"/>
<max_entry trusted_ally="true" rand="0.9"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND TRUSTWORTHY AND ONLY ALLIED SHORT WHILE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry stance="Allied" global_standing="0.25"/>
<max_entry stance="Allied" num_turns_allied="10"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ONLY ALLIED FOR SHORT TIME, CANNOT FORCE INVADE, INVADE NONE
-->
<max_entry stance="Allied"/>
<max_entry num_turns_allied="3" stance="Allied"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AGREED TO CEASEFIRE SHORT TIME AGO AND RELATIVELY TRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry num_turns_ceasfire="0" stance="Neutral" global_standing="0.25"/>
<max_entry num_turns_ceasfire="10" stance="Neutral"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AGREED TO CEASEFIRE SHORT TIME AGO, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry num_turns_ceasfire="0" stance="Neutral"/>
<max_entry num_turns_ceasfire="3" stance="Neutral"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND VERY TRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" global_standing="0.5"/>
<max_entry stance="Allied" rand="0.8"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND LIKE THEM ALOT AND NOT UNTRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" faction_standing="0.5" global_standing="-0.1"/>
<max_entry stance="Allied" rand="0.8"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND WE DON'T MIND THEM, AND NOT TOO UNTRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" faction_standing="0.0" global_standing="-0.25"/>
<max_entry stance="Allied" rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.5"/>
<max_entry stance="Neutral" rand="0.75"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.25"/>
<max_entry stance="Neutral" rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
PARTIALLY FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.0"/>
<max_entry stance="Neutral" rand="0.25"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF PROTECTORATE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry is_protectorate="true" />
<max_entry is_protectorate="true" />
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY PROTECTORATE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry trusted_ally_protectorate="true"/>
<max_entry trusted_ally_protectorate="true"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, ALLIANCE AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES, DON'T ALLY AGAINST
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude alliance_against="-2" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true"/>
<max_entry strongest_neighbour="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MOST DESIRABLE, ALLY AGAINST
-->
<min_entry most_desirable="true"/>
<max_entry most_desirable="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE MUCH STRONGER, ALLY AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar" frontline_balance="0.3" free_strength_balance="0.3" production_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER, ALLY AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar" frontline_balance="0.5" free_strength_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER ON FRONTLINE, ALLY AGAINST
-->
<min_entry stance="AtWar" free_strength_balance="1.0"/>
<max_entry stance="AtWar" frontline_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER IN FREE STRENGTH, ALLY AGAINST
-->
<min_entry stance="AtWar" frontline_balance="1.0"/>
<max_entry stance="AtWar" free_strength_balance="0.7"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY OUTPRODUCE US, ALLY AGAINST
-->
<min_entry stance="AtWar" frontline_balance="1.0"/>
<max_entry production_balance="1.0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NOT AT WAR AND STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true" frontline_balance="2.0" target_num_enemies="2"/>
<max_entry strongest_neighbour="true" production_balance="1.0" num_enemies="0" />
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUTPRODUCE AND STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true" production_balance="1.0"/>
<max_entry strongest_neighbour="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MOST DESIRABLE, ALLY AGAINST
-->
<min_entry most_desirable="true" production_balance="1.0"/>
<max_entry most_desirable="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND VASTLY SUPERIOR, OFFER PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" frontline_balance="5.0" military_balance="1.0" production_balance="1.0"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude want_offer_protect="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND VASTLY OUTNUMBERED, WANT BE PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" />
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.3" free_strength_balance="0.3" production_balance="0.5" num_settlements="3"/>
<faction_attitude want_peace="true" want_be_protect="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.75" free_strength_balance="0.75"/>
<faction_attitude want_peace="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED AND LALST SETTLEMENT, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.8" free_strength_balance="0.8" num_settlements="3"/>
<faction_attitude want_peace="true" want_be_protect="true" continue="false"/>
</decision_entry>
<!--
DECIDE WHO TO INVADE
-->
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="1.0"/>
<max_entry is_neighbour="true" frontline_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="2.0"/>
<max_entry is_neighbour="true" frontline_balance="3.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="1.0"/>
<max_entry is_neighbour="true" military_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="2.0"/>
<max_entry is_neighbour="true" military_balance="3.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET AT WAR WITH LOTS OF FACTIONS, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_num_enemies="3"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="1.0"/>
<max_entry is_neighbour="true" production_balance="2.0"/>
<faction_attitude invade_priority="25" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="2.0"/>
<max_entry is_neighbour="true" production_balance="3.0"/>
<faction_attitude invade_priority="25" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="25" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE AGAINST, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" has_alliance_against="true"/>
<max_entry is_neighbour="true" has_alliance_against="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="1.0"/>
<max_entry is_neighbour="true" alliance_military_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="2.0"/>
<max_entry is_neighbour="true" alliance_military_balance="3.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="0.75"/>
<max_entry is_neighbour="true" faction_standing="0.5"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="0.5"/>
<max_entry is_neighbour="true" faction_standing="0.25"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="0.25"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF UNTRUSTOWRTHY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" global_standing="0.5"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" stance="AtWar"/>
<max_entry is_neighbour="true" stance="AtWar"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_human="true"/>
<max_entry is_neighbour="true" target_human="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY HARD, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" difficulty="hard"/>
<max_entry is_neighbour="true" difficulty="hard"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY VERY HARD HARD, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" difficulty="very_hard"/>
<max_entry is_neighbour="true" difficulty="very_hard"/>
<faction_attitude invade_priority="150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKEST NEIGHBOUR, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_weakest_neighbour="true"/>
<max_entry is_neighbour="true" target_weakest_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY ENEMY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" trusted_ally_enemy="true"/>
<max_entry is_neighbour="true" trusted_ally_enemy="true"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<!--
DECIDE WHO NOT TO INVADE
-->
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="1"/>
<max_entry is_neighbour="true" num_enemies="2"/>
<faction_attitude invade_priority="-100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="2"/>
<max_entry is_neighbour="true" num_enemies="3"/>
<faction_attitude invade_priority="-100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="3"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="-100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKER FRONTLINE, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" frontline_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKER MILITARY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" military_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUTPRODUCED, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" production_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF GOOD STANDINGS, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="0.35"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTWORTHY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" global_standing="0.4"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF LOW FREE STRENGTH VALUE, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" free_strength_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" trusted_ally="true"/>
<max_entry is_neighbour="true" trusted_ally="true"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<!--
EARLY GAME
-->
<decision_entry>
<!--
IF EARLY GAME, INVADE NONE
-->
<min_entry stance="Neutral"/>
<max_entry stance="Neutral" turn_number="10"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<!--
INVADES FOR NEIGHBOURS
-->
<decision_entry>
<!--
IF NEIGHBOUR AND WEAKER FRONTLINE > INVADE BUILDUP
-->
<min_entry is_neighbour="true" frontline_balance="0.1"/>
<max_entry is_neighbour="true" frontline_balance="0.9"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLYS ENEMY AND NOT AT WAR > INVADE BUILDUP
-->
<min_entry is_neighbour="true" trusted_ally_enemy="true"/>
<max_entry is_neighbour="true" trusted_ally_enemy="true"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR > INVADE BUILDUP
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND HE IS SUPERIOR > INVADE OPPORTUNISTIC
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" military_balance="0.9" free_strength_balance="0.9"/>
<faction_attitude invade="invade_opportunistic" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND SUPERIOR > INVADE IMMEDIATE
-->
<min_entry stance="AtWar" is_neighbour="true" frontline_balance="1.5"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="100.0"/>
<faction_attitude invade="invade_immediate" continue="true"/>
</decision_entry>
<!--
IF NOT NEIGHBOUR
-->
<decision_entry>
<!--
IF ENEMY OF TRUSTED ALLY > INVADE BUILDUP
-->
<min_entry is_neighbour="false" trusted_ally_enemy="true"/>
<max_entry is_neighbour="false" trusted_ally_enemy="true"/>
<faction_attitude invade="invade_buildup" continue="true" can_force_invade="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR > INVADE BUILDUP
-->
<min_entry stance="AtWar" is_neighbour="false"/>
<max_entry stance="AtWar" is_neighbour="false"/>
<faction_attitude invade="invade_buildup" continue="true" can_force_invade="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR + RESOURCES > INVADE OPPORTUNISTIC
-->
<min_entry stance="AtWar" is_neighbour="false" military_balance="1.1" free_strength_balance="1.1"/>
<max_entry stance="AtWar" is_neighbour="false"/>
<faction_attitude invade="invade_opportunistic" continue="true" can_force_invade="true"/>
</decision_entry>
<!--
SLAVE
-->
<decision_entry>
<!--
IF SLAVE > REALLY WANT TO INVADE FOR QUICK BULDUP OF EMPIRES
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade_priority="20000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES > INVADE OPPORTUNISTIC
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_opportunistic" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND SLIGHTLY SUPERIOR > INVADE OPPORTUNISTIC
-->
<min_entry target_faction="slave" frontline_balance="1.0"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_buildup" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND SUPERIOR > INVADE IMMEDIATE
-->
<min_entry target_faction="slave" frontline_balance="2.0"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_immediate" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND EARLY GAME > INVADE IMMEDIATE
-->
<min_entry target_faction="slave" frontline_balance="1.25"/>
<max_entry target_faction="slave" turn_number="30"/>
<faction_attitude at_war="true" invade="invade_immediate" invade_priority="2000" continue="true"/>
</decision_entry>
</invasion_decisions>
</faction_ai_label>
<!--
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PAPAL FACTION AI PARAMS. REQUIRES SPECIAL STUFF TO NOT ALLOW ATTACKING NON-EXCOMMUNICATED CATHOLIC FACTIONS //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<faction_ai_label name="papal_faction">
<defend_decisions>
<!--
DEFEND
-->
<decision_entry>
<!--
IF AT WAR AND EVEN > DEFEND FORTIFIED
-->
<min_entry stance="AtWar" military_balance="0.75" is_neighbour="true"/>
<max_entry stance="AtWar" military_balance="1.75" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND WEAKER > DEFEND DEEP
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" military_balance="0.75" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_deep" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND STRONGER > DEFEND FRONTLINE
-->
<min_entry stance="AtWar" military_balance="1.75" is_neighbour="true"/>
<max_entry stance="AtWar"is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_frontline" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY > DEFEND NORMAL
-->
<min_entry trusted_ally="true" stance="Allied" target_human="false" is_neighbour="true"/>
<max_entry trusted_ally="true" stance="Allied" target_human="false" is_neighbour="true"/>
<faction_attitude defense="defend_normal" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND NOT AT WAR > DEFEND FORTIFIED
-->
<min_entry target_human="true" is_neighbour="true"/>
<max_entry target_human="true" is_neighbour="true"/>
<faction_attitude defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND AT WAR > DEFEND DEEP
-->
<min_entry stance="AtWar" target_human="true" is_neighbour="true"/>
<max_entry stance="AtWar" target_human="true" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_deep" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF NOT NEIGHBOUR > DEFEND MINIMAL
-->
<min_entry is_neighbour="false"/>
<max_entry is_neighbour="false"/>
<faction_attitude defense="defend_minimal" continue="true"/>
</decision_entry>
<!--
DEFEND v SLAVES
-->
<decision_entry>
<!--
IF SLAVE AND NOT NEIGHBOUR > DEFEND MINIMAL
-->
<min_entry target_faction="slave" is_neighbour="false"/>
<max_entry target_faction="slave" is_neighbour="false"/>
<faction_attitude at_war="true" defense="defend_minimal" want_peace="false" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVE AND NEIGHBOUR AND EARLY GAME > DEFEND MINIMAL
-->
<min_entry target_faction="slave" is_neighbour="true"/>
<max_entry target_faction="slave" turn_number="30" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_minimal" want_peace="false" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVE AND NEIGHBOUR > DEFEND NORMAL
-->
<min_entry target_faction="slave" is_neighbour="true"/>
<max_entry target_faction="slave" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_frontline" want_peace="false" continue="false"/>
</decision_entry>
</defend_decisions>
<invasion_decisions>
<!--
DEFAULT
-->
<decision_entry>
<!--
DEFAULT INVADE NONE
-->
<faction_attitude invade="invade_none" continue="true"/>
</decision_entry>
<!--
DIPLOMACY
-->
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<max_entry turn_number="10"/>
<faction_attitude want_ally="false" pts_alliance="-5" continue="true"/>
</decision_entry>
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<min_entry turn_number="11"/>
<max_entry turn_number="20"/>
<faction_attitude want_ally="false" pts_alliance="-10" continue="true"/>
</decision_entry>
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<min_entry turn_number="21"/>
<faction_attitude want_ally="false" pts_alliance="-15" continue="true"/>
</decision_entry>
<decision_entry>
<!--
DON'T ALLY ISLAMIC FACTIONS
-->
<min_entry target_religion="islam"/>
<min_entry target_religion="islam"/>
<faction_attitude want_ally="false" pts_alliance="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
MAKE PAPACY UNLIKELY TO ALLY
-->
<min_entry faction_standing="0.6" target_global_standing="0.4" enemy_excommunicated="false"/>
<max_entry rand="0.15"/>
<faction_attitude want_ally="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry trusted_ally="true"/>
<max_entry trusted_ally="true" rand="0.9"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND TRUSTWORTHY AND ONLY ALLIED SHORT WHILE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry stance="Allied" global_standing="0.25"/>
<max_entry stance="Allied" num_turns_allied="10"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ONLY ALLIED FOR SHORT TIME, CANNOT FORCE INVADE, INVADE NONE
-->
<max_entry stance="Allied"/>
<max_entry num_turns_allied="3" stance="Allied"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AGREED TO CEASEFIRE SHORT TIME AGO AND RELATIVELY TRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry num_turns_ceasfire="0" stance="Neutral" global_standing="0.25"/>
<max_entry num_turns_ceasfire="10" stance="Neutral"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AGREED TO CEASEFIRE SHORT TIME AGO, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry num_turns_ceasfire="0" stance="Neutral"/>
<max_entry num_turns_ceasfire="3" stance="Neutral"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND VERY TRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" global_standing="0.5"/>
<max_entry stance="Allied" rand="0.8"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND LIKE THEM ALOT AND NOT UNTRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" faction_standing="0.5" global_standing="-0.1"/>
<max_entry stance="Allied" rand="0.8"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND WE DON'T MIND THEM, AND NOT TOO UNTRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" faction_standing="0.0" global_standing="-0.25"/>
<max_entry stance="Allied" rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.5"/>
<max_entry stance="Neutral" rand="0.75"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.25"/>
<max_entry stance="Neutral" rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
PARTIALLY FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.0"/>
<max_entry stance="Neutral" rand="0.25"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF PROTECTORATE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry is_protectorate="true" />
<max_entry is_protectorate="true" />
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY PROTECTORATE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry trusted_ally_protectorate="true"/>
<max_entry trusted_ally_protectorate="true"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, ALLIANCE AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES, DON'T ALLY AGAINST
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude alliance_against="-2" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true"/>
<max_entry strongest_neighbour="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MOST DESIRABLE, ALLY AGAINST
-->
<min_entry most_desirable="true"/>
<max_entry most_desirable="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE MUCH STRONGER, ALLY AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar" frontline_balance="0.3" free_strength_balance="0.3" production_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER, ALLY AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar" frontline_balance="0.5" free_strength_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER ON FRONTLINE, ALLY AGAINST
-->
<min_entry stance="AtWar" free_strength_balance="1.0"/>
<max_entry stance="AtWar" frontline_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER IN FREE STRENGTH, ALLY AGAINST
-->
<min_entry stance="AtWar" frontline_balance="1.0"/>
<max_entry stance="AtWar" free_strength_balance="0.7"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY OUTPRODUCE US, ALLY AGAINST
-->
<min_entry stance="AtWar" frontline_balance="1.0"/>
<max_entry production_balance="1.0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NOT AT WAR AND STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true" frontline_balance="2.0" target_num_enemies="2"/>
<max_entry strongest_neighbour="true" production_balance="1.0" num_enemies="0" />
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUTPRODUCE AND STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true" production_balance="1.0"/>
<max_entry strongest_neighbour="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MOST DESIRABLE, ALLY AGAINST
-->
<min_entry most_desirable="true" production_balance="1.0"/>
<max_entry most_desirable="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND VASTLY SUPERIOR, OFFER PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" frontline_balance="5.0" military_balance="1.0" production_balance="1.0"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude want_offer_protect="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND VASTLY OUTNUMBERED, WANT BE PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" />
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.3" free_strength_balance="0.3" production_balance="0.5" num_settlements="3"/>
<faction_attitude want_peace="true" want_be_protect="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.75" free_strength_balance="0.75"/>
<faction_attitude want_peace="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED AND LALST SETTLEMENT, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.8" free_strength_balance="0.8" num_settlements="3"/>
<faction_attitude want_peace="true" want_be_protect="true" continue="false"/>
</decision_entry>
<!--
DECIDE WHO TO INVADE
-->
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="1.0"/>
<max_entry is_neighbour="true" frontline_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="2.0"/>
<max_entry is_neighbour="true" frontline_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="1.0"/>
<max_entry is_neighbour="true" military_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="2.0"/>
<max_entry is_neighbour="true" military_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET AT WAR WITH LOTS OF FACTIONS, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_num_enemies="3"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="1.0"/>
<max_entry is_neighbour="true" production_balance="2.0"/>
<faction_attitude invade_priority="25" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="2.0"/>
<max_entry is_neighbour="true" production_balance="3.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE AGAINST, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" has_alliance_against="true"/>
<max_entry is_neighbour="true" has_alliance_against="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="1.0"/>
<max_entry is_neighbour="true" alliance_military_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="2.0"/>
<max_entry is_neighbour="true" alliance_military_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.75"/>
<max_entry is_neighbour="true" faction_standing="-0.5"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.5"/>
<max_entry is_neighbour="true" faction_standing="-0.25"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.25"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF UNTRUSTOWRTHY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" global_standing="0.5"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" stance="AtWar"/>
<max_entry is_neighbour="true" stance="AtWar"/>
<faction_attitude invade_priority="150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_human="true"/>
<max_entry is_neighbour="true" target_human="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY HARD, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" difficulty="hard"/>
<max_entry is_neighbour="true" difficulty="hard"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY VERY HARD HARD, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" difficulty="very_hard"/>
<max_entry is_neighbour="true" difficulty="very_hard"/>
<faction_attitude invade_priority="150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKEST NEIGHBOUR, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_weakest_neighbour="true"/>
<max_entry is_neighbour="true" target_weakest_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY ENEMY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" trusted_ally_enemy="true"/>
<max_entry is_neighbour="true" trusted_ally_enemy="true"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<!--
DECIDE WHO NOT TO INVADE
-->
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="1"/>
<max_entry is_neighbour="true" num_enemies="2"/>
<faction_attitude invade_priority="-100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="2"/>
<max_entry is_neighbour="true" num_enemies="3"/>
<faction_attitude invade_priority="-150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="3"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="-200" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKER FRONTLINE, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" frontline_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKER MILITARY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" military_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUTPRODUCED, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" production_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF GOOD STANDINGS, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="0.35"/>
<max_entry is_neighbour="true" faction_standing="1.0"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTWORTHY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" global_standing="0.4"/>
<max_entry is_neighbour="true" global_standing="1.0"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF LOW FREE STRENGTH VALUE, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" free_strength_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" trusted_ally="true"/>
<max_entry is_neighbour="true" trusted_ally="true"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<!--
EARLY GAME
-->
<decision_entry>
<!--
IF EARLY GAME, INVADE NONE
-->
<min_entry stance="Neutral"/>
<max_entry stance="Neutral" turn_number="10"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<!--
FOR CATHOLICS
-->
<decision_entry>
<!--
IF TARGET NOT EXCOMMUNICATED, CANNOT FORCE INVADE, INVADE NONE, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" enemy_excommunicated="false"/>
<max_entry is_neighbour="true" enemy_excommunicated="false"/>
<faction_attitude can_force_invade="false" invade="invade_none" invade_priority="-400" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF CEASE HOSTILITIES, INVADE NONE, CANNOT FORCE INVADE, REDUCE INVADE PRIORITY
-->
<min_entry faction_standing="-0.25" has_ceasehostilities="true" global_standing="-0.25"/>
<faction_attitude can_force_invade="false" invade="invade_none" invade_priority="-250" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF CEASE HOSTILITIES, INVADE NONE, CANNOT FORCE INVADE, REDUCE INVADE PRIORITY, RANDOMISED SLIGHTLY
-->
<min_entry has_ceasehostilities="true"/>
<max_entry rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET NON-EXCOMMUNICATED CATHOLIC AND WE LIKE THEM, REDUCE INVADE PRIORITY
-->
<min_entry stance="Neutral" target_religion="catholic" enemy_excommunicated="false" excommunicated="false" target_faction_standing="-0.1" target_global_standing="-0.1"/>
<max_entry stance="Neutral" target_religion="catholic" enemy_excommunicated="false" excommunicated="false"/>
<faction_attitude invade_priority="-800" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET NON-EXCOMMUNICATED CATHOLIC, REDUCE INVADE PRIORITY
-->
<min_entry stance="Neutral" target_religion="catholic" enemy_excommunicated="false" excommunicated="false"/>
<max_entry stance="Neutral" target_religion="catholic" enemy_excommunicated="false" excommunicated="false"/>
<faction_attitude invade_priority="-800" continue="true"/>
</decision_entry>
<!--
INVADES FOR NEIGHBOURS
-->
<decision_entry>
<!--
MAKE PAPACY INVADE LESS
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade="invade_none" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR > INVADE BUILDUP
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND HE IS SUPERIOR > INVADE OPPORTUNISTIC
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" military_balance="0.9" free_strength_balance="0.9"/>
<faction_attitude invade="invade_opportunistic" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND SUPERIOR > INVADE IMMEDIATE
-->
<min_entry stance="AtWar" is_neighbour="true" frontline_balance="1.5"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="100.0"/>
<faction_attitude invade="invade_immediate" continue="true"/>
</decision_entry>
<!--
SLAVE
-->
<decision_entry>
<!--
IF SLAVES > INVADE OPPORTUNISTIC
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_opportunistic" invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND SLIGHTLY SUPERIOR > INVADE OPPORTUNISTIC
-->
<min_entry target_faction="slave" frontline_balance="1.0"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_buildup" invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND SUPERIOR > INVADE IMMEDIATE
-->
<min_entry target_faction="slave" frontline_balance="2.0"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_immediate" invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND EARLY GAME > INVADE IMMEDIATE
-->
<min_entry target_faction="slave" frontline_balance="1.25"/>
<max_entry target_faction="slave" turn_number="30"/>
<faction_attitude at_war="true" invade="invade_immediate" invade_priority="100" continue="true"/>
</decision_entry>
<!--
IMPROVEMENTS TO CRUSADES
-->
<decision_entry>
<!--
IF ISLAMIC AND LOW FACTION STANDINGS, INCREASE INVADE PRIORITY
-->
<min_entry target_religion="islam" faction_standing="-1.0"/>
<max_entry target_religion="islam" faction_standing="-0.7"/>
<faction_attitude can_force_invade="true" invade="invade_immediate" invade_priority="1000" continue="true"/>
</decision_entry>
</invasion_decisions>
</faction_ai_label>
<!--
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CATHOLIC FACTION AI PARAMS. REQUIRES SPECIAL STUFF TO REDUCE ATTACKING NON-EXCOMMUNICATED CATHOLIC FACTIONS //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<faction_ai_label name="catholic">
<defend_decisions>
<!--
DEFEND
-->
<decision_entry>
<!--
IF AT WAR AND EVEN > DEFEND FORTIFIED
-->
<min_entry stance="AtWar" military_balance="0.75" is_neighbour="true"/>
<max_entry stance="AtWar" military_balance="1.75" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND WEAKER > DEFEND DEEP
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" military_balance="0.75" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_deep" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND STRONGER > DEFEND FRONTLINE
-->
<min_entry stance="AtWar" military_balance="1.75" is_neighbour="true"/>
<max_entry stance="AtWar"is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_frontline" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY > DEFEND NORMAL
-->
<min_entry trusted_ally="true" stance="Allied" target_human="false" is_neighbour="true"/>
<max_entry trusted_ally="true" stance="Allied" target_human="false" is_neighbour="true"/>
<faction_attitude defense="defend_normal" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND NOT AT WAR > DEFEND FORTIFIED
-->
<min_entry target_human="true" is_neighbour="true"/>
<max_entry target_human="true" is_neighbour="true"/>
<faction_attitude defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND AT WAR > DEFEND DEEP
-->
<min_entry stance="AtWar" target_human="true" is_neighbour="true"/>
<max_entry stance="AtWar" target_human="true" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_deep" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF NOT NEIGHBOUR > DEFEND MINIMAL
-->
<min_entry is_neighbour="false"/>
<max_entry is_neighbour="false"/>
<faction_attitude defense="defend_minimal" continue="true"/>
</decision_entry>
<!--
DEFEND v SLAVES
-->
<decision_entry>
<!--
IF SLAVE AND NOT NEIGHBOUR > DEFEND MINIMAL
-->
<min_entry target_faction="slave" is_neighbour="false"/>
<max_entry target_faction="slave" is_neighbour="false"/>
<faction_attitude at_war="true" defense="defend_minimal" want_peace="false" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVE AND NEIGHBOUR AND EARLY GAME > DEFEND MINIMAL
-->
<min_entry target_faction="slave" is_neighbour="true"/>
<max_entry target_faction="slave" turn_number="30" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_minimal" want_peace="false" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVE AND NEIGHBOUR > DEFEND NORMAL
-->
<min_entry target_faction="slave" is_neighbour="true"/>
<max_entry target_faction="slave" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_frontline" want_peace="false" continue="false"/>
</decision_entry>
</defend_decisions>
<invasion_decisions>
<!--
DEFAULT
-->
<decision_entry>
<!--
DEFAULT INVADE NONE
-->
<faction_attitude invade="invade_none" continue="true"/>
</decision_entry>
<!--
DIPLOMACY
-->
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<max_entry turn_number="10"/>
<faction_attitude want_ally="false" pts_alliance="-5" continue="true"/>
</decision_entry>
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<min_entry turn_number="11"/>
<max_entry turn_number="20"/>
<faction_attitude want_ally="false" pts_alliance="-10" continue="true"/>
</decision_entry>
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<min_entry turn_number="21"/>
<faction_attitude want_ally="false" pts_alliance="-15" continue="true"/>
</decision_entry>
<decision_entry>
<!--
DON'T ALLY WITH ISLAMIC FACTIONS
-->
<min_entry target_religion="islam"/>
<max_entry target_religion="islam"/>
<faction_attitude want_ally="false" pts_alliance="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry trusted_ally="true"/>
<max_entry trusted_ally="true" rand="0.9"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND TRUSTWORTHY AND ONLY ALLIED SHORT WHILE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry stance="Allied" global_standing="0.25"/>
<max_entry stance="Allied" num_turns_allied="10"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ONLY ALLIED FOR SHORT TIME, CANNOT FORCE INVADE, INVADE NONE
-->
<max_entry stance="Allied"/>
<max_entry num_turns_allied="3" stance="Allied"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AGREED TO CEASEFIRE SHORT TIME AGO AND RELATIVELY TRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry num_turns_ceasfire="0" stance="Neutral" global_standing="0.25"/>
<max_entry num_turns_ceasfire="10" stance="Neutral"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AGREED TO CEASEFIRE SHORT TIME AGO, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry num_turns_ceasfire="0" stance="Neutral"/>
<max_entry num_turns_ceasfire="3" stance="Neutral"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND VERY TRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" global_standing="0.5"/>
<max_entry stance="Allied" rand="0.8"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND LIKE THEM ALOT AND NOT UNTRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" faction_standing="0.5" global_standing="-0.1"/>
<max_entry stance="Allied" rand="0.8"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND WE DON'T MIND THEM, AND NOT TOO UNTRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" faction_standing="0.0" global_standing="-0.25"/>
<max_entry stance="Allied" rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.5"/>
<max_entry stance="Neutral" rand="0.75"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.25"/>
<max_entry stance="Neutral" rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
PARTIALLY FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.0"/>
<max_entry stance="Neutral" rand="0.25"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF PROTECTORATE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry is_protectorate="true" />
<max_entry is_protectorate="true" />
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY PROTECTORATE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry trusted_ally_protectorate="true"/>
<max_entry trusted_ally_protectorate="true"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, ALLIANCE AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES, DON'T ALLY AGAINST
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude alliance_against="-2" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true"/>
<max_entry strongest_neighbour="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MOST DESIRABLE, ALLY AGAINST
-->
<min_entry most_desirable="true"/>
<max_entry most_desirable="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE MUCH STRONGER, ALLY AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar" frontline_balance="0.3" free_strength_balance="0.3" production_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER, ALLY AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar" frontline_balance="0.5" free_strength_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER ON FRONTLINE, ALLY AGAINST
-->
<min_entry stance="AtWar" free_strength_balance="1.0"/>
<max_entry stance="AtWar" frontline_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER IN FREE STRENGTH, ALLY AGAINST
-->
<min_entry stance="AtWar" frontline_balance="1.0"/>
<max_entry stance="AtWar" free_strength_balance="0.7"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY OUTPRODUCE US, ALLY AGAINST
-->
<min_entry stance="AtWar" frontline_balance="1.0"/>
<max_entry production_balance="1.0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NOT AT WAR AND STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true" frontline_balance="2.0" target_num_enemies="2"/>
<max_entry strongest_neighbour="true" production_balance="1.0" num_enemies="0" />
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUTPRODUCE AND STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true" production_balance="1.0"/>
<max_entry strongest_neighbour="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MOST DESIRABLE, ALLY AGAINST
-->
<min_entry most_desirable="true" production_balance="1.0"/>
<max_entry most_desirable="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND VASTLY SUPERIOR, OFFER PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" frontline_balance="5.0" military_balance="1.0" production_balance="1.0"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude want_offer_protect="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND VASTLY OUTNUMBERED, WANT BE PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" />
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.3" free_strength_balance="0.3" production_balance="0.5" num_settlements="3"/>
<faction_attitude want_peace="true" want_be_protect="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.75" free_strength_balance="0.75"/>
<faction_attitude want_peace="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED AND LALST SETTLEMENT, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.8" free_strength_balance="0.8" num_settlements="3"/>
<faction_attitude want_peace="true" want_be_protect="true" continue="false"/>
</decision_entry>
<!--
DECIDE WHO TO INVADE
-->
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="1.0"/>
<max_entry is_neighbour="true" frontline_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="2.0"/>
<max_entry is_neighbour="true" frontline_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="1.0"/>
<max_entry is_neighbour="true" military_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="2.0"/>
<max_entry is_neighbour="true" military_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET AT WAR WITH LOTS OF FACTIONS, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_num_enemies="3"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="1.0"/>
<max_entry is_neighbour="true" production_balance="2.0"/>
<faction_attitude invade_priority="25" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="2.0"/>
<max_entry is_neighbour="true" production_balance="3.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE AGAINST, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" has_alliance_against="true"/>
<max_entry is_neighbour="true" has_alliance_against="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="1.0"/>
<max_entry is_neighbour="true" alliance_military_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="2.0"/>
<max_entry is_neighbour="true" alliance_military_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.75"/>
<max_entry is_neighbour="true" faction_standing="-0.5"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.5"/>
<max_entry is_neighbour="true" faction_standing="-0.25"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.25"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF UNTRUSTOWRTHY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" global_standing="0.5"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" stance="AtWar"/>
<max_entry is_neighbour="true" stance="AtWar"/>
<faction_attitude invade_priority="150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_human="true"/>
<max_entry is_neighbour="true" target_human="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY HARD, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" difficulty="hard"/>
<max_entry is_neighbour="true" difficulty="hard"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY VERY HARD HARD, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" difficulty="very_hard"/>
<max_entry is_neighbour="true" difficulty="very_hard"/>
<faction_attitude invade_priority="150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKEST NEIGHBOUR, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_weakest_neighbour="true"/>
<max_entry is_neighbour="true" target_weakest_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY ENEMY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" trusted_ally_enemy="true"/>
<max_entry is_neighbour="true" trusted_ally_enemy="true"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<!--
DECIDE WHO NOT TO INVADE
-->
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="1"/>
<max_entry is_neighbour="true" num_enemies="2"/>
<faction_attitude invade_priority="-100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="2"/>
<max_entry is_neighbour="true" num_enemies="3"/>
<faction_attitude invade_priority="-150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="3"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="-200" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKER FRONTLINE, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" frontline_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKER MILITARY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" military_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUTPRODUCED, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" production_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF GOOD STANDINGS, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="0.35"/>
<max_entry is_neighbour="true" faction_standing="1.0"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTWORTHY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" global_standing="0.4"/>
<max_entry is_neighbour="true" global_standing="1.0"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF LOW FREE STRENGTH VALUE, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" free_strength_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" trusted_ally="true"/>
<max_entry is_neighbour="true" trusted_ally="true"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<!--
EARLY GAME
-->
<decision_entry>
<!--
IF EARLY GAME, INVADE NONE
-->
<min_entry stance="Neutral"/>
<max_entry stance="Neutral" turn_number="10"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<!--
FOR CATHOLICS
-->
<decision_entry>
<!--
IF PAPAL STATES AND LIKE US, INVADE NONE, CANNOT FORCE INVADE
-->
<min_entry target_faction="papal_states" target_faction_standing="-0.5"/>
<max_entry target_faction="papal_states"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF CEASE HOSTILITIES, INVADE NONE, CANNOT FORCE INVADE, REDUCE INVADE PRIORITY
-->
<min_entry faction_standing="-0.25" has_ceasehostilities="true" global_standing="-0.25"/>
<faction_attitude can_force_invade="false" invade="invade_none" invade_priority="-250" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF CEASE HOSTILITIES, INVADE NONE, CANNOT FORCE INVADE, REDUCE INVADE PRIORITY, RANDOMISED SLIGHTLY
-->
<min_entry has_ceasehostilities="true"/>
<max_entry rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET NON-EXCOMMUNICATED CATHOLIC AND WE LIKE THEM, REDUCE INVADE PRIORITY
-->
<min_entry stance="Neutral" target_religion="catholic" enemy_excommunicated="false" excommunicated="false" target_faction_standing="-0.1" target_global_standing="-0.1"/>
<max_entry stance="Neutral" target_religion="catholic" enemy_excommunicated="false" excommunicated="false"/>
<faction_attitude invade_priority="-800" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET NON-EXCOMMUNICATED CATHOLIC, REDUCE INVADE PRIORITY
-->
<min_entry stance="Neutral" target_religion="catholic" enemy_excommunicated="false" excommunicated="false"/>
<max_entry stance="Neutral" target_religion="catholic" enemy_excommunicated="false" excommunicated="false"/>
<faction_attitude invade_priority="-800" continue="true"/>
</decision_entry>
<!--
INVADES FOR NEIGHBOURS
-->
<decision_entry>
<!--
IF NEIGHBOUR AND WEAKER FRONTLINE > INVADE BUILDUP
-->
<min_entry is_neighbour="true" frontline_balance="0.1"/>
<max_entry is_neighbour="true" frontline_balance="0.9"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLYS ENEMY AND NOT AT WAR > INVADE BUILDUP
-->
<min_entry is_neighbour="true" trusted_ally_enemy="true"/>
<max_entry is_neighbour="true" trusted_ally_enemy="true"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR > INVADE BUILDUP
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND HE IS SUPERIOR > INVADE OPPORTUNISTIC
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" military_balance="0.9" free_strength_balance="0.9"/>
<faction_attitude invade="invade_opportunistic" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND SUPERIOR > INVADE IMMEDIATE
-->
<min_entry stance="AtWar" is_neighbour="true" frontline_balance="1.5"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="100.0"/>
<faction_attitude invade="invade_immediate" continue="true"/>
</decision_entry>
<!--
IF NOT NEIGHBOUR
-->
<decision_entry>
<!--
IF ENEMY OF TRUSTED ALLY > INVADE BUILDUP
-->
<min_entry is_neighbour="false" trusted_ally_enemy="true"/>
<max_entry is_neighbour="false" trusted_ally_enemy="true"/>
<faction_attitude invade="invade_buildup" continue="true" can_force_invade="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR > INVADE BUILDUP
-->
<min_entry stance="AtWar" is_neighbour="false"/>
<max_entry stance="AtWar" is_neighbour="false"/>
<faction_attitude invade="invade_buildup" continue="true" can_force_invade="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR + RESOURCES > INVADE OPPORTUNISTIC
-->
<min_entry stance="AtWar" is_neighbour="false" military_balance="1.1" free_strength_balance="1.1"/>
<max_entry stance="AtWar" is_neighbour="false"/>
<faction_attitude invade="invade_opportunistic" continue="true" can_force_invade="true"/>
</decision_entry>
<!--
SLAVE
-->
<decision_entry>
<!--
IF SLAVE > REALLY WANT TO INVADE FOR QUICK BULDUP OF EMPIRES
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade_priority="20000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES > INVADE OPPORTUNISTIC
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_opportunistic" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND SLIGHTLY SUPERIOR > INVADE OPPORTUNISTIC
-->
<min_entry target_faction="slave" frontline_balance="1.0"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_buildup" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND SUPERIOR > INVADE IMMEDIATE
-->
<min_entry target_faction="slave" frontline_balance="2.0"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_immediate" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND EARLY GAME > INVADE IMMEDIATE
-->
<min_entry target_faction="slave" frontline_balance="1.25"/>
<max_entry target_faction="slave" turn_number="30"/>
<faction_attitude at_war="true" invade="invade_immediate" invade_priority="2000" continue="true"/>
</decision_entry>
<!--
IMPROVEMENTS TO CRUSADES
-->
<decision_entry>
<!--
IF ISLAMIC AND LOW FACTION STANDINGS, INCREASE INVADE PRIORITY
-->
<min_entry target_religion="islam" faction_standing="-1.0"/>
<max_entry target_religion="islam" faction_standing="-0.7"/>
<faction_attitude can_force_invade="true" invade="invade_immediate" invade_priority="1000" continue="true"/>
</decision_entry>
</invasion_decisions>
</faction_ai_label>
<!--
///////////////////////////////////////
// MONGOL AI PARAMTERS //
///////////////////////////////////////
-->
<faction_ai_label name="mongol">
<defend_decisions>
<!--
DEFEND
-->
<decision_entry>
<!--
IF AT WAR AND EVEN > DEFEND FORTIFIED
-->
<min_entry stance="AtWar" military_balance="0.75" is_neighbour="true"/>
<max_entry stance="AtWar" military_balance="1.75" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND WEAKER > DEFEND DEEP
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" military_balance="0.75" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_deep" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND STRONGER > DEFEND FRONTLINE
-->
<min_entry stance="AtWar" military_balance="1.75" is_neighbour="true"/>
<max_entry stance="AtWar"is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_frontline" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY > DEFEND NORMAL
-->
<min_entry trusted_ally="true" stance="Allied" target_human="false" is_neighbour="true"/>
<max_entry trusted_ally="true" stance="Allied" target_human="false" is_neighbour="true"/>
<faction_attitude defense="defend_normal" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND NOT AT WAR > DEFEND FORTIFIED
-->
<min_entry target_human="true" is_neighbour="true"/>
<max_entry target_human="true" is_neighbour="true"/>
<faction_attitude defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND AT WAR > DEFEND DEEP
-->
<min_entry stance="AtWar" target_human="true" is_neighbour="true"/>
<max_entry stance="AtWar" target_human="true" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_deep" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF NOT NEIGHBOUR > DEFEND MINIMAL
-->
<min_entry is_neighbour="false"/>
<max_entry is_neighbour="false"/>
<faction_attitude defense="defend_minimal" continue="true"/>
</decision_entry>
<!--
DEFEND v SLAVES
-->
<decision_entry>
<!--
IF SLAVE AND NOT NEIGHBOUR > DEFEND MINIMAL
-->
<min_entry target_faction="slave" is_neighbour="false"/>
<max_entry target_faction="slave" is_neighbour="false"/>
<faction_attitude at_war="true" defense="defend_minimal" want_peace="false" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVE AND NEIGHBOUR AND EARLY GAME > DEFEND MINIMAL
-->
<min_entry target_faction="slave" is_neighbour="true"/>
<max_entry target_faction="slave" turn_number="30" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_minimal" want_peace="false" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVE AND NEIGHBOUR > DEFEND NORMAL
-->
<min_entry target_faction="slave" is_neighbour="true"/>
<max_entry target_faction="slave" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_frontline" want_peace="false" continue="false"/>
</decision_entry>
</defend_decisions>
<invasion_decisions>
<!--
DEFAULT
-->
<decision_entry>
<!--
DEFAULT INVADE NONE
-->
<faction_attitude invade="invade_none" continue="true"/>
</decision_entry>
<!--
DIPLOMACY
-->
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<max_entry turn_number="10"/>
<faction_attitude want_ally="false" pts_alliance="-5" continue="true"/>
</decision_entry>
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<min_entry turn_number="11"/>
<max_entry turn_number="20"/>
<faction_attitude want_ally="false" pts_alliance="-10" continue="true"/>
</decision_entry>
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<min_entry turn_number="21"/>
<faction_attitude want_ally="false" pts_alliance="-15" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry trusted_ally="true"/>
<max_entry trusted_ally="true" rand="0.9"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND TRUSTWORTHY AND ONLY ALLIED SHORT WHILE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry stance="Allied" global_standing="0.25"/>
<max_entry stance="Allied" num_turns_allied="10"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ONLY ALLIED FOR SHORT TIME, CANNOT FORCE INVADE, INVADE NONE
-->
<max_entry stance="Allied"/>
<max_entry num_turns_allied="3" stance="Allied"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AGREED TO CEASEFIRE SHORT TIME AGO AND RELATIVELY TRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry num_turns_ceasfire="0" stance="Neutral" global_standing="0.25"/>
<max_entry num_turns_ceasfire="10" stance="Neutral"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AGREED TO CEASEFIRE SHORT TIME AGO, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry num_turns_ceasfire="0" stance="Neutral"/>
<max_entry num_turns_ceasfire="3" stance="Neutral"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND VERY TRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" global_standing="0.5"/>
<max_entry stance="Allied" rand="0.8"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND LIKE THEM ALOT AND NOT UNTRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" faction_standing="0.5" global_standing="-0.1"/>
<max_entry stance="Allied" rand="0.8"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND WE DON'T MIND THEM, AND NOT TOO UNTRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" faction_standing="0.0" global_standing="-0.25"/>
<max_entry stance="Allied" rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.5"/>
<max_entry stance="Neutral" rand="0.75"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.25"/>
<max_entry stance="Neutral" rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
PARTIALLY FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.0"/>
<max_entry stance="Neutral" rand="0.25"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF PROTECTORATE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry is_protectorate="true" />
<max_entry is_protectorate="true" />
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY PROTECTORATE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry trusted_ally_protectorate="true"/>
<max_entry trusted_ally_protectorate="true"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, ALLIANCE AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES, DON'T ALLY AGAINST
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude alliance_against="-2" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true"/>
<max_entry strongest_neighbour="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MOST DESIRABLE, ALLY AGAINST
-->
<min_entry most_desirable="true"/>
<max_entry most_desirable="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE MUCH STRONGER, ALLY AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar" frontline_balance="0.3" free_strength_balance="0.3" production_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER, ALLY AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar" frontline_balance="0.5" free_strength_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER ON FRONTLINE, ALLY AGAINST
-->
<min_entry stance="AtWar" free_strength_balance="1.0"/>
<max_entry stance="AtWar" frontline_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER IN FREE STRENGTH, ALLY AGAINST
-->
<min_entry stance="AtWar" frontline_balance="1.0"/>
<max_entry stance="AtWar" free_strength_balance="0.7"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY OUTPRODUCE US, ALLY AGAINST
-->
<min_entry stance="AtWar" frontline_balance="1.0"/>
<max_entry production_balance="1.0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NOT AT WAR AND STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true" frontline_balance="2.0" target_num_enemies="2"/>
<max_entry strongest_neighbour="true" production_balance="1.0" num_enemies="0" />
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUTPRODUCE AND STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true" production_balance="1.0"/>
<max_entry strongest_neighbour="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MOST DESIRABLE, ALLY AGAINST
-->
<min_entry most_desirable="true" production_balance="1.0"/>
<max_entry most_desirable="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND VASTLY SUPERIOR, OFFER PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" frontline_balance="5.0" military_balance="1.0" production_balance="1.0"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude want_offer_protect="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND VASTLY OUTNUMBERED, WANT BE PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" />
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.3" free_strength_balance="0.3" production_balance="0.5" num_settlements="3"/>
<faction_attitude want_peace="true" want_be_protect="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.75" free_strength_balance="0.75"/>
<faction_attitude want_peace="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED AND LALST SETTLEMENT, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.8" free_strength_balance="0.8" num_settlements="3"/>
<faction_attitude want_peace="true" want_be_protect="true" continue="false"/>
</decision_entry>
<!--
DECIDE WHO TO INVADE
-->
<!--
DECIDE WHO TO INVADE
-->
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="1.0"/>
<max_entry is_neighbour="true" frontline_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="2.0"/>
<max_entry is_neighbour="true" frontline_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="1.0"/>
<max_entry is_neighbour="true" military_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="2.0"/>
<max_entry is_neighbour="true" military_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET AT WAR WITH LOTS OF FACTIONS, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_num_enemies="3"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="1.0"/>
<max_entry is_neighbour="true" production_balance="2.0"/>
<faction_attitude invade_priority="25" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="2.0"/>
<max_entry is_neighbour="true" production_balance="3.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE AGAINST, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" has_alliance_against="true"/>
<max_entry is_neighbour="true" has_alliance_against="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="1.0"/>
<max_entry is_neighbour="true" alliance_military_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="2.0"/>
<max_entry is_neighbour="true" alliance_military_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.75"/>
<max_entry is_neighbour="true" faction_standing="-0.5"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.5"/>
<max_entry is_neighbour="true" faction_standing="-0.25"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.25"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF UNTRUSTOWRTHY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" global_standing="0.5"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" stance="AtWar"/>
<max_entry is_neighbour="true" stance="AtWar"/>
<faction_attitude invade_priority="150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_human="true"/>
<max_entry is_neighbour="true" target_human="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY HARD, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" difficulty="hard"/>
<max_entry is_neighbour="true" difficulty="hard"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY VERY HARD HARD, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" difficulty="very_hard"/>
<max_entry is_neighbour="true" difficulty="very_hard"/>
<faction_attitude invade_priority="150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKEST NEIGHBOUR, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_weakest_neighbour="true"/>
<max_entry is_neighbour="true" target_weakest_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY ENEMY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" trusted_ally_enemy="true"/>
<max_entry is_neighbour="true" trusted_ally_enemy="true"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<!--
DECIDE WHO NOT TO INVADE
-->
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="1"/>
<max_entry is_neighbour="true" num_enemies="2"/>
<faction_attitude invade_priority="-100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="2"/>
<max_entry is_neighbour="true" num_enemies="3"/>
<faction_attitude invade_priority="-150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="3"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="-200" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKER FRONTLINE, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" frontline_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKER MILITARY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" military_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUTPRODUCED, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" production_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF GOOD STANDINGS, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="0.35"/>
<max_entry is_neighbour="true" faction_standing="1.0"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTWORTHY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" global_standing="0.4"/>
<max_entry is_neighbour="true" global_standing="1.0"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF LOW FREE STRENGTH VALUE, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" free_strength_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" trusted_ally="true"/>
<max_entry is_neighbour="true" trusted_ally="true"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<!--
EARLY GAME
-->
<decision_entry>
<!--
IF EARLY GAME, INVADE NONE
-->
<min_entry stance="Neutral"/>
<max_entry stance="Neutral" turn_number="10"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<!--
INVADES FOR NEIGHBOURS
-->
<decision_entry>
<!--
IF NEIGHBOUR AND WEAKER FRONTLINE > INVADE BUILDUP
-->
<min_entry is_neighbour="true" frontline_balance="0.1"/>
<max_entry is_neighbour="true" frontline_balance="0.9"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLYS ENEMY AND NOT AT WAR > INVADE BUILDUP
-->
<min_entry is_neighbour="true" trusted_ally_enemy="true"/>
<max_entry is_neighbour="true" trusted_ally_enemy="true"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR > INVADE BUILDUP
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND HE IS SUPERIOR > INVADE OPPORTUNISTIC
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" military_balance="0.9" free_strength_balance="0.9"/>
<faction_attitude invade="invade_opportunistic" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND SUPERIOR > INVADE IMMEDIATE
-->
<min_entry stance="AtWar" is_neighbour="true" frontline_balance="1.5"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="100.0"/>
<faction_attitude invade="invade_immediate" continue="true"/>
</decision_entry>
<!--
IF NOT NEIGHBOUR
-->
<decision_entry>
<!--
IF ENEMY OF TRUSTED ALLY > INVADE BUILDUP
-->
<min_entry is_neighbour="false" trusted_ally_enemy="true"/>
<max_entry is_neighbour="false" trusted_ally_enemy="true"/>
<faction_attitude invade="invade_opportunistic" continue="true" can_force_invade="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR > INVADE BUILDUP
-->
<min_entry stance="AtWar" is_neighbour="false"/>
<max_entry stance="AtWar" is_neighbour="false"/>
<faction_attitude invade="invade_opportunistic" continue="true" can_force_invade="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR + RESOURCES > INVADE OPPORTUNISTIC
-->
<min_entry stance="AtWar" is_neighbour="false" military_balance="1.1" free_strength_balance="1.1"/>
<max_entry stance="AtWar" is_neighbour="false"/>
<faction_attitude invade="invade_immediate" continue="true" can_force_invade="true"/>
</decision_entry>
<!--
SLAVE
-->
<decision_entry>
<!--
IF SLAVE > REALLY WANT TO INVADE FOR QUICK BULDUP OF EMPIRES
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade_priority="20000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES > INVADE OPPORTUNISTIC
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_opportunistic" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND SLIGHTLY SUPERIOR > INVADE OPPORTUNISTIC
-->
<min_entry target_faction="slave" frontline_balance="1.0"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_buildup" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND SUPERIOR > INVADE IMMEDIATE
-->
<min_entry target_faction="slave" frontline_balance="2.0"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_immediate" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND EARLY GAME > INVADE IMMEDIATE
-->
<min_entry target_faction="slave" frontline_balance="1.25"/>
<max_entry target_faction="slave" turn_number="30"/>
<faction_attitude at_war="true" invade="invade_immediate" invade_priority="2000" continue="true"/>
</decision_entry>
</invasion_decisions>
</faction_ai_label>
<!--
///////////////////////////////////////
// ISLAMIC AI PARAMS. //
///////////////////////////////////////
-->
<faction_ai_label name="islam">
<defend_decisions>
<!--
DEFEND
-->
<decision_entry>
<!--
IF AT WAR AND EVEN > DEFEND FORTIFIED
-->
<min_entry stance="AtWar" military_balance="0.75" is_neighbour="true"/>
<max_entry stance="AtWar" military_balance="1.75" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND WEAKER > DEFEND DEEP
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" military_balance="0.75" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_deep" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND STRONGER > DEFEND FRONTLINE
-->
<min_entry stance="AtWar" military_balance="1.75" is_neighbour="true"/>
<max_entry stance="AtWar"is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_frontline" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY > DEFEND NORMAL
-->
<min_entry trusted_ally="true" stance="Allied" target_human="false" is_neighbour="true"/>
<max_entry trusted_ally="true" stance="Allied" target_human="false" is_neighbour="true"/>
<faction_attitude defense="defend_normal" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND NOT AT WAR > DEFEND FORTIFIED
-->
<min_entry target_human="true" is_neighbour="true"/>
<max_entry target_human="true" is_neighbour="true"/>
<faction_attitude defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND AT WAR > DEFEND DEEP
-->
<min_entry stance="AtWar" target_human="true" is_neighbour="true"/>
<max_entry stance="AtWar" target_human="true" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_deep" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF NOT NEIGHBOUR > DEFEND MINIMAL
-->
<min_entry is_neighbour="false"/>
<max_entry is_neighbour="false"/>
<faction_attitude defense="defend_minimal" continue="true"/>
</decision_entry>
<!--
DEFEND v SLAVES
-->
<decision_entry>
<!--
IF SLAVE AND NOT NEIGHBOUR > DEFEND MINIMAL
-->
<min_entry target_faction="slave" is_neighbour="false"/>
<max_entry target_faction="slave" is_neighbour="false"/>
<faction_attitude at_war="true" defense="defend_minimal" want_peace="false" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVE AND NEIGHBOUR AND EARLY GAME > DEFEND MINIMAL
-->
<min_entry target_faction="slave" is_neighbour="true"/>
<max_entry target_faction="slave" turn_number="30" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_minimal" want_peace="false" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVE AND NEIGHBOUR > DEFEND NORMAL
-->
<min_entry target_faction="slave" is_neighbour="true"/>
<max_entry target_faction="slave" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_frontline" want_peace="false" continue="false"/>
</decision_entry>
</defend_decisions>
<invasion_decisions>
<!--
DEFAULT
-->
<decision_entry>
<!--
DEFAULT INVADE NONE
-->
<faction_attitude invade="invade_none" continue="true"/>
</decision_entry>
<!--
DIPLOMACY
-->
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<max_entry turn_number="10"/>
<faction_attitude want_ally="false" pts_alliance="-5" continue="true"/>
</decision_entry>
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<min_entry turn_number="11"/>
<max_entry turn_number="20"/>
<faction_attitude want_ally="false" pts_alliance="-10" continue="true"/>
</decision_entry>
<decision_entry>
<!--
BY DEFAULT DON'T WANT TO ALLY
-->
<min_entry turn_number="21"/>
<faction_attitude want_ally="false" pts_alliance="-15" continue="true"/>
</decision_entry>
<decision_entry>
<!--
DON'T ALLY WITH CATHOLIC FACTIONS
-->
<min_entry target_religion="catholic"/>
<max_entry target_religion="catholic"/>
<faction_attitude want_ally="false" pts_alliance="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
WANT ALLY WITH ISLAMIC FACTIONS
-->
<min_entry target_religion="islam"/>
<max_entry target_religion="islam"/>
<faction_attitude want_ally="true" pts_alliance = "10" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry trusted_ally="true"/>
<max_entry trusted_ally="true" rand="0.9"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND TRUSTWORTHY AND ONLY ALLIED SHORT WHILE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry stance="Allied" global_standing="0.25"/>
<max_entry stance="Allied" num_turns_allied="10"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ONLY ALLIED FOR SHORT TIME, CANNOT FORCE INVADE, INVADE NONE
-->
<max_entry stance="Allied"/>
<max_entry num_turns_allied="3" stance="Allied"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AGREED TO CEASEFIRE SHORT TIME AGO AND RELATIVELY TRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry num_turns_ceasfire="0" stance="Neutral" global_standing="0.25"/>
<max_entry num_turns_ceasfire="10" stance="Neutral"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AGREED TO CEASEFIRE SHORT TIME AGO, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry num_turns_ceasfire="0" stance="Neutral"/>
<max_entry num_turns_ceasfire="3" stance="Neutral"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND VERY TRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" global_standing="0.5"/>
<max_entry stance="Allied" rand="0.8"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND LIKE THEM ALOT AND NOT UNTRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" faction_standing="0.5" global_standing="-0.1"/>
<max_entry stance="Allied" rand="0.8"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED AND WE DON'T MIND THEM, AND NOT TOO UNTRUSTWORTHY, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Allied" faction_standing="0.0" global_standing="-0.25"/>
<max_entry stance="Allied" rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.5"/>
<max_entry stance="Neutral" rand="0.75"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.25"/>
<max_entry stance="Neutral" rand="0.5"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
PARTIALLY FRIENDLY NEUTRAL, CANNOT FORCE INVADE, INVADE NONE, RANDOMISED SLIGHTLY
-->
<min_entry stance="Neutral" faction_standing="0.0"/>
<max_entry stance="Neutral" rand="0.25"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF PROTECTORATE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry is_protectorate="true" />
<max_entry is_protectorate="true" />
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY PROTECTORATE, CANNOT FORCE INVADE, INVADE NONE
-->
<min_entry trusted_ally_protectorate="true"/>
<max_entry trusted_ally_protectorate="true"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, ALLIANCE AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES, DON'T ALLY AGAINST
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude alliance_against="-2" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true"/>
<max_entry strongest_neighbour="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MOST DESIRABLE, ALLY AGAINST
-->
<min_entry most_desirable="true"/>
<max_entry most_desirable="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE MUCH STRONGER, ALLY AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar" frontline_balance="0.3" free_strength_balance="0.3" production_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER, ALLY AGAINST
-->
<min_entry stance="AtWar"/>
<max_entry stance="AtWar" frontline_balance="0.5" free_strength_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER ON FRONTLINE, ALLY AGAINST
-->
<min_entry stance="AtWar" free_strength_balance="1.0"/>
<max_entry stance="AtWar" frontline_balance="0.5"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY'RE STRONGER IN FREE STRENGTH, ALLY AGAINST
-->
<min_entry stance="AtWar" frontline_balance="1.0"/>
<max_entry stance="AtWar" free_strength_balance="0.7"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND THEY OUTPRODUCE US, ALLY AGAINST
-->
<min_entry stance="AtWar" frontline_balance="1.0"/>
<max_entry production_balance="1.0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NOT AT WAR AND STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true" frontline_balance="2.0" target_num_enemies="2"/>
<max_entry strongest_neighbour="true" production_balance="1.0" num_enemies="0" />
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUTPRODUCE AND STRONGEST NEIGHBOUR, ALLY AGAINST
-->
<min_entry strongest_neighbour="true" production_balance="1.0"/>
<max_entry strongest_neighbour="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MOST DESIRABLE, ALLY AGAINST
-->
<min_entry most_desirable="true" production_balance="1.0"/>
<max_entry most_desirable="true" num_enemies="0"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND VASTLY SUPERIOR, OFFER PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" frontline_balance="5.0" military_balance="1.0" production_balance="1.0"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude want_offer_protect="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND VASTLY OUTNUMBERED, WANT BE PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" />
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.3" free_strength_balance="0.3" production_balance="0.5" num_settlements="3"/>
<faction_attitude want_peace="true" want_be_protect="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.75" free_strength_balance="0.75"/>
<faction_attitude want_peace="true" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED AND LALST SETTLEMENT, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="0.8" free_strength_balance="0.8" num_settlements="3"/>
<faction_attitude want_peace="true" want_be_protect="true" continue="false"/>
</decision_entry>
<!--
DECIDE WHO TO INVADE
-->
<!--
DECIDE WHO TO INVADE
-->
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="1.0"/>
<max_entry is_neighbour="true" frontline_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="2.0"/>
<max_entry is_neighbour="true" frontline_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF STRONGER ON FRONTLINE, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" frontline_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="1.0"/>
<max_entry is_neighbour="true" military_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="2.0"/>
<max_entry is_neighbour="true" military_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF MORE POWERFUL MILITARY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" military_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET AT WAR WITH LOTS OF FACTIONS, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_num_enemies="3"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="1.0"/>
<max_entry is_neighbour="true" production_balance="2.0"/>
<faction_attitude invade_priority="25" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="2.0"/>
<max_entry is_neighbour="true" production_balance="3.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUT PRODUCE THEM, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" production_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE AGAINST, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" has_alliance_against="true"/>
<max_entry is_neighbour="true" has_alliance_against="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="1.0"/>
<max_entry is_neighbour="true" alliance_military_balance="2.0"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="2.0"/>
<max_entry is_neighbour="true" alliance_military_balance="3.0"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIANCE MILITARY STRONGER, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" alliance_military_balance="3.0"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.75"/>
<max_entry is_neighbour="true" faction_standing="-0.5"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.5"/>
<max_entry is_neighbour="true" faction_standing="-0.25"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF DISLIKE FACTION, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="-0.25"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF UNTRUSTOWRTHY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" global_standing="0.5"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" stance="AtWar"/>
<max_entry is_neighbour="true" stance="AtWar"/>
<faction_attitude invade_priority="150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_human="true"/>
<max_entry is_neighbour="true" target_human="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY HARD, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" difficulty="hard"/>
<max_entry is_neighbour="true" difficulty="hard"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY VERY HARD HARD, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" difficulty="very_hard"/>
<max_entry is_neighbour="true" difficulty="very_hard"/>
<faction_attitude invade_priority="150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKEST NEIGHBOUR, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" target_weakest_neighbour="true"/>
<max_entry is_neighbour="true" target_weakest_neighbour="true"/>
<faction_attitude invade_priority="50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY ENEMY, INCREASE INVADE PRIORITY
-->
<min_entry is_neighbour="true" trusted_ally_enemy="true"/>
<max_entry is_neighbour="true" trusted_ally_enemy="true"/>
<faction_attitude invade_priority="75" continue="true"/>
</decision_entry>
<!--
DECIDE WHO NOT TO INVADE
-->
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="1"/>
<max_entry is_neighbour="true" num_enemies="2"/>
<faction_attitude invade_priority="-100" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="2"/>
<max_entry is_neighbour="true" num_enemies="3"/>
<faction_attitude invade_priority="-150" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ENEMIES, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" num_enemies="3"/>
<max_entry is_neighbour="true"/>
<faction_attitude invade_priority="-200" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKER FRONTLINE, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" frontline_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WEAKER MILITARY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" military_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OUTPRODUCED, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" production_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF GOOD STANDINGS, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" faction_standing="0.35"/>
<max_entry is_neighbour="true" faction_standing="1.0"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTWORTHY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" global_standing="0.4"/>
<max_entry is_neighbour="true" global_standing="1.0"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF LOW FREE STRENGTH VALUE, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" free_strength_balance="0.7"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLY, REDUCE INVADE PRIORITY
-->
<min_entry is_neighbour="true" trusted_ally="true"/>
<max_entry is_neighbour="true" trusted_ally="true"/>
<faction_attitude invade_priority="-50" continue="true"/>
</decision_entry>
<!--
EARLY GAME
-->
<decision_entry>
<!--
IF EARLY GAME, INVADE NONE
-->
<min_entry stance="Neutral"/>
<max_entry stance="Neutral" turn_number="10"/>
<faction_attitude can_force_invade="false" invade="invade_none" continue="false"/>
</decision_entry>
<!--
INVADES FOR NEIGHBOURS
-->
<decision_entry>
<!--
IF NEIGHBOUR AND WEAKER FRONTLINE > INVADE BUILDUP
-->
<min_entry is_neighbour="true" frontline_balance="0.1"/>
<max_entry is_neighbour="true" frontline_balance="0.9"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TRUSTED ALLYS ENEMY AND NOT AT WAR > INVADE BUILDUP
-->
<min_entry is_neighbour="true" trusted_ally_enemy="true"/>
<max_entry is_neighbour="true" trusted_ally_enemy="true"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR > INVADE BUILDUP
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude invade="invade_buildup" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND HE IS SUPERIOR > INVADE OPPORTUNISTIC
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" military_balance="0.9" free_strength_balance="0.9"/>
<faction_attitude invade="invade_opportunistic" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND SUPERIOR > INVADE IMMEDIATE
-->
<min_entry stance="AtWar" is_neighbour="true" frontline_balance="1.5"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="100.0"/>
<faction_attitude invade="invade_immediate" continue="true"/>
</decision_entry>
<!--
IF NOT NEIGHBOUR
-->
<decision_entry>
<!--
IF ENEMY OF TRUSTED ALLY > INVADE BUILDUP
-->
<min_entry is_neighbour="false" trusted_ally_enemy="true"/>
<max_entry is_neighbour="false" trusted_ally_enemy="true"/>
<faction_attitude invade="invade_buildup" continue="true" can_force_invade="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR > INVADE BUILDUP
-->
<min_entry stance="AtWar" is_neighbour="false"/>
<max_entry stance="AtWar" is_neighbour="false"/>
<faction_attitude invade="invade_buildup" continue="true" can_force_invade="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR + RESOURCES > INVADE OPPORTUNISTIC
-->
<min_entry stance="AtWar" is_neighbour="false" military_balance="1.1" free_strength_balance="1.1"/>
<max_entry stance="AtWar" is_neighbour="false"/>
<faction_attitude invade="invade_opportunistic" continue="true" can_force_invade="true"/>
</decision_entry>
<!--
SLAVE
-->
<decision_entry>
<!--
IF SLAVE > REALLY WANT TO INVADE FOR QUICK BULDUP OF EMPIRES
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade_priority="20000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES > INVADE OPPORTUNISTIC
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_opportunistic" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND SLIGHTLY SUPERIOR > INVADE OPPORTUNISTIC
-->
<min_entry target_faction="slave" frontline_balance="1.0"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_buildup" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND SUPERIOR > INVADE IMMEDIATE
-->
<min_entry target_faction="slave" frontline_balance="2.0"/>
<max_entry target_faction="slave"/>
<faction_attitude at_war="true" invade="invade_immediate" invade_priority="2000" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVES AND EARLY GAME > INVADE IMMEDIATE
-->
<min_entry target_faction="slave" frontline_balance="1.25"/>
<max_entry target_faction="slave" turn_number="30"/>
<faction_attitude at_war="true" invade="invade_immediate" invade_priority="2000" continue="true"/>
</decision_entry>
</invasion_decisions>
</faction_ai_label>
<!--
/////////////////////////////////////////////////////////////
// SLAVE FACTION AI PARAMS. THEY DON'T REALLY DO ANYTHING //
/////////////////////////////////////////////////////////////
-->
<faction_ai_label name="slave_faction">
<invasion_decisions>
<decision_entry>
<!--
Hopefully make rebels more aggressive
-->
<faction_attitude invade="invade_opportunistic" invade_priority="550"/>
</decision_entry>
<decision_entry>
<!--
Just use defaults
-->
</decision_entry>
</invasion_decisions>
<defend_decisions>
<decision_entry>
<!--
Always try and defend the settlements
-->
<faction_attitude defense="defend_fortified"/>
</decision_entry>
</defend_decisions>
</faction_ai_label>
</root>
And here's my diplomacy file:
Bookmarks