Results 1 to 14 of 14

Thread: Kingdoms.exe CAI

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Pronoiar's Avatar Laetus
    Join Date
    Apr 2008
    Location
    Byzantium
    Posts
    21

    Default Kingdoms.exe CAI

    First of all, I need to make clear that I am aware of the fact that retrofit does not alter the CAI in any significant way from the basic kingdoms AI. Correct me if I'm wrong.

    So, while playing retrofit, I noticed that the campaign ai is very passive and generally incompetent. So I ran some test "all ai" campaigns and compared the results:

    (The first retrofit campaign uses Lusted's CAI, the other two are just plain retrofit)

    So, what's going on with the Kingdoms ai? Is it broken or something? Even using different customized AIs didn't make any significant difference. I've also tried XAI and the results were similar with this test.

  2. #2
    Pronoiar's Avatar Laetus
    Join Date
    Apr 2008
    Location
    Byzantium
    Posts
    21

    Default Re: Kingdoms.exe CAI

    Okay I think I have a possible theory for this.
    It's not actually the ai behaviour that makes the difference, but the new siege autoresolve algorythm of the latest kingdoms version. If I understand correctly, it's now much harder to win an auto-battle when attacking a fortified settlement. This makes it very difficult for the ai to actually win sieges, and slows down it's expansion.
    Anyway, it seems the AI was not recalibrated after this fix was introduced, so it suicide-attacks... Is there a way to mod the AI and make it bring more forces when besieging walled settlements?

    AI modders please enlighten me.

  3. #3
    Pronoiar's Avatar Laetus
    Join Date
    Apr 2008
    Location
    Byzantium
    Posts
    21

    Default Re: Kingdoms.exe CAI

    Ok, don't mind me, just talking to myself

    It turns out my theory was right. I found the autoresolve section in descr_campaign_db and switched "use_new_sett_autoresolve bool" to false. I ran another 50 turn test, and the ai expanded alot faster.

    Sorry for all the fuss

  4. #4
    Pronoiar's Avatar Laetus
    Join Date
    Apr 2008
    Location
    Byzantium
    Posts
    21

    Default Re: Kingdoms.exe CAI

    I ran some more ai campaigns tonight to test the effects of the old siege autoresolve system on the grand campaign.
    So I set <use_new_sett_autoresolve bool="false"/> under the autoresolve section in my descr_campaign_db.xml and played 50 auto turns as usual...

    Behold the results!



    I really think that a swifter ai expansion early on makes the game much more challenging and dynamic. The ai captures cities earlier, builds them up, and builds more troops to fight YOU when you encounter it instead of wasting them all against the rebel walls.

    Just like good ol' vanilla m2tw, minus random illogical wars and psycho diplomacy, plus better overall ai.

    Of course you'll be getting the old weird siege autoresolutions again, but you don't have to autoresolve all the time. That change helps the ai much more than it helps you, and if it helps the ai its all good as far as i'm concerned.

  5. #5

    Default Re: Kingdoms.exe CAI

    Quote Originally Posted by Pronoiar View Post
    Ok, don't mind me, just talking to myself

    It turns out my theory was right. I found the autoresolve section in descr_campaign_db and switched "use_new_sett_autoresolve bool" to false. I ran another 50 turn test, and the ai expanded alot faster.

    Sorry for all the fuss

    Hey great thread and it made me go back to retrofit to try to get a better experience out of it. Ive changed the autoresolve thing like you did, and seen the difference. Great!

    I will also try the last command that you wrote about in your last post.

    Does anyone know if lusteds ai (campaign and battle) works for it, and if it does, does it make the ai more aggresive and stack bigger armys after you?

  6. #6

    Default Re: Kingdoms.exe CAI

    i think most people are missing the biggest reason for the AI behaviour: Retrofit uses kingdoms.exe

  7. #7

    Default Re: Kingdoms.exe CAI

    Wouldn't it make the most sense to add this whole section to Retrofit or really any mod that used the Kingdoms .exe file?

    Code:
    <autoresolve>
          <min_capture_percent float="5.0"/>
          <max_capture_percent float="30.0"/>
          <lopsided_thresh float="1.5"/>
          <lopsided_hn_mod float="3.0"/>
          <separation_missile_add uint="1"/>
          <naval_sink_modifier float="1.5"/>
          <naval_sink_offset float="15.0"/>
          <naval_sink_max float="80.0"/>
          <sally_att_def_draw_divisor float="2.0"/>				<!-- sally battles are a draw if attacker lost and (number of attacker troops) > (number of defender troops)/divisor -->
          <use_new_sett_autoresolve bool="true"/>				<!-- do we use the new settlement autoresolve -->
          <switchable_defence_exposed bool="false"/>				<!-- can unit switch exposed state during autoresolve -->
          <gate_defence_num_oil_attacks int="3"/>				<!-- number of gate oil attacks -->
          <gate_defence_strength_oil_base float="8.0"/>			<!-- gate oil attack strength -->
          <gate_defence_strength_oil_level_modifier float="0.0"/>		<!-- gate oil attack strength += modifier * oil_level -->
          <gate_defence_num_arrow_attacks int="2"/>				<!-- number of gate arrow attacks -->
          <gate_defence_strength_arrow_base float="2.0"/>			<!-- gate arrow attack strength -->
          <gate_defence_strength_arrow_level_modifier float="2.0"/>		<!-- gate arrow attack strength += modifier * arrow_level -->
          <gate_defence_num_default_attacks int="2"/>			<!-- number of gate generic advantage attacks -->
          <gate_defence_strength_default_base float="1.0"/>			<!-- gate generic advantage attack strength -->
          <gate_defence_strength_default_level_modifier float="1.0"/>	<!-- gate advantage attack strength += modifier * fortification_level -->
          <sett_defence_num_arrow_attacks int="2"/>				<!-- number of settlement arrow attacks -->
          <sett_defence_strength_arrow_base float="2.0"/>			<!-- settlement arrow attack strength -->
          <sett_defence_strength_arrow_level_modifier float="2.0"/>		<!-- sett arrow attack strength += modifier * arrow_level -->
          <sett_defence_num_default_attacks int="0"/>			<!-- number of sett generic advantage attacks -->
          <sett_defence_strength_default_base float="1.0"/>			<!-- sett generic advantage attack strength -->
          <sett_defence_strength_default_level_modifier float="1.0"/>	<!-- sett advantage attack strength += modifier * fortification_level -->
          <display_strength_oil float="1000"/>					<!-- additional effective army strength for defending residence with oil -->
          <display_strength_arrow float="1000"/>				<!-- additional effective army strength for defending residence with arrows -->
          <display_strength_default float="500"/>				<!-- additional effective army strength for defending residence with fortification levels -->
       </autoresolve>

  8. #8

    Default Re: Kingdoms.exe CAI

    Quote Originally Posted by Pronoiar View Post
    Okay I think I have a possible theory for this.
    It's not actually the ai behaviour that makes the difference, but the new siege autoresolve algorythm of the latest kingdoms version. If I understand correctly, it's now much harder to win an auto-battle when attacking a fortified settlement. This makes it very difficult for the ai to actually win sieges, and slows down it's expansion.
    Anyway, it seems the AI was not recalibrated after this fix was introduced, so it suicide-attacks... Is there a way to mod the AI and make it bring more forces when besieging walled settlements?

    AI modders please enlighten me.
    So does this mean when you are even playing the total default vanilla Kingdoms campaigns this problem exists and the AI will not be able to expand properly or does adding the section I put above help this? This section is included in the Kingdoms campaigns. Seems like a big bug if it doesn't work right in the stock vanilla campaigns either!
    Last edited by AstroCat; September 26, 2010 at 08:28 PM.

  9. #9
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: Kingdoms.exe CAI

    you should try XBAI or Germanicu5's
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  10. #10
    xeryx's Avatar Follow the White Rabbit
    Join Date
    Nov 2006
    Location
    Wyoming, Usa
    Posts
    4,337

    Default Re: Kingdoms.exe CAI

    Yes, Auto Resolve, makes a huge difference, for the CAI. Also this was a major problem for the game. HOWEVER, Diplomacy..and the CAI files also make a HUGE difference too. Many files are inter-related, this also applies to the BAI as well. That is why there is no real, Plug and Play answer. Each AI should be balanced to each mod.
    Proudly patronized by B. Ward Click Sig Logo for Downloads, Click forums here and here
    "Do not try and bend the spoon, that is impossible, instead only try and realize the truth.
    There is no spoon, and you will see, it is not the spoon that bends, only yourself."-The Matrix


  11. #11
    Pronoiar's Avatar Laetus
    Join Date
    Apr 2008
    Location
    Byzantium
    Posts
    21

    Default Re: Kingdoms.exe CAI

    Quote Originally Posted by xeryx View Post
    Yes, Auto Resolve, makes a huge difference, for the CAI. Also this was a major problem for the game. HOWEVER, Diplomacy..and the CAI files also make a HUGE difference too. Many files are inter-related, this also applies to the BAI as well. That is why there is no real, Plug and Play answer. Each AI should be balanced to each mod.
    Indeed customized AIs play better, but the autoresolve issue has a really big impact, very difficult to overcome.

    I played around with some modifiers that seemed to be relevant, like <friendly-to-enemy-strength-ratio> in the config_ai_battle, or the <siege_att_str_modifier float> one in descr_campaign_db, but I couldn't notice any real improvement.

    I was also checking your AI, Xeryx. Did you try to fix the autoresolve issue in any way? I noticed that you've set <siege_att_str_modifier float> to 1.0 and it seemed a bit strange to me. If I understand it correctly it means that the ai does not modify it's army's effective strength value when deciding to start a siege. Wouldn'ta lower value make the ai to gather more forces before the siege?

  12. #12

    Default Re: Kingdoms.exe CAI

    Hi Pronoiar, thanks for all the great testing !

    I seem to have the same slow expanding AI problem, however I cant seem to locate the "use_new_sett_autoresolve bool" in the autoresolve part of the descr_campaign_db.
    I was looking for it in the retrofit mod's data files, should I search in the main medieval 2 data files ?
    If the latter is where the file is to be found, how would I extract it ?

    I'm afraid I'm not very computer litterate. Thanks in advance !

  13. #13
    Pronoiar's Avatar Laetus
    Join Date
    Apr 2008
    Location
    Byzantium
    Posts
    21

    Default Re: Kingdoms.exe CAI

    Quote Originally Posted by Abe86 View Post
    Hi Pronoiar, thanks for all the great testing !

    I seem to have the same slow expanding AI problem, however I cant seem to locate the "use_new_sett_autoresolve bool" in the autoresolve part of the descr_campaign_db.
    I was looking for it in the retrofit mod's data files, should I search in the main medieval 2 data files ?
    If the latter is where the file is to be found, how would I extract it ?

    I'm afraid I'm not very computer litterate. Thanks in advance !
    Hello Abe. This parameter is missing from the descr_campaign_db because it was introduced in the latest kingdoms patch (1.5) and the retrofit mod was released before that patch.

    All you have to do is to add it manualy in the <autoresolve section>. So it will look like this:

    <autoresolve>
    <min_capture_percent float="5.0"/>
    <max_capture_percent float="30.0"/>
    <lopsided_thresh float="1.5"/>
    <lopsided_hn_mod float="3.0"/>
    <separation_missile_add uint="1"/>
    <naval_sink_modifier float="1.5"/>
    <naval_sink_offset float="15.0"/>
    <naval_sink_max float="80.0"/>
    <sally_att_def_draw_divisor float="2.0"/>
    <use_new_sett_autoresolve bool="false"/>
    </autoresolve>

    And yes, its the retrofit/data/descr_campaign_db you should edit, not the one in the main folder.

    Also, after you edit the autoresolve mechanics, I also suggest editing <ai> section of the same file, to make the AI a little more aggressive when sieging, so it can take advantage of the easier autoresolve rules.

    Find that line:
    <siege_att_str_modifier float="0.30"/>

    And raise it to something resonable. 0.6 or 0.8 works fine for me.
    Last edited by Pronoiar; January 16, 2010 at 09:02 PM.

  14. #14

    Default Re: Kingdoms.exe CAI

    Thanks a lot !

    I appreciate you investing some of your time to explain to us computer illiterates how to have a better medieval 2 experience.

    Take care

Posting Permissions

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