Results 1 to 6 of 6

Thread: EB II Battle AI & Pathfinder Fix

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default EB II Battle AI & Pathfinder Fix

    Hello guys, I know QuintusSertorius and Zen have been hard at work on the Battle AI and Pathfinding of EB II. So I was playing 2.04j earlier and noticed that my cavalry and troops sometimes did a weird zig-zag formation when marching and I wanted to fix it. I actually ended up digging into a lot of the coding and fixed that also a lot more on my numerous open battles and siege fights. Below are my results and changes, plus a folder containing these changes for anyone who wants to test it out. Battles are a lot more focused now, in my opinion. The new siege battles I have were the actual shock factor that made me want to share this. P.S. in no way is this a insult to the great effort of the two I mentioned earlier.

    Open Battle

    1) Skirmish Cavalry now go between throwing their javelins instead of being stuck in the same "about to throw" motion but going back and forth due to ai skirmish mode on. I've tested this with Skirmish vs Skirmish and then Skirmish vs Missile cavalry. The two skirmish forces were able to stand ground and launch their javelins. The second test the Skirmishers at least threw their javelins against the Missile Cav, then they ran back to a safe spot, yet they did take massive damage due to the missile range as expected.

    2) Cavalry now flank prioritizing missile units, I did this because what I found was that the cav now go around your army and then attack from the sides to your missle units if you don't have them properly protected. Beware, Cav will sometimes charge your sword units, or even phalanx but this is a regular. Also missile Cav now actually take the chance and charge your missile units if left unprotected instead of having a missile brawl of arrows. I figured that as Cav units even the missile ones should charge your archers instead of shooting them. They do shot them as well but beware of the charges hehe..

    3) Units now charge in cohesion, often times they would send out 10-20 units before but now I see them putting the large forces at the front of their charge. The small amount of units left behind quickly follow so it looks more realistic.

    Siege Battle

    1) The AI will now deploy their siege equipment on your gate walls, strategically. I watched an AI unit of hoplites take their ladder and bring it to the side of my settlement and then climbed up to take the towers. Foolish of me to not deploy any infantry at that spot but I had no idea they would go around my settlement.

    2) When inside I set up cavalry on each sides of the settlement, close to the left and right gates. What came to my surprise was that the AI set units both to my center of the settlement and a few spear units on each side to deal with my cavalry. The siege battle was a blast as it allowed me to think and reinforce my cavalry with units on one side but watch as they murdered my other unit on the other side. Overall it was fun.

    This isn't perfect, but it has gotten me to get more enjoyment out of EB II battles, and it seems to make so much sense when I'm fighting now. Give it a try if you want and please let me know about your experiences, Thank you.
    Attached Files Attached Files

  2. #2

    Default Re: EB II Battle AI & Pathfinder Fix

    Always good to have more eyes on the mechanics - I'll leave it to z3n to comment on the meat of your changes, since that's his bailiwick and he understands all that much better than I do.

    Quote Originally Posted by Mugen234 View Post
    1) Skirmish Cavalry now go between throwing their javelins instead of being stuck in the same "about to throw" motion but going back and forth due to ai skirmish mode on. I've tested this with Skirmish vs Skirmish and then Skirmish vs Missile cavalry. The two skirmish forces were able to stand ground and launch their javelins. The second test the Skirmishers at least threw their javelins against the Missile Cav, then they ran back to a safe spot, yet they did take massive damage due to the missile range as expected.
    Just on this point, we've come up with a workable solution to this in upcoming 2.05. The root of the issue is that previously, all missile-using cavalry, whether archer or javelineer, had one one set of values determining their skirmishing distances. So you either had javelineers happy with shorter distances, but archers getting caught hanging around too close to melee cavalry; or you have javelineers moving too soon without throwing, but archers staying at appropriate distances while plinking away.

    The change is to move horse archers into another category by use of the gunpower_unit attribute in the EDU. It separates them and removes the need to try to balance skirmish distances between the two different types of unit.

  3. #3

    Default Re: EB II Battle AI & Pathfinder Fix

    Quote Originally Posted by QuintusSertorius View Post
    Always good to have more eyes on the mechanics - I'll leave it to z3n to comment on the meat of your changes, since that's his bailiwick and he understands all that much better than I do.



    Just on this point, we've come up with a workable solution to this in upcoming 2.05. The root of the issue is that previously, all missile-using cavalry, whether archer or javelineer, had one one set of values determining their skirmishing distances. So you either had javelineers happy with shorter distances, but archers getting caught hanging around too close to melee cavalry; or you have javelineers moving too soon without throwing, but archers staying at appropriate distances while plinking away.

    The change is to move horse archers into another category by use of the gunpower_unit attribute in the EDU. It separates them and removes the need to try to balance skirmish distances between the two different types of unit.
    Nice! That's a perfect fit to put them as gunpowder to separate them, and yeah I used to code so anything I can do to help out I'll try on my free time.

  4. #4

    Default Re: EB II Battle AI & Pathfinder Fix

    I screwed up on the unit collision, just download this and put it in the data file and your units should properly charge and engage. Remember to put it in your EB II/data folder and then make sure you delete the map.rwm in world/maps/base/ folder
    Attached Files Attached Files

  5. #5
    z3n's Avatar State of Mind
    Moderator Emeritus

    Join Date
    Aug 2011
    Posts
    4,636

    Default Re: EB II Battle AI & Pathfinder Fix

    I suggest taking a look through this. The siege AI is in fact a by product of separate threat/resourcing related code for sieges that I made, I believe I discussed it in the tutorial.

    missile Cav now actually take the chance and charge your missile units if left unprotected instead of having a missile brawl of arrows
    I will take a closer look at this/the outflanking changes later but I will give you a fair warning, I made missile cav avoid charges until they were out of ammo because if they do not, they will only loose a few volleys before charging any unit at all.


    I look forward to any future updates.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  6. #6

    Default Re: EB II Battle AI & Pathfinder Fix

    Awesome, thank you that explains the Pathfinder in more details, I'll definitely look through it and great job with 2.05a!

Posting Permissions

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