Page 1 of 2 12 LastLast
Results 1 to 20 of 34

Thread: Common Campaign AI issues with SavageAI SS6.3

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Common Campaign AI issues with SavageAI SS6.3

    Watching the AI at work is sometimes quite frustrating. One sees it doing things it really shouldn't but one feels powerless to do much about it.

    At least one of the issues was talked about before but I don't think it ever got tackled as nobody felt competent in dealing with the CAI files.

    So - a shout-out for people who want to seriously get down and dirty with the CAI. I've been using TheSavage's in SS6.3 - I expect others have their own preferences. It's possible that each has strengths and weaknesses - and maybe some fresh eyes might be able to sort out any problems.

    These seem to me to be some issues that need sorting (all from TheSavage's CAI):

    1) Crusading and jihad armies making ceasefires with target faction

    2) Fleets attacking coasts far away from home regions. (not even blockading)

    3) Pope issuing mission to blockade port and then cancelling when the owner of the port hasn't changed.

    4) Christian factions ignoring the consequences of being ex-communicated - results in them getting clobbered by many other factions.

    5) Diplomats not negotiating trade agreements etc even when next to relevant faction.

    6) Factions starting wars with a new faction when they are losing to other faction/s.

    7) Diplomats gaining trade relations same turn as declaring war with same faction.

    8) Slave faction being too passive when in possession of big armies.

    ----
    about the only guidance I have is an old text by Cavalry Cmdr
    http://medieval2.heavengames.com/m2t...ay/index.shtml

    more guidance and input on the subject welcome

    I'll add other issues as they emerge.
    Last edited by Gorrrrrn; October 29, 2010 at 05:54 AM.

  2. #2

    Default Re: Common Campaign AI issues

    1) Crusading and jihad armies making ceasefires with target faction
    I've seen a lot of this one. After the ceasefire the Jihad army just stands still wherever it is.

  3. #3

    Default Re: Common Campaign AI issues

    How about building stack after stack on an island like Cyprus but not building any boats to move them anywhere.
    Veni Vidi Velcro


  4. #4
    Campidoctor
    Join Date
    May 2010
    Location
    Danmark
    Posts
    1,507

    Default Re: Common Campaign AI issues

    I had a trade offer from the Fatimids which I accepted (in the trading screen, it said their priority was "trade").

    The very next thing they did during that same turn was to rush an army into one of my provinces and lay siege.
    The game development business is one of bottomless greed, pitiless cruelty, venal treachery, rampant competition, low politics and boundless personal ambition. New game series are rising, and others are starting their long slide into obscurity and defeat.

  5. #5
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Common Campaign AI issues

    How about building stack after stack on an island like Cyprus but not building any boats to move them anywhere.
    not sure that's a CAI issue - I've written a short script to add to the merchant and priests spawn section that adds a couple of ships to factions that start with ports.
    seems to help move those stuck stacks.

    I've also adjusted the recruit_priority_offset in the EDU to reduce recruitment of heavy cavalry and increase ships.
    if you check the values it's not surprising the AI builds cavalry and not ships.
    --
    I had a trade offer from the Fatimids which I accepted (in the trading screen, it said their priority was "trade").

    The very next thing they did during that same turn was to rush an army into one of my provinces and lay siege.
    Have to agree this pretty daft - it's almost as if the AI wanted to declare war with a diplomat but then decided to get trade agreement.
    and changed its mind next turn.

    (may have been a marginal decision either way?)

    We'd need to do a LTGD trace to see what happened there.
    see excellent article here:

    http://www.twcenter.net/forums/showthread.php?t=193575
    see also:
    http://www.twcenter.net/forums/showthread.php?p=4894922
    Last edited by bɑne; October 28, 2010 at 05:19 PM.

  6. #6
    Campidoctor
    Join Date
    May 2010
    Location
    Danmark
    Posts
    1,507

    Default Re: Common Campaign AI issues

    Quote Originally Posted by Rozanov View Post
    Have to agree this pretty daft - it's almost as if the AI wanted to declare war with a diplomat but then decided to get trade agreement.
    and changed its mind next turn.
    On the same turn

    Also, one cannot declare war with a diplomat.. or... ?

    I'm thinking what happens is:

    AI is angry 5 turns before and send a stack to attack.

    The stack walks towards target...

    Then the AI changes priorities and wants trade. It sends a diplomat but does not issue new orders to the army.

    The army eventually reaches its target and attacks, right after the diplomat made the trade agreement.
    The game development business is one of bottomless greed, pitiless cruelty, venal treachery, rampant competition, low politics and boundless personal ambition. New game series are rising, and others are starting their long slide into obscurity and defeat.

  7. #7
    Maestro Ugo's Avatar Civis
    Join Date
    Oct 2010
    Location
    Zagreb, Croatia
    Posts
    185

    Default Re: Common Campaign AI issues

    Quote Originally Posted by SirRobin View Post
    On the same turn

    Also, one cannot declare war with a diplomat.. or... ?

    I'm thinking what happens is:

    AI is angry 5 turns before and send a stack to attack.

    The stack walks towards target...

    Then the AI changes priorities and wants trade. It sends a diplomat but does not issue new orders to the army.

    The army eventually reaches its target and attacks, right after the diplomat made the trade agreement.
    This sounds like a very reasonable and plausible explanation, I often get a feeling that a faction declared war on me just because a particular army wanted to besiege a particular city of mine. Nothing to do with a great scheme of things and central master-plan employed by the AI faction in question.

    The problem is that I see no way around this, It's been the same (even worst) in RTW, you could make peace with a faction, cashing out big time, and next turn one of the armies would besiege your city. Also, a piece of empirical observation that goes in the same basic direction as your theory: If you are at war with the AI, and make peace, one of the armies might besiege your city on the next turn and cause a war. In the same turn (this is also RTW) one could again agree to a peace deal with the faction, only for the army to besiege a city again and so on... I remember once having this sort of every turn war-peace with the AS playing as Hayasdan in Europa Barbarorum for over 30 turns until the army finally left and the peace lasted.

    It seems that armies have certain priorities and incentives for action regardless of the faction's main "plan". If they see a weak and undefended city, they will attack.

    Tired of rampant corruption? Try ICS - Improved Corruption System for TATW3.1.

  8. #8

    Default Re: Common Campaign AI issues

    What is this Roz?
    Multiple threads.
    Explain it to me that how you can get a better answer here than mod workshop.

  9. #9
    Tears of Destiny's Avatar Senator
    Join Date
    Apr 2010
    Location
    Rice Pudding, Dessert.
    Posts
    1,006

    Default Re: Common Campaign AI issues

    Quote Originally Posted by Ishan View Post
    What is this Roz?
    Multiple threads.
    Explain it to me that how you can get a better answer here than mod workshop.
    Oooooooooooooooooooooh Somebody is in trouble!

  10. #10

    Default Re: Common Campaign AI issues

    with christian factions attacking each other, could we just delete the other christian factions from the Victory Conditions for being destroyed/settlements that belong to christians?
    Don't forget to rep me if you like something I did/ or not lol

    See that green thingy under the Carroburg banner? click it!

    Pwning as the Pope on VH/VH Savage AI SS 6.4!
    http://www.twcenter.net/forums/showthread.php?t=430026


  11. #11
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Common Campaign AI issues

    Explain it to me that how you can get a better answer here than mod workshop.
    Not so much looking for an answer - looking for people who'll assist with trying to work out exactly what's happening with stainless steel specific CAI issues.
    also hope to get some newish peeps involved in looking at CAI in more depth.

    putting something like this in mod workshop means many people won't know about it - and we'll get endless new threads every time someone notices things.

    best to have them all in one place I sez.

  12. #12

    Default Re: Common Campaign AI issues with SavageAI SS6.3

    I think the only guys who can help you one this one are guys who have actually made custom strat AI's like Gracul.
    Or you could've Vmed the link of the thread in the modworkshop to guys like Lusted or Augustus.

    Anyways it's a harmless thread and i'll wait for constructive posting here which i'm sure there will be.

  13. #13

    Default Re: Common Campaign AI issues with SavageAI SS6.3

    Sorry I missed this thread I was away on my honeymoon in Italy. 1 may be fixable. 2 I believe I have fixed, 4 can be fixed im sure, never had a problem with 5? 6 can be tweaked, 7 is tricky because even though they gain trade agreements their faction standing with you might still be to low and this is one of the triggers considered when choosing who to attack. If they attack you after you gain trade agreements and your relations are reasonable then it's a diff story and should be fixed. 8 would almost need to be controlled by the campaign_ai_db file as well with slave as a seperate ai_label and they could be made more aggressive that way.

    I have my own version of Savage AI that I began working on a while ago. Basically tried to make it more aggressive with XAI defense params built into it. XAI is what I use now, I have been modding that for SS for quite some time.







    Quote Originally Posted by Rozanov View Post
    Watching the AI at work is sometimes quite frustrating. One sees it doing things it really shouldn't but one feels powerless to do much about it.

    At least one of the issues was talked about before but I don't think it ever got tackled as nobody felt competent in dealing with the CAI files.

    So - a shout-out for people who want to seriously get down and dirty with the CAI. I've been using TheSavage's in SS6.3 - I expect others have their own preferences. It's possible that each has strengths and weaknesses - and maybe some fresh eyes might be able to sort out any problems.

    These seem to me to be some issues that need sorting (all from TheSavage's CAI):

    1) Crusading and jihad armies making ceasefires with target faction

    2) Fleets attacking coasts far away from home regions. (not even blockading)

    3) Pope issuing mission to blockade port and then cancelling when the owner of the port hasn't changed.

    4) Christian factions ignoring the consequences of being ex-communicated - results in them getting clobbered by many other factions.

    5) Diplomats not negotiating trade agreements etc even when next to relevant faction.

    6) Factions starting wars with a new faction when they are losing to other faction/s.

    7) Diplomats gaining trade relations same turn as declaring war with same faction.

    8) Slave faction being too passive when in possession of big armies.

    ----
    about the only guidance I have is an old text by Cavalry Cmdr
    http://medieval2.heavengames.com/m2t...ay/index.shtml

    more guidance and input on the subject welcome

    I'll add other issues as they emerge.

  14. #14

    Default Re: Common Campaign AI issues with SavageAI SS6.3

    Also, this is for anyone who wants to keep random acts of war down. Try it out let me know how you made out

    (back up your file first)

    1. Open up the Campaign_ai_ab xml with notepad (it's found in your data folder)
    2. Under each ai_label you need to find where it says "decide who not to invade"
    3. Paste this right after it says that for each ai_label


    <decision_entry>
    <!--
    IF GOOD STANDINGS, REDUCE INVADE PRIORITY
    -->
    <min_entry is_neighbour="false" faction_standing="-0.1"/>
    <max_entry is_neighbour="false" faction_standing="0.7"/>
    <faction_attitude invade="invade_none" can_force_invade="false" continue="false"/>
    </decision_entry>

  15. #15
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Common Campaign AI issues with SavageAI SS6.3

    excellent work soulson!

    I've added the element given by soulson above to the savage CAI file.
    I trust I've stuck the text in the correct places.
    Attachment 121366

  16. #16

    Default Re: Common Campaign AI issues with SavageAI SS6.3

    Yes that's it.

  17. #17

    Default Re: Common Campaign AI issues with SavageAI SS6.3

    Heh. To the OP, I have experienced everything you have. I recently had the Crusader States demand a small lump sum of gold and in return they swore not to Attack me (Seljuks). The diplomat said (Ah, thank you very much for your understanding) and then they rush out 3 armies and siege 3 of my cities behind my back in the same turn. Crazy? No. Genius. (At least that was what I hope, but then again, maybe the AI really is just effed)

    Deciphering The Zodiac - Check It Out!

  18. #18
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Common Campaign AI issues with SavageAI SS6.3

    TZH
    did you have any luck sorting out the crusader / jihad ceasefire issues?
    I think that might be our next project.
    here's the relevant mod workshop thread:
    http://www.twcenter.net/forums/showt...66#post1927066

    ----------------------------------------------------------------------------------------------

    One of the biggest problems I find with the Campaign AI file is not being able to see the layout of the various sections.
    XML marker is very good at laying out the code but it merely says "decision entry" for each item.
    It doesn't pick up the user-generated explanations for what each section of decision entries cover.

    So without further ado here's a good example, the Catholic ai faction label setting out the various sections.

    Spoiler Alert, click show to read: 

    Catholic AI sections
    --------------------
    <defend_decisions>
    <!-- DEFEND -->

    <!-- DEFEND v SLAVES -->
    <!-- END DEFEND v SLAVES -->

    <!-- RELIGIOUS DEFEND SETS -->
    <!-- END RELIGIOUS DEFEND SETS -->

    <!-- DEFEND FOR NEIGHBOURS -->
    <!-- END DEFEND FOR NEIGHBOURS -->

    <!-- DEFEND IF NOT NEIGHBOUR -->
    <!-- END DEFEND IF NOT NEIGHBOUR -->
    </defend_decisions>

    <invasion_decisions>
    <!-- SLAVE -->
    <!-- END SLAVE -->

    <!-- FORCED STRATEGIC BACKSTABS AGAINST PLAYER -->
    <!-- END FORCED STRATEGIC BACKSTABS AGAINST PLAYER -->

    <!-- SET FORCE INVADE DEFAULTS -->
    <!-- END SET FORCE INVADE DEFAULTS -->

    <!-- DIPLOMACY -->

    <!-- ALLIANCE DESIRE -->
    <!-- END ALLIANCE DESIRE -->

    <!-- ALLIANCE AGAINST -->
    <!-- END ALLIANCE AGAINST -->

    <!-- PROTECTION -->
    <!-- END PROTECTION -->

    <!-- PEACE WITH NEIGHBOURS -->
    <!-- END PEACE WITH NEIGHBOURS -->

    <!-- PEACE WITH NON NEIGHBOURS -->
    <!-- END PEACE WITH NON NEIGHBOURS -->

    <!-- END DIPLOMACY -->

    <!-- TERMINATE INVASIONS THIS TURN -->
    <!-- END TERMINATE INVASIONS THIS TURN -->

    <!-- DECIDE WHETHER TO STOP FORCE INVADE AND INVADE NONE -->
    <!-- END DECIDE WHETHER TO STOP FORCE INVADE AND INVADE NONE -->

    <!-- DECIDE WHO TO INVADE -->

    <!-- ENCOURAGE AI SUPERPOWERS -->

    <!-- DECIDE WHO NOT TO INVADE -->
    <!-- END DECIDE WHO NOT TO INVADE -->

    <!-- RELIGIOUS INVASION FACTORS -->
    <!-- END RELIGIOUS INVASION FACTORS -->

    <!-- RELIGIOUS INVADE SETS -->
    <!-- END RELIGIOUS INVADE SETS -->

    <!-- INVADES FOR NEIGHBOURS -->
    <!-- END INVADES FOR NEIGHBOURS -->

    <!-- INVADES IF NOT NEIGHBOUR -->
    <!-- END INVADES IF NOT NEIGHBOUR -->
    </invasion_decisions>


    note some of the entries are currently blank.

    If we want to place the decision_entry that Snipafist posted here:
    http://www.twcenter.net/forums/showt...07#post1941607

    Code:
    <decision_entry>
                    <!--
                        if not our neighbour, and we have any settlements, and we are at  war, and they are not a trusted allies enemy, use defaults + want peace
                    -->
                    <min_entry    num_settlements="1" stance="AtWar" target_religion="catholic" target_religion="orthodox"/>
                    <max_entry    is_neighbour="false" trusted_ally_enemy="false"  target_religion="catholic" target_religion="orthodox"  enemy_excommunicated="false"/>
                    <faction_attitude    want_peace="true"/>
                </decision_entry>
    then we know to put it in the Diplomacy section of invade decisions, "PEACE WITH NON NEIGHBOURS"

    (I've removed the num_settlements condition, can't see it adds anything.)

    next up reducing catholic faction's chance of attacking while having "ceasehostilities" mission from pope.
    Last edited by Gorrrrrn; November 17, 2010 at 06:07 PM.

  19. #19
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Common Campaign AI issues with SavageAI SS6.3

    Let's see what the descr_campaign_ai_db.xml has to say about factions with ceasehostilities missions.

    The place to look is in Religious Invasion Factors and Religious Invade Sets.

    One can find the following entries:

    Code:
                <decision_entry>
                    <!--
                        IF CEASE HOSTILITIES, INVADE NONE, CANNOT FORCE INVADE, REDUCE INVADE PRIORITY
                    -->
                    <min_entry    has_ceasehostilities="true" excommunicated="false"/>
                    <max_entry    has_ceasehostilities="true" excommunicated="false"/>
                    <faction_attitude    invade_priority="-400" continue="true"/>
                </decision_entry>
    there's also this if a faction is trustworthy:

    Code:
                <decision_entry>
                    <!--
                        IF CEASE HOSTILITIES AND TRUSTWORTHY > PEACE FOOTING
                    -->
                    <min_entry    has_ceasehostilities="true" global_standing="0.1"/>
                    <max_entry    has_ceasehostilities="true" global_standing="1.0"/>
                    <faction_attitude    can_force_invade="false" invade="invade_none" want_peace="true" continue="false"/>
                </decision_entry>
    and these if the faction is untrustworthy:

    Code:
    !--
                        IF CEASE HOSTILITIES AND UNTRUSTWORTHY > PEACE FOOTING RANDOMIZED
                    -->
                    <min_entry    has_ceasehostilities="true" global_standing="-0.6"/>
                    <max_entry    has_ceasehostilities="true" global_standing="0.1" rand="0.8"/>
                    <faction_attitude    can_force_invade="false" invade="invade_none" continue="false"/>
                </decision_entry>
    
                <decision_entry>
                    <!--
                        IF CEASE HOSTILITIES AND VERY UNTRUSTWORTHY > PEACE FOOTING RANDOMIZED
                    -->
                    <min_entry    has_ceasehostilities="true" global_standing="-1.0"/>
                    <max_entry    has_ceasehostilities="true" global_standing="-0.6" rand="0.5"/>
                    <faction_attitude    can_force_invade="false" invade="invade_none" continue="false"/>
                </decision_entry>
    To increase the chance a faction won't invade if it has ceasehostilities in the first example we could set
    invade_priority="-400" to
    invade_priority="-600"

    for example. And if you want to decrease the chance it won't invade you could set it to 0 (or whatever you found to be a good value.)

    If a faction is untrustworthy then a random factor is employed.
    Here one could change the range of min and max values (you can't go higher than 1.0 or lower than -1.0)
    or the randomizing value lies between the values of 0 and 1.0 (or whatever is the lowest value recognised.)

    I'll let the next poster choose what would be better values.
    Last edited by Gorrrrrn; November 17, 2010 at 06:31 PM.

  20. #20

    Default

    I posted in the mod workshop about rand="x.x" but perhaps you have a better understanding of it. I noticed ceasefires are kind of a pain and Savage used quite a but of rand values. What are there values though? I'm assuming rand="0.5" is a 50% chance of something happening, in this case accepting peace?

    The reading above look correct good find.

    Quote Originally Posted by soulson View Post
    I posted in the mod workshop about rand="x.x" but perhaps you have a better understanding of it. I noticed ceasefires are kind of a pain and Savage used quite a but of rand values. What are the values though? I'm assuming rand="0.5" is a 50% chance of something happening, in this case accepting peace?

    The reading above look correct good find.
    Damn edit post button
    Last edited by Ishan; November 17, 2010 at 07:58 PM. Reason: triple post

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •