Page 1 of 6 123456 LastLast
Results 1 to 20 of 118

Thread: AI Discussion Thread

  1. #1

    Default AI Discussion Thread

    I have a few questions over a couple of the entries in the config_ai_battle file:

    1.
    <attack-battlegroup>
    <tracking-tolerance>50.0</tracking-tolerance>
    <formed-percentage>20</formed-percentage>
    The formed percentage value here is quite important as it dictates the priority the AI will assign to keeping its attacking line in formation as it approaches your defensive position. The reason I'm mentioning this is because a value of 20 is quite low and will mean missile units going further ahead and siege and slower moving units lagging somewhat behind. When I used to mod Med II I had changed this value to 80 and got really good results with it. This meant the missile troops would stay closer to the main force during the initial advance (normally the AI likes to sprint its archers and skirmishers way ahead of the main line). It also prevented the AI from letting its slower moving troops lag too far behind (pikes, halberds, siege). Your mileage may vary of course, but it's maybe worth investigating.

    2.
    <defend-line>
    <formed-percentage>40</formed-percentage>
    </defend-line>
    I found this value to be critical as well, but for the opposite reason of above. When an AI force defends and is defending a position, it can sometimes get over-fussy continuously reforming its missile units - particularly if there's a mix between shorter range skirmishers and archers. If too many stray from the battleline, the AI will spend most of a shoot-out time reforming! Presumably this is more critical while the AI is defending because the AI's other non-missile units aren't also moving/advancing and the human's 'attacking' units are moving, and are thus able to drag the AI's defensive line about more. There's also impassible terrain which can complicate matters further. Anyway, the short of it is that the AI can get rather obsessed reforming its missile troops when it should be shooting. The most effective value I found was to set this to 25, but again it's certainly worth checking yourself. Your value of 40 is probably ok and is certainly better than the vanilla value of 80.

    Some food for thought. Next, pikes.

    Last edited by Dave Scarface; September 27, 2008 at 09:43 AM.

  2. #2

    Default Re: Battle AI discussion

    Some very interesting observations there and I have to agree with some of those points you make about the AI. I am not experienced in modding Battle AI myself yet, but I am going to give your changes some serious testing when I get time. At the moment though I am completely focused on converting the MODELDB file from Grand Unit Addon Mod, to my own mod and factions. When I have got this big job out of the way I am going be looking at further improvements to units and Battle AI. I also intend to make some very small changes to Lusteds campaign AI (I do have an understanding of the campaign AI and have modded it before).

    best
    Dave

  3. #3

    Default Re: Battle AI discussion

    @DrJambo,

    I gave your changes a try while making the latest update and formations did seem to hold together a lot better, as you stated. However there was one problem the infantry line of the AI was to close to the archers in front (and in some cases mixed in with it). So after the first missile battles I was already killing many of their infantry units as well.

    I will have to test and work on this more and may release a small improvement for the AI in the future. So your suggestions will always be very welcome. I view the AI as the most important part of my mod, and will always try to improve it.

    Dave

  4. #4

    Default Re: Battle AI discussion

    However there was one problem the infantry line of the AI was to close to the archers in front (and in some cases mixed in with it).
    Was this when the AI was defending or attacking?

    I presume attacking and if so, you could try notching the formed % down a bit for the attack battlegroup. Ideally you want to reach a happy medium between the AI letting its archers shoot and tyrying to keep its infantry out of the way... and... also ensuring the AI's archers aren't too far away from the main battleline to be exposed to a quick cavalry charge. Otherwise, a human will simply use a unit of cavalry to rush any exposed archers when the human is numerically inferior on missiles.

    I remember this particularly when fighting Milan. They'd march their Genoese xbows too far in front of their main battleline when trying to initiate a missile duel, and all I'd need to do was charge my cavalry. The AI's infantry were always too far behind to do anything about the xbows before my cavalry slaughtered them. The way I see it, the archers should be close enough to the infantry so that when they skirmish they skirmish through their own infantry's ranks.

  5. #5

    Default Re: Battle AI discussion

    Re: pikes/halberds.

    There are a couple of issues for the AI here: 1, AI pikemen and halberdiers often invert their facing in the heat of battle! Silly. And 2, for pikemen, they all too often draw their swords too early.

    After testing for a while in custom battles the best fix I have for AI use of pikemen includes a slight tweak to their formation/depth and increasing their mass even further. Example below (Landschneckt pikemen):

    Tweak formation/depth and increase mass:
    soldier Landschneckt_Pikemen, 60, 0, 5
    attributes sea_faring, hide_forest, hardy, can_withdraw, mercenary_unit, pike
    move_speed_mod 0.7
    formation 0.8, 1.8, 2.4, 2.4, 5, square, phalanx
    You can also add a move_speed modifier as above if you find the AI pikemen walking too fast during approach. (Although if you use the more restrained formed % for attacking this shouldn't matter so much as the AI will stop more often to regroup if its units and battleline are getting too out of sync.)

    Similarly, here's my fix for western (phalanx) halberds:

    soldier Voulgier, 48, 0, 5
    attributes sea_faring, hide_forest, can_withdraw
    move_speed_mod 1.3
    formation 1.2, 1.8, 2.4, 2.4, 4, phalanx, square
    The second value increases the distance between the ranks. I didn't squash them together more as I did for pikes because they're only a unit of 48 as opposed to 60.

  6. #6

    Default Re: Battle AI discussion

    Was this when the AI was defending or attacking?
    I was waiting for the AI to attack and move towards me. They kept their formation very tight and the archers were just infront of their infantry. Then when their archers spread out they were in the infantry line. So I will have to try as many settings as I can until I get the best results.

    And thanks for the rest of your cool ideas, right now I must work on the stability of my patch update and find any bugs. Thats my number 1 priority atm, but when thats done I am going to give this my full attention.

    Dave

  7. #7

    Default Re: Battle AI discussion

    I have now decided to use the battle AI from XAI mod in a new update. I have been testing this for the last few weeks with my kingdoms mod. And it has provided me with even more of a challenge. I now have permission to release this with kingdoms grand campaign mod

    Dave

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

    Default Re: Battle AI discussion

    Yeah!!
    A battle AI discussion!! Sorry Dave, I got the mods confused in the PM I sent you!!

    I am still new at this battle AI thing, so maybe we can discuss some things.

    You also need to consider the unformed charge percentage, All of these work together. The numbers also need to be in the proper percentage ratios, if you are to get good results.
    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


  9. #9

    Default Re: Battle AI discussion

    @xeryx,

    Welcome to our battle AI discussion thread, DrJambo helped Lusted to develope many of his ideas for battle AI released in LTC. As I have decided now that I would like to use XAI battle AI. I would like the discussion to continue on "ways we can improve XAI mod". I have no experience on modding battle AI yet myself. But am willing to test out any new ideas that you guys have. Feel free to thrash out any new ideas in this thread. Lets try new things out and see what results we can come up with.

    Attached to this thread are the XAI files for retrofit that I am currently using with my kingdoms grand campaign mod. If anybody wants to try this new AI, all of these files need to go in the mods data folder.

    EDIT: Attachment now updated with the latest version of XAI.

    best regards
    Dave
    Last edited by Dave Scarface; March 30, 2008 at 11:23 AM.

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

    Default Re: Battle AI discussion

    Please include update 3 into your new files, I only have very fine tuning left, unless there is a big problem with something unforeseen. Click logo.

    Sure, I would love to participate. Maybe later this weekend? when I have got some of my projects done.

    DR. J. I have not Modded the EDU or the Mounts file, However, I am very interested in how the EDU interacts with the BAI.
    Last edited by xeryx; March 07, 2008 at 12:36 AM.
    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
    xeryx's Avatar Follow the White Rabbit
    Join Date
    Nov 2006
    Location
    Wyoming, Usa
    Posts
    4,337

    Default Re: Battle AI discussion

    DR Jambo:

    Question for you: Does the Battle Analyzer control whether an army stands it ground on defense, or engages on defense?
    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


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

    Default Re: Battle AI discussion

    Hello !!!
    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


  13. #13

    Default Re: Battle AI discussion

    Quote Originally Posted by xeryx View Post
    DR Jambo:

    Question for you: Does the Battle Analyzer control whether an army stands it ground on defense, or engages on defense?
    Hi,

    Good questiion. The tweaking I did of the battle-analyser came about because of the AI's unwillingness to sometimes engage in melee when it was being pelted with missiles and yet had none of its own.

    As to whether it will also relate to attacking or defensive stances in general when defending (including situations that are not just missile related), I'm not sure. To test should be fairly simple however. As a general rule when testing, when you find yourself a suitable battle (usually one where the AI acts stupidly for instance), log out of Med II and change one of the battle-analyser parameters to an extreme value. Then, log back in and retry the same battle and see what the effect is. Setting an extreme value is important, otherwise it can be really hard to ellucidate what these parameters mean.

    Of course this is something you may be doing this already!

    Good luck
    Last edited by DrJambo; March 13, 2008 at 07:10 AM.

  14. #14

    Default Re: Battle AI discussion

    Dave, another suggestion for a better battle experience is to reduce the mass of each unit in the EDU. As a start I'd suggest reducing all by 0.5. Since each soldier then takes up less mass, this results in less spreading out of units during battle and more intermingling of the soldiers.

  15. #15

    Default Re: Battle AI discussion

    Please could anyone using the attached XAI BAI in the post above give me their impressions on it so far? As I shall be including the latest version of XAI in my next update. I would like to hear what you guys think of this new AI in your campaigns.


    Dave

  16. #16

    Default Re: Battle AI discussion

    Dave, it would be easier if the creator could explain what he's changed since it's a big ask to determine whether it's better or worse based on gameplay only. The AI's very different from battle to battle.

    One other idea for improving the AI is to half unit maintenance across the board, as the CA-creator (Unspoken Knight) of the Retrofit mod did. An AI with a large stack is much better than an AI with only 5-unit stacks, partly because it can more efficiently control 20 or more units at a time.

  17. #17

    Default Re: Battle AI discussion

    @DrJambo,

    I have every confidence in xeryx, him and Naimad are the only modders since Darth Vader to totally commit themselves to improving the AI like this. XAI BAI is not perfect yet, of course there can still be improvements. But overall I find his battles to be better. Stainless Steal 6.0 is also going with XAI and I can well understand why. I respect them a lot for their hard work and how they stick with it. Trying to improve the AI and fix bugs is the most complicated work one can undertake as a modder. Please try out the XAI I have attached in this thread if you get the time mate. Your feedback on it would be good as ever I'm sure.

    About changing the upkeep costs, its not a bad idea. And I'm also considering other changes in the EDU atm. Like increasing armour upgrade costs and upgraded weapon costs. Since upgrading armour in real history was a very expensive business.

    dave
    Last edited by Dave Scarface; April 15, 2008 at 04:53 PM.

  18. #18

    Default Re: Battle AI discussion

    yeah, I've installed it and will try it out on my Teutonic campaign while i await your update. Try out the mass decrease and the decrease in maintenance which the CA guy did, and let me know what you think!

  19. #19

    Default Re: Battle AI discussion

    My mistake, it was actually Unspoken Knight's Custom Campaign mod where he approximately halved all upkeep costs. :O

    Changing armour and weapon upgrades, i.e. making them more expensive, is also a good idea; mainly because the AI is rather lax or less able to deal with upgrading its units.
    Last edited by DrJambo; April 16, 2008 at 05:49 AM.

  20. #20

    Default Re: Battle AI discussion

    Just in case you guys are not aware of it already, Lusted has released a new version of his BAI and CAI in the SS sub forums.

    http://www.twcenter.net/forums/showthread.php?t=163839

    Have fun!

    Dave

Page 1 of 6 123456 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
  •