PDA

View Full Version : Situations for descr_campaign_ai_db



Lusted
12-06-2006, 19:15
Okay this is a little list im working on where im trying to come up with all the different situations based on the variables at the top of the descr_campaign_ai_db.xml file. This is a work in progress, and once i've worked out them all, or a good amount, ill try to work out how the ai should behave in each situation, and code it all into the file.

Here are the variables(its a long list):

<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 traget 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
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

<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"
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"

<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)
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
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
pts_desire="0" :: points total for measuring our desire for this faction's territory
pts_alliance="0" :: points total for measuring how much we want to be allies with these people
can_force_invade="true" :: can naval or forced invasion settings overwrite invade parameters
</decision_entry>

So as you can see im going to have my work cut out working out all the different possible variations for situations, and then to code it all in. Any help would be most appreicated.

Re Berengario I
12-06-2006, 19:45
Great work! Thanks a lot :beam:

Just a question though, do you already tried to test can_force_invade="true" to see if this allow the AI factions to use naval invasions? I'm pretty bored to death to see Sardinia and Corsica still rebel after 200 turns (I will give them to Pisa faction in my mod but this another matter ~:cool:)

opppsss... another question comes to mind... is there some command to force the AI to target a province to be conquered or we have to resume to scripting? It's an important matter because it will make the AI more focused on the victory conditions and not just act like a comedy Spectre Boss "I WANNA RULE ALL THE WORLDDDD! Muhahahahahaha!"

Epistolary Richard
12-06-2006, 20:19
I'm afraid I can't answer that for this file, but I can tell you that there are hidden resources for crusade, jihad and horde targets which make these settlements more likely to be hit by the above.

Factions are also more likely to attack slave settlements - don't know if that helps.

Re Berengario I
12-06-2006, 21:26
I tried to gave Sardinia and Corsica as victory conditions to both Milan and Sicily, created a landbridge between Corsica and Tuscany, no way... they were still in rebel hands after 200 turns. I know the crusade and jihad hidden resources but it's seems a bit silly to me to see a crusade to take Sardinia.

I think it's a matter of AI not being able to do naval invasions properly and/or not able to find a path to use the landbridge, but I think I'm hijacking this thread and maybe a new one it's more suitable to expand our brainstorming about it (I remember an old and very informative thread about this problem in RTW).

Lusted
12-06-2006, 21:51
Just a question though, do you already tried to test can_force_invade="true" to see if this allow the AI factions to use naval invasions?

That forces the ai to invade a faction in certain circumnstances. Remember this is all interaction between nations.

Epistolary Richard
12-06-2006, 21:57
{tangent}
I think you're referring to this thread:
https://forums.totalwar.org/vb/local_links.php?catid=77&linkid=69

But yes, I think if someone has an in-depth look at the M2 map in a similar way then that would be very useful. Perhaps even release an optimised vanilla map which doesn't fall foul of such pitfalls.{/tangent}

Lusted
12-07-2006, 11:10
Here is a list of all the changes i hope to make to the file, as you can see i've got a lot to do.

-long period of alliances - done
-ceasfires last longer - done
-will attack the rebel provinces when stronger - done
-will attack faction if few numbers of enemies - sort of done
-will help out allies more - done
-will offer peace if being beaten in war
-will offer to become vassal if being badly beaten in war
-will try to make enemy faction vassal if being it badly
-will defend provinces better
-need to include all the entries from the vanilla file, but suitably modified
-include version of entries for dealing with trusted allies
-include version of entries for dealing with factions with low/high global rep
-include versions of the entries for catholic factions,
and catholic factions dealing with excommunicated factions(under catholic section)
-add in special ones for papal states
-add in new ai label for mongols/timurids so they are as aggressive as they should be.