Results 1 to 6 of 6

Thread: Research: Battlefield AI

  1. #1
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,631

    Post Research: Battlefield AI

    placeholder
    Last edited by therother; 03-22-2005 at 13:31.
    Nullius addictus iurare in uerba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  2. #2
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Default Research of the Battlefield AI

    The battlefield AI is still bad at keeping his battleline tidy and it has some unwanted habits like charging his archers into the player's frontline.

    In this thread I want to research how the AI is influenced by the composition of AI and player armies. With hopefully as end result some recommendations for modders/CA to keep in mind to improve the AI.

    Tests
    I'm doing controlled tests on relative flat ground [Prippet Marches]. In all cases the AI is attacking to see what tactics it uses.

    With Inf1, Arch2 I mean the AI Infantry unit number 1 and the AI Archer unit number 2.


    Tests with infantry

    [table 0 3 1]
    2^ Test #1|Triarii|Archers|Cavalry
    6^Player|=2|=0|=0
    6^AI|=1|=0|=0
    [/table]
    Run 1: AI moves up to the middle of my line and walks against my unit.

    [table 0 3 1]
    2^ Test #2|Triarii|Archers|Cavalry
    6^Player|=2|=0|=0
    6^AI|=2|=0|=0
    [/table]
    Run 1: AI general attacks my general. Other AI unit makes flanking move to the right and flank attacks my general. My other unit is left unengaged.
    Run 2: Switched my general to the left flank. AI general still attacks my general. Other unit attacks my right.

    [table 0 3 1]
    2^ Test #3|Triarii|Archers|Cavalry
    6^Player|=3|=0|=0
    6^AI|=2|=0|=0
    [/table]
    Run 1: Same result as test #2, run #1.

    [table 0 3 1]
    2^ Test #4|Triarii|Archers|Cavalry
    6^Player|=6|=0|=0
    6^AI|=6|=0|=0
    [/table]
    Run 1: AI army starts in the following formation and keeps it: 3 in frontline, 2 in 2nd line, general in 3rd line. 1 unit of 2nd line breaks off to my left. Entire remaining AI army charges into my army as soon as they in charging range. AI flanking unit breaks off flanking manuevre and piles on the already crowded battleline.
    Run 2: My army in a single line. AI goes for 2 left most units. 1 AI unit makes flanking manuevre only to abort and charges my frontline.


    Tests with infantry and archers

    [table 0 3 1]
    2^ Test #5|Triarii|Archers|Cavalry
    6^Player|=4|=1|=0
    6^AI|=4|=0|=0
    [/table]
    Run 1: My archer unit is placed closely in front of my line. Inf1 and Inf2 charge 1 unit of mine. AI general pursues (didn't really notice a charge) my archers into my frontline. The Inf3 starts flanking manuevre but aborts it.

    Run 2: Archers placed in different group and more to the front. Inf1 and Inf2 start flanking manuevres, 1 breaks it off, the other actually flanks. Inf3 AI unit charges my line. AI General pursues archers into my infantry.

    Run 3: Archers placed in different group and on my right flank. AI General charges at archers(!) then breaks off to attack my Inf which is very close by. Other 3 AI infantry neatly charge my battleline.

    [table 0 3 1]
    2^ Test #6|Triarii|Archers|Cavalry
    6^Player|=4|=0|=0
    6^AI|=4|=1|=0
    [/table]
    Run 1: AI stops his formation when his archers are able to shoot my troops. After a couple of rounds the AI infantry moves forward and then attacks my whole frontline. Archers move forward 5 metres and then start shooting again (possibly to reach my general who is slightly back).

    Run 2: Same as Run 1. Except that halfway the march of the AI 2 enemy infantry started to swirl of a few seconds (to flank or not to flank?) before pressing on.

    [table 0 3 1]
    2^ Test #7|Triarii|Archers|Cavalry
    6^Player|=4|=1|=0
    6^AI|=4|=1|=0
    [/table]
    Run 1: Archers up front. While my archers are shooting, the entire AI army keeps moving forward. Then halfway AI army starts running. Then halts. Inf1 and General charge 1 unit. Inf2 and Inf3 flank, Inf 2 aborts.
    Archers loosen and start shooting. Inf 2 moves 10 metres infront of my unit, waits and then charges.

    Run 2: My archers are deployed on my right flank. Same as Run 1 except that AI inf only starts running when AI archers starts shooting. Inf 1 and General aims for archers only to redirect 20 metres before by battleline. Other 2 units attack my left unit. Middle unit is virtually left unengaged.

    [table 0 3 1]
    2^ Test #8|Triarii|Archers|Cavalry
    6^Player|=4|=1|=0
    6^AI|=4|=3|=0
    [/table]
    Run 1: Archer deployed right forward. Arch1 and Arch2 start shooting at 2/3 range untill my archers are down to 43/80. Arch3 shoots at 1/2 range. Infantry remains standing. Archers start shooting at my infantry until 2/3 of my ammo is spent and my infantry is down to 50-60/80. Infantry runs forward and charges perfectly, distributing units along my whole frontline... just a perfect charge!

    Run 2: Archer up front (40 metres). AI army stops at 2/3 missile range. AI archers shoot at my archers until they are down to 37/80 then start shooting at my infantry. Infantry charges when my archers used up 2/3 ammo and my infantry are down to 61-71/80. Infantry charges again my whole line.


    [table 0 3 1]
    2^ Test #3|Triarii|Archers|Cavalry
    6^Player|=2|=0|=0
    6^AI|=1|=0|=0
    [/table]
    Run 1:

    Run 2:

  3. #3
    Senior Member Senior Member Oaty's Avatar
    Join Date
    May 2003
    Location
    Indianapolis
    Posts
    2,863

    Default Re: Research of the Battlefield AI

    The problem is the A.I. attempts to flank every single unit of yours.

    Phalanx vs phalanx both with equal quality of militia hoplites. I did not redeploy my line and hit start battle. So the lineup was equally matched. I marched forward and so did the A.I. so that we'd both be hitting fatigue levels at the same time. The march forward everything is looking great, A.I. get's close and usually pulls it's 2 end units for flanking, not so bad there. The middle is close to meeting spears and each unit is faced directly with a hoplite. Then right when both lines are about to clash the A.I. tries to hit the unit next to the one in front of them. This cause the phalanx flank to hit my frontline and as always half the A.I. army starts to route.

    The A.I. when confronting a battle line with no (or 2 flanks) exposed flanks does not try to hit the unit in front of them but goes for a unit diagnolly in front of them. Basically trying to wedge a vulnerable spot between 2 of your units, with the kill rates this tactic won't work as soon as they dig in to the back ranks between the 2 units they route, then the unit reorganizes itself filling in the penetrated areas, then a second unit comes in unsupported and the cycle goes on. The A.I. keeps sending in 1 unit at a time waiting for a unit to expose a flank and rush in on that vulnerable unit. Unfortanately I never turn a unit's flanks so the A.I. never sees oppourtunity and I constantly get tricklefed enemies to kill.

    As for me I found guard mode too valuable and the only way the A.I. can break me is by either making a hole or winning on a flank.

    Also if you notice the A.I. will sometimes try to hit a unit behind another unit in hopes of breaking through the first unit and hitting the second especially with cavalty.

    Then theres the pile drive of a flank, 10 units against 1 unit on the flank. Well simple to handle that, frontline comes around uncontested, maybe send a unit or 2 to the units they left in the center so they can't take a chance at opportunity then while your coming around the front your reserves come from behind.

    Also a big problem is the fact the A.I. only goes for a set up of only 4 ranks deep. That'd be fine if they were keeping reserves. I go for thin lines and reserves to reduce missle casualties. If they do'nt impose a missile threat then the ranks are deep with few reserves. Problem is with 4 ranks deep and no reserves is I can beat there center before they come around on my flanks. Then I just push out if the A.I. actually decides to keep fighting.
    When a fox kills your chickens, do you kill the pigs for seeing what happened? No you go out and hunt the fox.
    Cry havoc and let slip the HOGS of war

  4. #4
    Spends his time on TWC Member Simetrical's Avatar
    Join Date
    Dec 2004
    Location
    New York City
    Posts
    1,358

    Default Re: Research of the Battlefield AI

    I've just done a test on whether the AI recognizes mount bonuses. I took the standard EDU.txt, gave Hastati the stats of Principes, but then gave Hastati a mount_effect of +50 against horses and Principes -50 against horses. I then started up a custom battle, giving myself (Julii) one Hastati and one Principes, and the AI (Carthage) one Sacred Band Cavalry and one Poeni Infantry.

    On the first run, I positioned the Hastati to the left and the Principes to the right, approximately equidistant from the AI's line of approach. The AI seemed to be sending both its units toward the Hastati, with the Poeni Infantry in front and the Sacred Band Cavalry in the back, both moving at a walk, but it broke off its cavalry to charge the Principes. After a short period of battle, the Principes routed, and I disengaged my Hastati to attack the Sacred Band. The AI didn't retreat from the Hastati as it should have. (I lost anyway, because Hastati are no match for Poeni Infantry without flanking.)

    On the second run, I switched the positions of Hastati and Principes. The AI performed identically, heading toward the Hastati and then breaking off its cavalry.

    On the third run, I spread the Hastati in a thin line and positioned the Principes behind them. The AI approached as normal and engaged the Hastati with its infantry. It apparently couldn't figure out how to get around the Hastati, because it left its cavalry behind its infantry rather than circling around to attack the Principes. Once the Hastati routed, the AI used its cavalry to chase them (or possibly to attack the Principes—it was hard to tell, because the Hastati routed into the Principes, and the Sacred Band ended up fighting the Principes).

    Conclusion: the AI does consider mount_effects to the extent of its attack selections. However, it doesn't appear to choose its fights if the player initiates combat—it fights rather than running as it should. The AI also doesn't quite seem to understand maneuvering around an unfavorable fight, at least not consistently.

    -Simetrical
    TWC Administrator

    MediaWiki Developer

  5. #5
    Magister Vitae Senior Member Kraxis's Avatar
    Join Date
    Feb 2002
    Location
    Frederiksberg, Denmark
    Posts
    7,129

    Default Re: Research of the Battlefield AI

    I have noticed continually that eastern generals and the various rebel generals of the same type tend to not want to fight phalanxes long after their ammo has run out. The same is not true for other generals. They let themselves get caught by the phalanx. So apprently a unit with Skirmish can act as it should, maybe because the AI never takes its units off Skirmish.
    You may not care about war, but war cares about you!


  6. #6
    Simulation Monkey Member The_Mark's Avatar
    Join Date
    Dec 2004
    Location
    Helsinki, Finland
    Posts
    2,613

    Default Re: Research of the Battlefield AI

    I'd like to add that one thing that is seriously hampering the AI is its poor handling of player's missile (skirmishers at least) units. If the player has missile superiority (or missiles are roughly even) AI will halt outside (skirmisher) range and then sends units to chase off the skirmishers, with one or two INFANTRY units, who pursue the skirmisher to player's line =>rout. Even if it has cav it will still use mainly infantry against skirmishers. Cav will do flanking manouvers (and charge at some point, unsupported).

    If AI has missile superiority, it will halt for some time to pepper player, but after a while it will still chase player's skirmishers with infantry.

    Without any missile units in battle AI will actually act quite well (but not as well as it should).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO