Page 1 of 13 1234567891011 ... LastLast
Results 1 to 20 of 253

Thread: [Obsolete AI Testing] Updated Pathfinding, Campaign AI and Battle AI

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    z3n's Avatar State of Mind
    Moderator Emeritus

    Join Date
    Aug 2011
    Posts
    4,636

    Default [Obsolete AI Testing] Updated Pathfinding, Campaign AI and Battle AI

    Updates to EB2 pathfinding, CAI and BAI




    Battle AI/Campaign AI/Battle & Campaign AI Pathfinding are completely overhauled, we are going places MTW2 has never been before! (Possibly due to the Mundus Magnus map, but you could also infer this is in terms of code/AI. We will let you decide!)

    Please note do to the extent of these changes and the fact that they are part of testing for the next version of EB they may or may not be compatible with submods (for example Bogia's is not compatible as far as I know.) That's because they designed their submods for the current version of EB and not the next.

    Version 1 changes (previous release view examples on page 3) http://www.twcenter.net/forums/showt...1#post14470412
    Spoiler Alert, click show to read: 
    1) Improvement to formation values for charges, all units are affected which will make them move en-masse now
    2) Different formation movement (men catching up to their unit move at a faster pace)
    3) Battle/Siege AI should be subsequently affected by an increased amount of pathfinding nodes



    Version 2's changes (previous release)
    Spoiler Alert, click show to read: 

    Pathfinding
    4) Cavalry now prefer flat terrain, Infantry are not affected by this change and fight either on flat or in woods.

    New file
    Config_battle_ai changes
    1) Flanking is prioritized/used more by the AI, especially for cavalry. Cavalry are also much less inclined to charge a phalanx and more inclined to attack opposing cavalry or flank/rear charge your battle line.
    2) Attack brace range is 125 instead of 200, and added some lines so all infantry are more inclined to brace.



    Version 3 (previous release)
    Spoiler Alert, click show to read: 

    1) CAI pathfinding improvement (done)
    2) Stack merge improvement/Focus on family members as generals (done)
    3) CAI overhaul part 1.

    New file descr_campaign.xml

    1) Age lowered to 12 for adoption/coming of age to better imitate education/loyalty in court.
    2) AI based equations based on autoresolve revamped for better stacks + more decisive battles.
    3) Garrison limit + revolts redone for better AI handling of public order.


    Version 4 (previous release, view screenshots on page 3, it's done except for diplomacy which is only partially complete and undergoing testing, release imminent) http://www.twcenter.net/forums/showt...rogress)/page3
    Spoiler Alert, click show to read: 

    New file descr_campaign_ai.xml
    Details of overhaul- each faction will have their own specific quirks due to being code being faction specific, hopefully that's a good thing. (warning I may run into a hard-coded limit during this, so don't get your hopes too high, I may end up having to generalize the AI to a limit of culture specific ai for example)
    1) Revamped autoresolve results for more decisiveness (stacks bigger before attacking, though keeping more aggressive behavior)
    2) Added diplomacy + protectorate trigger systems (e.g. rome + carthage disliking each other, greeks less likely to ally with each other though more so than barbarian factions and more likely to ally with india)
    3) Added many different war states from XAI. (systems in place for different types of defense)
    4) More aggressive Slaves (Eleutheroi)
    5) More intelligent AI behaviour, for example forced invasion. Stacks don't stand around, if they are stronger (e.g. 23 previously passive stacks) they will come after you en masse and angry.
    6) Faction specific AI and invade priorities for more historical expansion/wars.


    Version 5 (current release, all except faction specific bai complete, wip screenshots) http://www.twcenter.net/forums/showt...1#post14476927
    Spoiler Alert, click show to read: 

    More intensive work being done to the BAI side of things in attempt to imitate how historical battles were fought.
    1) Work will be done to improve AI's holding of their battleline (already did progress with this due to improved AI pathfinding but will do more through other files)
    2) Faction specific BAI. (better representations of how each faction fought)
    3) Changes to the BAI itself, in terms of controllers/way the AI acts in battle. (will aim to put limitations on particularly stupid behaviours and make it act slightly more intelligently )
    4) Current changes are
    4a) Previously hardcoded AI matching severely curtailed (when it foolishly runs units back and forth right in front of your battlelines)
    4b) BAI's nonsensical reserves/retreats forced to not retreat and actually help their fellows in smart flanking manuevers/attacks
    4c) AI will double envelop your line if your cav are compromised/out of position or routed
    4d) AI will intelligently choose to chase your routers
    4e) AI will form a real battleline
    4f) AI cav/auxiliaries to their battleline will act more intelligently and be more active.



    The battle experience on M difficulty. You can also download the replays zip file to see for yourself.
    Spoiler Alert, click show to read: 


    Instructions for how to install and then view the battle I did (a replay file). To give you a sense of what battles should/will be like

    Spoiler Alert, click show to read: 
    Unzip replays directly into your mtw2/mods/ebii folder.

    Like so

    Then start up EBII and then say Load, then say Load replay. Then load it.


    Spoiler Alert, click show to read: 


    You will be able to move around directly around the battle seeing whats going on


    Quote Originally Posted by z3n
    IMPORTANT, READ ALL INSTALLATION INSTRUCTIONS AND VIEW PICTURES IF YOU DONT KNOW WHAT YOU'RE DOING.




    Installation instructions
    1) Download and then open up the file with a program like 7zip.
    2) Use said program to extract the enclosed data folder overtop of your EBII folder located in your mtw2/mods/ebII directory. Say yes to all the overwrites.
    3) These two last steps are very important. Delete any strings.bin files in your mtw2/mods/ebii/data/text
    4) Even more important! Delete map.rwm located in your mtw2/mods/EbII/world/maps/base folder.



    Pictures to help make it clear.


    Spoiler Alert, click show to read: 

    Please make sure you delete your map.rwm file located in your Mtw2\mods\EBII\data\world\maps\base
    Or in mtw2\mods\ebii\data\world\maps\imperial campaign




    Spoiler Alert, click show to read: 



    Spoiler Alert, click show to read: 


    Remember to delete your map.rwm, it will regenerate a new and updated one once you start a new campaign! Note you must start a new campaign to experience the full force of a fully armed and operational skynet. I mean EBII CAI. Actually it's not quite skynet stage yet but I'm trying.




    Here is a campaign AI + pathfinding test run done by mantaprey, many thanks to him.
    Spoiler Alert, click show to read: 



    Quote Originally Posted by Mantaprey
    Playing as Saromatae my goal was to unite the steppes so i attacked Pahlava first. I was halfway when the Bosphorian kingdom invaded so i had to trade my Pahlava conquests for a cease fire so i could secure the east then turn my forces towards the Bosphorians. The Lugian empire and I carved them up.
    Quote Originally Posted by Mantaprey

    Taksashila was reclaimed by the Mauryan empire early on. Macedon and Hellenic Union are in a stalemate there is huge devastation everywhere.

    I am enjoying the new pathfinding it feels like the AI army is being mobilised correctly. They know when to attack or wait for reinforcements, i had to retreat a few time because my army was overextended and the Bosphorians surronded my seige with a force i could not defeat. They even used their fleet to mobilize their forces and block off water passages.

    Should i keep going?



    Political maps

    WMWMWMWM - Red Zigzag mean hostile border or seas(at war)

    Sometimes there are vassals when they are reduced to 1 or 2 provinces.

    There are no alliances in this game.

    50 TURNS



    100 TURNS



    Regards.

    Credits
    The EBII Campaign/Battle AI team (z3n/Granto & Mr Mojo Risin) XAI/Germanicu5.

    If you originally downloaded the original files it is recommended that you upgrade to this latest version for the latest advantages.


    While I did include the releases I had of these two there may be more updated versions available so please check these threads.
    And please use the official testing edu if you do play with this! http://www.twcenter.net/forums/showt...-other-changes
    This is the trait hotfix thread, also something you should use. http://www.twcenter.net/forums/showt...rait-mechanics

    I also recommend installing this for a better battle experience
    http://www.twcenter.net/forums/showt...ng-2-0-testing


    Also please be aware I will release a new descr_ai_formations from time to time to further optimize battles and don't worry those tweaks will be save game compatible due to how the engine works, until Granto completes his historical formations along with any other improvements he has planned (at which point I believe we will switch over to those formations). I have something I'm working on already to release within a few days.

    One last note, if you're going to play custom battles activate the g5 battle script for the full experience before you press start battle by clicking on the flashing adviser on your upper left! Thanks!
    Attached Files Attached Files
    Last edited by z3n; April 24, 2015 at 12:16 PM. Reason: updated with Quintus's/Ibrahim's new EDU/DP
    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)

  2. #2

    Default Re: Updated Pathfinding

    Thanks a lot for the investigation, will give it a try later

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

    Join Date
    Aug 2011
    Posts
    4,636

    Default Re: Updated Pathfinding

    Cheers
    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)

  4. #4

    Default Re: Updated Pathfinding

    I'll give it a try, too. Thanks for this.

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

    Join Date
    Aug 2011
    Posts
    4,636

    Default Re: Updated Pathfinding

    Another update- out of interest, I looked for optimizations I could do to pathfinding for the CAI on the campaign map side of things. I am happy to report I've made some progress on that front. However I have to wait back for a reply from the owner of the CAI file I am using, as to whether I can release it alongside this as an optional download or not. (as EB2 already has a CAI the team is working on) I just prefer this one because I've seen the best results thus far with allies helping you out in battles and the CAI being more intelligent than normal (haha) although I admittedly haven't tried the EB2 CAI yet.


    And also a side note about the way pathfinding works- First, to understand how the engine works- charges are handled through a time based "snapshot''. This means that 4 men in a front line of a unit will spot 4 other men in the opposite unit then charge towards the last position they 'saw' (this 'seeing'also happens with the BAI) them at. Generally the engine updates this, keeping each man focused on their enemy. So in order of importance to the engine there are 3 main things, 1) charge animation, 2) charge distance and 3) charge formation based pathfinding values. Changing the 2nd and 3rd value often overrule the importance of the 1st if they work in conjunction. Hopefully that clears things up as to why this update will help.
    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: Updated Pathfinding

    Quote Originally Posted by z3n View Post
    charges are handled through a time based "snapshot''. This means that 4 men in a front line of a unit will spot 4 other men in the opposite unit then charge towards the last position they 'saw' (this 'seeing'also happens with the BAI) them at.
    Coincidentally, this ties in with my "cavalry charge tutorial" I just posted earlier today. Your explanation makes a lot of sense. This "time based snapshot" must be what causes cavalry charges to often miss moving targets.

    EX:
    1.) Order a cavalry charge on a unit of infantry currently running perpendicular to the cavalry.
    2.) The cavalry will "lock in" on the infantry in their current position, resulting in a charge 20 feet behind the unit is (into its last "snapshot position") — and the cav end up looking confused why they didn't hit anything!

    Is there any way around this..? I can post a video if necessary..

  7. #7

    Default Re: Updated Pathfinding

    sweet!

  8. #8

    Default Re: Updated Pathfinding

    yeah i'v noticed that charging is much more focused now. I have not tried sieges yet.

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

    Join Date
    Aug 2011
    Posts
    4,636

    Default Re: Updated Pathfinding

    About the pathfinding changes to the CAI, it seems to be mostly where I want it by now so I changed my focus back to battles, see first post for the update.
    Last edited by z3n; April 11, 2015 at 09:51 PM. Reason: updated first post with info instead
    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)

  10. #10

    Default Re: Updated Pathfinding & BAI

    Nice mate, im gonna give it a try.

    But is this official, as in are you a team member?

    O.o
    Then, as throngs of his enemies bore down upon him and one of his followers said, "They are making at thee, O King," "Who else, pray," said Antigonus, "should be their mark? But Demetrius will come to my aid." This was his hope to the last, and to the last he kept watching eagerly for his son; then a whole cloud of javelins were let fly at him and he fell.

    -Plutarch, life of Demetrius.

    Arche Aiakidae-Epeiros EB2 AAR

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

    Join Date
    Aug 2011
    Posts
    4,636

    Default Re: Updated Pathfinding & BAI

    II do have the partially redeeming quality of being asked as to whether I was interested to join but declining at the time. Which was 3 or 4 so years back. Really I planned to just release the pathfinding fix and go my merry way but now? Only time will tell though honestly eb2 already has mojo and granto working on the bai/CAI and I'm more interested in designing my own CAI starting tomorrow or next week right after I explore two last things (for now) with battles :p

    Edit: sent a pm to alin my original contact, I suppose I may end up on the team now, maybe not. As I said, time will tell
    Last edited by z3n; April 12, 2015 at 01:34 AM.
    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)

  12. #12

    Default Re: Updated Pathfinding & BAI

    Quote Originally Posted by Wulfburk View Post
    Nice mate, im gonna give it a try.

    But is this official, as in are you a team member?

    O.o
    It's not official, but I want to try out the pathfinding changes with my EDU testing.

    Quote Originally Posted by z3n View Post
    II do have the partially redeeming quality of being asked as to whether I was interested to join but declining at the time. Which was 3 or 4 so years back. Really I planned to just release the pathfinding fix and go my merry way but now? Only time will tell though honestly eb2 already has mojo and granto working on the bai/CAI and I'm more interested in designing my own CAI starting tomorrow or next week right after I explore two last things (for now) with battles :p

    Edit: sent a pm to alin my original contact, I suppose I may end up on the team now, maybe not. As I said, time will tell
    As someone who is on the team, please do apply here. mojo and GRANTO are doing great stuff, but I doubt they'd complain about having more hands. Besides which I don't think they've looked much at pathfinding, which is an area you seem to have some expertise in.

  13. #13

    Default Re: Updated Pathfinding & BAI

    Also, I've got the test BAI installed, which changes a whole host of files besides the config_ai_battle.xml. Should I restore the original files to make best use of this update?

    If anyone needs backups of the original files, here they are: Attachment 324037 (either do this before installing the update, or remove the two updated files from the zip before copying). EDIT: You don't need these unless you didn't back up your original files when you installed the BAI 2.0.
    Last edited by QuintusSertorius; April 13, 2015 at 03:09 AM.

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

    Join Date
    Aug 2011
    Posts
    4,636

    Default Re: Updated Pathfinding & BAI

    Quote Originally Posted by QuintusSertorius View Post
    Also, I've got the test BAI installed, which changes a whole host of files besides the config_ai_battle.xml. Should I restore the original files to make best use of this update?

    If anyone needs backups of the original files, here they are: Attachment 324037 (either do this before installing the update, or remove the two updated files from the zip before copying).
    Be sure to overwrite that config_ai_battle and the pathfinding with mine. As I to am using this.
    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)

  15. #15

    Default Re: Updated Pathfinding & BAI

    Quote Originally Posted by z3n View Post
    Be sure to overwrite that config_ai_battle and the pathfinding with mine. As I to am using this.
    To confirm, you're using the test/2.0 BAI, not the original one?

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

    Join Date
    Aug 2011
    Posts
    4,636

    Default Re: Updated Pathfinding & BAI

    Quote Originally Posted by QuintusSertorius View Post
    To confirm, you're using the test/2.0 BAI, not the original one?
    Yes, test/2.0
    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)

  17. #17
    GRANTO's Avatar Domesticus
    Join Date
    Dec 2010
    Location
    glastonbury uk
    Posts
    2,201

    Default Re: Updated Pathfinding & BAI

    good stuff yes....im busy with historic formations atm but this pathfinding looks good..its all bricks in the wall.

  18. #18

    Default Re: Updated Pathfinding & BAI

    Quote Originally Posted by GRANTO View Post
    good stuff yes....im busy with historic formations atm but this pathfinding looks good..its all bricks in the wall.
    You guys rock. I can't wait to see what's in store next for EBII.

    As for the pathfinding issue z3n mentioned (about "taking a snapshot" of targets and then zeroing in on them), I decided to upload a short video illustrating it clearly:
    https://www.youtube.com/watch?v=1iIIqlmn8i4

    If anyone is familiar with the pathfinding values / AI decisions that cause this, I'd love to hear about it...

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

    Join Date
    Aug 2011
    Posts
    4,636

    Default Re: Updated Pathfinding & BAI

    YesYes I can make them update even faster but as it stands now i tried to find a balance between things, I'll upload an optional one for you but since I also did not test this value as much there may be unintended consequences (on my android ATM not computer)
    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)

  20. #20

    Default Re: Updated Pathfinding & BAI

    Quote Originally Posted by z3n View Post
    YesYes I can make them update even faster but as it stands now i tried to find a balance between things, I'll upload an optional one for you but since I also did not test this value as much there may be unintended consequences (on my android ATM not computer)
    Very interesting, thank you! I'll be sure to test out the updated descr_pathfinding.txt when you're ready to see whether it resolves this issue without having any adverse impact on CPU load. Here's hoping it's an easy fix with no downsides

Page 1 of 13 1234567891011 ... 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
  •