-
Notifications
You must be signed in to change notification settings - Fork 1
/
descr_campaign_ai_db.xml
10288 lines (8978 loc) · 358 KB
/
descr_campaign_ai_db.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<root>
<!-- MWY AI V0.9 -->
<!-- Errors Corrected by TheSavage 1/29/09 -->
<!--
// 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="1500"/> // 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.2"/>
<trusted_ally_target_fs_threshold float="0.2"/>
<trusted_ally_target_human_fs_threshold float="0.4"/>
<trusted_ally_gs_threshold float="-0.2"/>
<trusted_ally_target_gs_threshold float="-0.2"/>
<trusted_ally_enemy_auto_war bool="false"/>
<use_cheat_overrides bool="false"/>
<invade_priority_fs_modifier float="-500.0"/>
<invade_priority_gs_modifier float="-500.0"/>
<invade_priority_assistance_offset int="500"/>
<invade_priority_min int="400"/>
<invade_priority_max int="2000"/>
<!--
///////////////////////////////////////
// DEFAULT AI PARAMS. DO NOT REMOVE //
///////////////////////////////////////
-->
<faction_ai_label name="default">
<!-- SSHIP AI default -->
<defend_decisions>
<!--
PEACE WITH NEIGHBOURS
-->
<decision_entry>
<!--
IF AT WAR, DEFAULT IS FALSE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude want_peace="false" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, REBELS DEFAULT IS FALSE
-->
<min_entry stance="AtWar" target_faction="slave"/>
<max_entry stance="AtWar" target_faction="slave"/>
<faction_attitude want_peace="false" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED MILITARY BALANCE, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" military_balance="0.15"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND 2 OR MORE ENEMIES, MILITARY BALANCE NOT GREAT, FREE STRENGTH NOT GOOD, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true" num_enemies="2"/>
<max_entry stance="AtWar" is_neighbour="true" target_num_enemies="1" free_strength_balance="1.0" military_balance="2.5"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND 2 OR MORE ENEMIES, MILITARY BALANCE NOT GREAT, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true" num_enemies="2"/>
<max_entry stance="AtWar" is_neighbour="true" target_num_enemies="3" military_balance="2.5"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND 2 OR MORE ENEMIES, FEW SETTLEMENTS, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true" num_enemies="2"/>
<max_entry stance="AtWar" is_neighbour="true" num_settlements="6" military_balance="1.0"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
WEAKER MILITARY, 10% CHANCE OF WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true" num_enemies="1" rand="0.12"/>
<max_entry stance="AtWar" is_neighbour="true" military_balance="1.0" rand="0.22"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
NON-HATED FACTION, 20% CHANCE OF WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true" num_enemies="1" faction_standing="-0.3" rand="0.67"/>
<max_entry stance="AtWar" is_neighbour="true" rand="0.87"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
NON-HATED FACTION, HUMAN, 5% CHANCE OF WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true" target_human="true" num_enemies="1" faction_standing="-0.6" rand="0.72"/>
<max_entry stance="AtWar" is_neighbour="true" target_human="true" num_enemies="1" rand="0.77"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
NON-HATED FACTION, AI, WANT PEACE (SIMULATED PEACE AGREEMENT OVER TIME)
-->
<min_entry stance="AtWar" is_neighbour="true" target_human="false" faction_standing="-0.5"/>
<max_entry stance="AtWar" is_neighbour="true" target_human="false"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, TARGET HAS TOO MANY ENEMIES, IS NOT HATED, IS THE AI, SIMULATE PEACE AGREEMENT
-->
<min_entry stance="AtWar" is_neighbour="true" target_human="false" target_num_enemies="4"/>
<max_entry stance="AtWar" is_neighbour="true" target_human="false" faction_standing="-0.8"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND TARGET GLOBAL STANDING IS TOO BAD, DONT WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" target_global_standing="-0.75"/>
<faction_attitude want_peace="false" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF THEY SURROUNDED US, DONT WANT PEACE
-->
<min_entry stance="AtWar" num_enemies="1" target_weakest_neighbour="true" strongest_neighbour="true" borders_all_our_regions="true"/>
<max_entry stance="AtWar" num_enemies="1" target_weakest_neighbour="true" strongest_neighbour="true" borders_all_our_regions="true"/>
<faction_attitude want_peace="false" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR HE HAS TWO ENEMIES, WE ARE NOT COMPLETELY SCREWED, DONT WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true" target_num_enemies="2" military_balance="0.66"/>
<max_entry stance="AtWar" is_neighbour="true" num_enemies="1"/>
<faction_attitude want_peace="false" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND VASTLY OUTNUMBERED, WANT BE PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" target_religion="pagan"/>
<max_entry stance="AtWar" is_neighbour="true" military_balance="0.15" free_strength_balance="1.0" num_settlements="3" target_religion="pagan"/>
<faction_attitude want_peace="true" want_be_protect="true" defense="defend_deep" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED, WANT BE PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" rand="0.65"/>
<max_entry stance="AtWar" is_neighbour="true" military_balance="0.15" free_strength_balance="1.0" num_settlements="2"/>
<faction_attitude want_peace="true" want_be_protect="true" defense="defend_deep" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUTNUMBERED AND LAST SETTLEMENT, WANT BE PROTECT
-->
<min_entry stance="AtWar" is_neighbour="true" rand="0.65"/>
<max_entry stance="AtWar" is_neighbour="true" military_balance="0.25" free_strength_balance="1.0" num_settlements="1"/>
<faction_attitude want_peace="true" want_be_protect="true" defense="defend_deep" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUR GLOBAL STANDING IS TOO BAD, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" global_standing="-0.5"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUR GLOBAL STANDING IS TOO HIGH, DONT WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true" global_standing="-0.1"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude want_peace="false" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND OUR FRONTLINE IS SUPERIOR, DONT WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true" frontline_balance="1.5"/>
<max_entry stance="AtWar" is_neighbour="true" frontline_balance="50.0"/>
<faction_attitude want_peace="false" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND 3 OR MORE ENEMIES, MILITARY BALANCE NOT GREAT, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="true" num_enemies="3" faction_standing="-0.8"/>
<max_entry stance="AtWar" is_neighbour="true"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<!--
END PEACE WITH NEIGHBOURS
-->
<!--
RANDOM CHANCE OF ALLIANCES
-->
<decision_entry>
<min_entry rand="0.1"/>
<max_entry rand="0.125"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
WE ONLY WANT FEW ALLIES
-->
<min_entry has_alliance_against="true"/>
<max_entry has_alliance_against="true"/>
<faction_attitude pts_alliance="-2" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF THEY SURROUNDED US, DONT WANT TO ALLY
-->
<min_entry target_weakest_neighbour="true" strongest_neighbour="true" borders_all_our_regions="true"/>
<max_entry target_weakest_neighbour="true" strongest_neighbour="true" borders_all_our_regions="true"/>
<faction_attitude want_ally="false" pts_alliance="-10" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NON-NEIGHBOUR, USUALLY DONT WANT TO ALLY
-->
<min_entry is_neighbour="false"/>
<max_entry is_neighbour="false"/>
<faction_attitude pts_alliance="-3" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE DONT LIKE THEM, LESS LIKELY TO ALLY
-->
<max_entry faction_standing="-0.8"/>
<faction_attitude pts_alliance="-1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE DONT LIKE THEM, LESS LIKELY TO ALLY
-->
<max_entry faction_standing="-0.6"/>
<faction_attitude pts_alliance="-1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE DONT LIKE THEM, LESS LIKELY TO ALLY
-->
<max_entry faction_standing="-0.4"/>
<faction_attitude pts_alliance="-1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE DONT LIKE THEM, LESS LIKELY TO ALLY
-->
<max_entry faction_standing="-0.2"/>
<faction_attitude pts_alliance="-1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE DONT LIKE THEM, LESS LIKELY TO ALLY
-->
<max_entry faction_standing="0.0"/>
<faction_attitude pts_alliance="-1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE DONT LIKE THEM, LESS LIKELY TO ALLY
-->
<max_entry faction_standing="0.4"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE LIKE THEM, MORE LIKELY TO ALLY
-->
<min_entry faction_standing="0.6"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE LIKE THEM, MORE LIKELY TO ALLY
-->
<min_entry faction_standing="0.8"/>
<faction_attitude pts_alliance="2" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF THEY LIKE US, MORE LIKELY TO ALLY
-->
<min_entry target_faction_standing="0.6"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE HAVE AN ENEMY, WANT NEARBY ALLIES
-->
<min_entry stance="Neutral" num_enemies="1"/>
<max_entry stance="Neutral"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE HAVE 2 ENEMIES, WANT NEARBY ALLIES
-->
<min_entry stance="Neutral" num_enemies="2"/>
<max_entry stance="Neutral"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE HAVE MANY ENEMIES, WANT NEARBY ALLIES
-->
<min_entry stance="Neutral" num_enemies="3"/>
<max_entry stance="Neutral"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NEIGHBOUR, WE ARE SMALL, WANT AN ALLY
-->
<min_entry is_neighbour="true" trusted_ally_enemy="false"/>
<max_entry is_neighbour="true" num_settlements="2" trusted_ally_enemy="false"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NEIGHBOUR, WE ARE SMALL, WANT A STRONGER ALLY
-->
<min_entry is_neighbour="true" trusted_ally_enemy="false"/>
<max_entry is_neighbour="true" num_settlements="2" military_balance="0.2" trusted_ally_enemy="false"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NEIGHBOUR, HE IS WAY STRONGER, WANT TO ALLY
-->
<min_entry stance="Neutral" is_neighbour="true" trusted_ally_enemy="false"/>
<max_entry stance="Neutral" military_balance="0.25" trusted_ally_enemy="false"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NEIGHBOUR, WE'RE MEDIUM SIZED, SEARCH FOR SMALLER ALLIES
-->
<min_entry is_neighbour="true" target_weakest_neighbour="true" num_settlements="3"/>
<max_entry is_neighbour="true" target_weakest_neighbour="true" num_settlements="8"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NEIGHBOUR, RIVAL, DONT WANT TO ALLY
-->
<min_entry is_neighbour="true" strongest_neighbour="true" military_balance="0.5"/>
<max_entry military_balance="1.5" num_enemies="2"/>
<faction_attitude pts_alliance="-2" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NON-NEIGHBOUR, GETTING TOO STRONG, ALLY AGAINST
-->
<min_entry is_neighbour="false"/>
<max_entry military_balance="0.25"/>
<faction_attitude pts_alliance="-5" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NON-NEIGHBOUR, EQUAL POWER, MORE LIKELY TO ALLY (EXCLUDE EARLY GAME FOR VARIOUS REASONS)
-->
<min_entry turn_number="15" is_neighbour="false" military_balance="0.8" trusted_ally_enemy="false"/>
<max_entry military_balance="1.2" trusted_ally_enemy="false"/>
<faction_attitude pts_alliance="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF FACTION TO OUTLIVE, LESS LIKELY TO ALLY
-->
<min_entry is_target_faction_to_outlive="true"/>
<max_entry is_target_faction_to_outlive="true"/>
<faction_attitude pts_alliance="-2" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED, BAD RELATIONS, CANCEL ALLIANCE
-->
<min_entry stance="Allied" num_turns_allied="10"/>
<max_entry stance="Allied" faction_standing="-0.2"/>
<faction_attitude want_ally="false" pts_alliance="-10" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OLD ALLIANCE, NO GOOD RELATIONS ANYMORE, CANCEL ALLIANCE
-->
<min_entry stance="Allied" num_turns_allied="20"/>
<max_entry stance="Allied" faction_standing="0.2"/>
<faction_attitude want_ally="false" pts_alliance="-15" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF OLD ALLIANCE, NO GOOD RELATIONS ANYMORE, CANCEL ALLIANCE
-->
<min_entry stance="Allied" num_turns_allied="30"/>
<max_entry stance="Allied" faction_standing="0.4"/>
<faction_attitude want_ally="false" pts_alliance="-20" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF ALLIED, NO OTHER ENEMIES, NEIGHBOUR, NOT OUTNUMBERED, NOT PERFECT RELATIONS, CANCEL ALLIANCE
-->
<min_entry stance="Allied" num_turns_allied="10" is_neighbour="true" military_balance="0.5"/>
<max_entry stance="Allied" faction_standing="0.5" num_enemies="0" is_neighbour="true"/>
<faction_attitude want_ally="false" pts_alliance="-15" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY EASY, DONT WANT TO ALLY
-->
<min_entry is_neighbour="true" target_human="true" difficulty="easy"/>
<max_entry is_neighbour="true" target_human="true" difficulty="easy"/>
<faction_attitude pts_alliance="0" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY MEDIUM, DONT WANT TO ALLY
-->
<min_entry is_neighbour="true" target_human="true" difficulty="medium"/>
<max_entry is_neighbour="true" target_human="true" difficulty="medium"/>
<faction_attitude pts_alliance="-1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY HARD, DONT WANT TO ALLY
-->
<min_entry is_neighbour="true" target_human="true" difficulty="hard"/>
<max_entry is_neighbour="true" target_human="true" difficulty="hard"/>
<faction_attitude pts_alliance="-2" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF TARGET HUMAN AND DIFFICULTY VERY HARD, DONT WANT TO ALLY
-->
<min_entry is_neighbour="true" target_human="true" difficulty="very_hard"/>
<max_entry is_neighbour="true" target_human="true" difficulty="very_hard"/>
<faction_attitude pts_alliance="-3" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, NO ALLIANCE, ALLY AGAINST
-->
<min_entry stance="AtWar" is_neighbour="true" strongest_neighbour="true" has_alliance_against="false" rand="0.1"/>
<max_entry stance="AtWar" is_neighbour="true" strongest_neighbour="true" has_alliance_against="false" rand="0.15"/>
<faction_attitude alliance_against="1" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF SLAVE, DON'T ALLY AGAINST
-->
<min_entry target_faction="slave"/>
<max_entry target_faction="slave"/>
<faction_attitude alliance_against="-1" continue="true"/>
</decision_entry>
<!--
PEACE WITH NON NEIGHBOURS
-->
<decision_entry>
<!--
IF AT WAR AND NOT A NEIGHBOUR, IF ENEMY OF TRUSTED ALLY, NO ENEMIES, DEFAULT DONT WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="false" trusted_ally_enemy="true"/>
<max_entry stance="AtWar" is_neighbour="false" trusted_ally_enemy="true" faction_standing="-0.1"/>
<faction_attitude want_peace="false" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND NOT A NEIGHBOUR, GLOBAL STANDING IS TOO LOW, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="false"/>
<max_entry stance="AtWar" is_neighbour="false" global_standing="-0.4"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND NOT A NEIGHBOUR, WE HAVE AN ENEMY, WE ARE NOT BIG, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="false" num_enemies="1"/>
<max_entry stance="AtWar" is_neighbour="false" num_settlements="12"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND NOT A NEIGHBOUR, DECENT RELATIONS, RANDOMISE 25% CHANCE TO WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="false" rand="0.1" faction_standing="-0.2" trusted_ally_enemy="false"/>
<max_entry stance="AtWar" is_neighbour="false" rand="0.35" trusted_ally_enemy="false"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND NOT A NEIGHBOUR, 1 ENEMY, POOR RELATIONS, RANDOMISE 75% CHANCE TO WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="false" rand="0.10" num_enemies="1" faction_standing="-0.4" trusted_ally_enemy="false"/>
<max_entry stance="AtWar" is_neighbour="false" rand="0.85" num_enemies="1" trusted_ally_enemy="false"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND NOT A NEIGHBOUR, IF HUMAN, 25% CHANCE TO REVERSE DECISION ABOVE TO WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="false" rand="0" target_human="true"/>
<max_entry stance="AtWar" is_neighbour="false" rand="0.2" target_human="true" num_enemies="2" global_standing="-0.5"/>
<faction_attitude want_peace="false" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND NOT A NEIGHBOUR, GOOD RELATIONS, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="false" faction_standing="0.4"/>
<max_entry stance="AtWar" is_neighbour="false" faction_standing="1.0"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR AND NOT A NEIGHBOUR, TOO MANY ENEMIES, WANT PEACE
-->
<min_entry stance="AtWar" is_neighbour="false" num_enemies="3"/>
<max_entry stance="AtWar" is_neighbour="false"/>
<faction_attitude want_peace="true" continue="true"/>
</decision_entry>
<!--
END PEACE WITH NON NEIGHBOURS
-->
<!--
DEFEND
-->
<decision_entry>
<!--
THEY LOVE US > DEFEND MINIMAL
-->
<min_entry is_neighbour="true" target_faction_standing="0.5"/>
<max_entry is_neighbour="true"/>
<faction_attitude defense="defend_minimal" continue="true"/>
</decision_entry>
<decision_entry>
<!--
THEY LIKE US > DEFEND NORMAL
-->
<min_entry is_neighbour="true" target_faction_standing="-0.4"/>
<max_entry is_neighbour="true" target_faction_standing="0.5"/>
<faction_attitude defense="defend_normal" continue="true"/>
</decision_entry>
<decision_entry>
<!--
THEY DONT LIKE US > DEFEND FORTIFIED
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" target_faction_standing="-0.4"/>
<faction_attitude defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
WE DONT LIKE THEM, NO ENEMIES > DEFEND FRONTLINE
-->
<min_entry is_neighbour="true"/>
<max_entry is_neighbour="true" faction_standing="-0.5" num_enemies="0"/>
<faction_attitude defense="defend_frontline" 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.15" 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.5" is_neighbour="true"/>
<max_entry stance="AtWar" is_neighbour="true" num_enemies="1"/>
<faction_attitude at_war="true" defense="defend_frontline" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR WITH LOTS OF FACTIONS, DEFEND FORTIFIED AGAINST STRONGEST
-->
<min_entry stance="AtWar" is_neighbour="true" strongest_neighbour="true" num_enemies="2"/>
<max_entry stance="AtWar" is_neighbour="true" strongest_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND NOT AT WAR, GOOD RELATIONS > DEFEND NORMAL
-->
<min_entry target_human="true" is_neighbour="true" target_faction_standing="0.0"/>
<max_entry target_human="true" is_neighbour="true"/>
<faction_attitude defense="defend_normal" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND NOT AT WAR, BAD RELATIONS > DEFEND FORTIFIED
-->
<min_entry target_human="true" is_neighbour="true"/>
<max_entry target_human="true" is_neighbour="true" target_faction_standing="0.0"/>
<faction_attitude defense="defend_fortified" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF HUMAN AND AT WAR, WEAKER MILITARY > DEFEND FORTIFIED
-->
<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_fortified" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF WE HAVE A TERRIBLE REPUTATION, NEIGHBOUR, DEFEND NORMAL
-->
<min_entry is_neighbour="true" target_human="false" stance="Neutral"/>
<max_entry is_neighbour="true" target_human="false" stance="Neutral" global_standing="-0.6"/>
<faction_attitude defense="defend_deep" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF AT WAR, WE ARENT CONNECTED, DEFEND NORMAL
-->
<min_entry stance="AtWar" borders_all_our_regions="false" is_neighbour="true"/>
<max_entry stance="AtWar" borders_all_our_regions="false" is_neighbour="true"/>
<faction_attitude at_war="true" defense="defend_normal" continue="true"/>
</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>
<decision_entry>
<!--
IF NOT NEIGHBOUR, WE DONT LIKE THEM > DEFEND NORMAL
-->
<min_entry is_neighbour="false"/>
<max_entry is_neighbour="false" faction_standing="-0.75"/>
<faction_attitude defense="defend_normal" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF WE HAVE A TERRIBLE REPUTATION, NON-NEIGHBOUR, DEFEND MINIMAL
-->
<min_entry is_neighbour="false" target_human="false" stance="Neutral"/>
<max_entry is_neighbour="false" target_human="false" stance="Neutral" global_standing="-0.5"/>
<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_normal" want_peace="false" continue="false"/>
</decision_entry>
<decision_entry>
<!--
IF MONGOLS, NOT YET SPAWNED > DONT WANT PEACE, DEFEND MINIMAL
-->
<min_entry target_faction="mongols"/>
<max_entry target_faction="mongols" turn_number="150"/>
<faction_attitude defense="defend_minimal" want_peace="false" continue="true"/>
</decision_entry>
</defend_decisions>
<invasion_decisions>
<!--
DECIDE WHO TO INVADE - NEIGHBOURS
-->
<decision_entry>
<!--
IF EARLY GAME, NO ENEMIES, FOCUS ON REBELS
-->
<min_entry is_neighbour="true" stance="AtWar" target_faction="slave" num_enemies="0" turn_number="0"/>
<max_entry is_neighbour="true" stance="AtWar" target_faction="slave" num_enemies="0" turn_number="10"/>
<faction_attitude invade_priority="1500" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NO ENEMIES, FOCUS ON REBELS
-->
<min_entry is_neighbour="true" target_faction="slave" num_enemies="0"/>
<max_entry is_neighbour="true" target_faction="slave" num_enemies="0"/>
<faction_attitude invade_priority="750" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NO ENEMIES, DONT FOCUS ON REBELS
-->
<min_entry is_neighbour="true" target_faction="slave" num_enemies="1"/>
<max_entry is_neighbour="true" target_faction="slave"/>
<faction_attitude invade_priority="-750" continue="true"/>
</decision_entry>
<decision_entry>
<!--
IF NEIGHBOUR, DEFAULT INVADE PRIORITY
-->