Results 1 to 23 of 23

Thread: campaign_db_ai

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Relentless Bughunter Senior Member FactionHeir's Avatar
    Join Date
    Dec 2006
    Location
    London, UK
    Posts
    8,115

    Default campaign_db_ai

    Hi,

    I've been taking a second look after my first modifications on this file and noticed that at the start, following is noted:

    Spoiler Alert, click show to read: 

    <root>
    <!--
    <trusted_ally_fs_threshold float="0.8"/> // min threshold for how much we like the target faction to consider them a trusted ally
    <trusted_ally_target_fs_threshold float="0.8"/> // min threshold for how much does the target faction like us to consider them a trusted ally
    <trusted_ally_gs_threshold float="0.2"/> // min threshold for how trustworthy is the target faction to consider them a trusted ally

    <faction_ai_label name="default"> :: The label for a following set of campaign ai faction parameters

    <invasion_decisions> :: List of ai invasion 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 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"


    What I don't quite understand is whether for example
    is_neighbour
    has to always be in the max entry section if its true and in the min entry if its false? Because by default, the devs somehow have it sometimes in min sometimes in max regardless of value. That is really confusing me and I don't know whether it actually matters where its located.
    Want gunpowder, mongols, and timurids to appear when YOU do?
    Playing on a different timescale and never get to see the new world or just wanting to change your timescale?
    Click here to read the solution
    Annoyed at laggy battles? Check this thread out for your performance needs
    Got low fps during siege battles in particular? This tutorial is for you
    Want to play M2TW as a Vanilla experience minus many annoying bugs? Get VanillaMod Visit the forum Readme
    Need improved and faster 2H animations? Download this! (included in VanillaMod 0.93)

  2. #2
    Member Member Re Berengario I's Avatar
    Join Date
    Nov 2003
    Location
    Italy
    Posts
    336

    Default Re: campaign_db_ai

    Example:
    <max_entry is_neighbour="false" />
    <max_entry is_neighbour="true" />

    The game selects ALL the factions

    <max_entry is_neighbour="true" />
    <max_entry is_neighbour="true" />

    The game selects only the factions that share borders with the actual faction processed

    <max_entry is_neighbour="false" />
    <max_entry is_neighbour="false" />

    The game selects only the factions that don't share borders with the actual faction processed

  3. #3
    Relentless Bughunter Senior Member FactionHeir's Avatar
    Join Date
    Dec 2006
    Location
    London, UK
    Posts
    8,115

    Default Re: campaign_db_ai

    Ermm concerning your post, do you mean
    <min_entry is_neighbour="false" />
    <max_entry is_neighbour="false" />

    for instance or really a duplication?
    Also, how come the default file has for example only the condition under either max or min but never under both?
    Spoiler Alert, click show to read: 

    <decision_entry>
    <!--
    if not our neighbour, and we have any settlements, and we are at the start of the game >>> minimal defense
    -->
    <min_entry num_settlements="1"/>
    <max_entry stance="Neutral" is_neighbour="false" turn_number="30"/>
    <faction_attitude defense="defend_minimal"/>
    </decision_entry>
    Want gunpowder, mongols, and timurids to appear when YOU do?
    Playing on a different timescale and never get to see the new world or just wanting to change your timescale?
    Click here to read the solution
    Annoyed at laggy battles? Check this thread out for your performance needs
    Got low fps during siege battles in particular? This tutorial is for you
    Want to play M2TW as a Vanilla experience minus many annoying bugs? Get VanillaMod Visit the forum Readme
    Need improved and faster 2H animations? Download this! (included in VanillaMod 0.93)

  4. #4
    Member Member Re Berengario I's Avatar
    Join Date
    Nov 2003
    Location
    Italy
    Posts
    336

    Default Re: campaign_db_ai

    Quote Originally Posted by FactionHeir
    Ermm concerning your post, do you mean
    <min_entry is_neighbour="false" />
    <max_entry is_neighbour="false" />

    for instance or really a duplication?
    Also, how come the default file has for example only the condition under either max or min but never under both?
    Spoiler Alert, click show to read: 

    <decision_entry>
    <!--
    if not our neighbour, and we have any settlements, and we are at the start of the game >>> minimal defense
    -->
    <min_entry num_settlements="1"/>
    <max_entry stance="Neutral" is_neighbour="false" turn_number="30"/>
    <faction_attitude defense="defend_minimal"/>
    </decision_entry>
    Because the others are already set as default as you listed in your first post. I usually rewrite them for my own practical logical understanding.

  5. #5
    Relentless Bughunter Senior Member FactionHeir's Avatar
    Join Date
    Dec 2006
    Location
    London, UK
    Posts
    8,115

    Default Re: campaign_db_ai

    Ahhhh now I understand what you mean.
    is_neighbour is set to false by default in min and true by default in max and you basically have to set it to false in max and true in min in the conditions.
    Want gunpowder, mongols, and timurids to appear when YOU do?
    Playing on a different timescale and never get to see the new world or just wanting to change your timescale?
    Click here to read the solution
    Annoyed at laggy battles? Check this thread out for your performance needs
    Got low fps during siege battles in particular? This tutorial is for you
    Want to play M2TW as a Vanilla experience minus many annoying bugs? Get VanillaMod Visit the forum Readme
    Need improved and faster 2H animations? Download this! (included in VanillaMod 0.93)

  6. #6
    Relentless Bughunter Senior Member FactionHeir's Avatar
    Join Date
    Dec 2006
    Location
    London, UK
    Posts
    8,115

    Default Re: campaign_db_ai

    OK maybe i don't understand you properly.

    The game sets is_neighbour = true by default under max.
    In this code:
    <decision_entry>
    <!--
    Not interested in factions that are not our neighbour, use defaults, may be overridden by forced/naval attacks
    -->
    <max_entry is_neighbour="false"/>
    </decision_entry>

    it then sets it to false under max too, so according to your above description, this would result in all factions being processed, but that would mean this section is going against what it should be doing?!?


    [edit]
    OK, I just gave it a bit more thought. So in default,
    min -> is_neighbour = false
    max -> is_neighbour = true

    in code:
    max -> is_neighbour = false

    yielding
    min AND max -> is_neighbour = false.

    So your above first posted code was actually meant to read min and then max instead of both!
    Last edited by FactionHeir; 04-04-2007 at 21:58.
    Want gunpowder, mongols, and timurids to appear when YOU do?
    Playing on a different timescale and never get to see the new world or just wanting to change your timescale?
    Click here to read the solution
    Annoyed at laggy battles? Check this thread out for your performance needs
    Got low fps during siege battles in particular? This tutorial is for you
    Want to play M2TW as a Vanilla experience minus many annoying bugs? Get VanillaMod Visit the forum Readme
    Need improved and faster 2H animations? Download this! (included in VanillaMod 0.93)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO