User avatar
squarian
Brigadier General
Posts: 481
Joined: Thu Aug 07, 2008 7:41 pm
Location: Pittsburgh, Pennsylvania

AI notes: concentration and dispersion

Fri Sep 25, 2009 10:47 pm

I've been testing WIA 1775 campaign repeatedly lately, playing British and watching the Yankee AI (normal difficulty, activation and aggression, extra time for AI, low FOW advantage). Here are some observations from that particular scenario & side which I hope prove useful should anyone take a stab at improving Athena's performance. I wish my skills were up to the job, but having taken some time with the AI database files I have to conclude I'm never going to be WIA's Clovis. (Please note that I'm aware of the limits of even the best AI, not asking for miracles, certainly not whining, simply offering experience in the hope it's useful).

First, under 1.05 the AI is much improved - don't know what the "AI help events" in this patch consisted of, but they certainly made a difference. Where the Athena was almost totally passive after the first few turns, with her main forces just sitting in certain strategic cities (especially Philly) and waiting like a deer in headlights, she is now quite busy throwing counter-punches.

Unfortunately, the campaign is still not much of challenge - after the first 12-15 months I routinely manage to dominate the game, which becomes a military procession to victory interrupted by bouts of Yankee whack-a-mole. The main problems seem to be as follows.

Failure to Regroup: Athena will reliably concentrate a good-sized force under Washington, but if (when) this main army is defeated she doesn't seem to know how to regroup. I rarely see another large army after defeating the first, even years later after plenty of time to rebuild and reconcentrate troops. Instead, from that point on Athena will rely on a scattering of smallish forces in various theatres.

Misuse of leaders: Often related to the above point, after the initial engagements Athena doesn't seem programmed to do what a human would do, pull back the remnants or at least the commanders to form a new main force. Instead, Washington will continue to command an ever-shrinking army in a single region, sometimes past the point of absurdity. In my most recent game, he was defeated in Maryland in mid-1776 and driven into the Virginian Appalachians to watch the remnants of his army starve through the winter, spent most of the next campaign leading a handful of units in the same vicinity until tracked down and destroyed utterly, and then suddenly reemerged some time afterward leading an Indian war-party in a raid on Presque-Ile (of all things!). The obvious course would have been to withdraw him and whatever was left of the Continental Army to the Hudson Valley or New England and draw together another field army. Lesser leaders like Gates or Howe behave the same way - once their initial field force is beaten, they hang around leading a few regiments of militia in futile raids on British garrisons.

Dispersal of effort: Granted, AI is never good at long-range planning, but not uncommonly resources which might have been capable of prying a strategic town or two free if they had been concentrated on a single region instead get used in penny-packets - the result in the mid-game is whack-a-mole, with little groups of rebels popping up, only to be run down by my ranger-indian-dragoon columns.

What can be done about these related problems? Is there a parameter for force concentration which applies across the board and which can be adjusted slightly - not too much, since some small-scale raiding is valuable in tying down British garrisons? Is it possible to beef up a "self-preservation" AI routine which would direct the AI logic to pull out of an area and run for cover when nearby enemy forces are overwhelming? Or perhaps a single recurring event can direct Washington to the largest Yankee stack if his own falls below a certain strength, which would at least keep him from wasting his talents leading Indian raids?

Again, I'm not expecting miracles - but it would be a shame if WIA's AI wasn't at least up the standard of AACW, and at the moment I don't believe it is. Finally, even if I can't make sense of the AI files, if there's something I can do to help improve the game, I'm ready and willing.

User avatar
squarian
Brigadier General
Posts: 481
Joined: Thu Aug 07, 2008 7:41 pm
Location: Pittsburgh, Pennsylvania

Sat Sep 26, 2009 5:51 pm

Further thoughts on AI performance (which might belong in the modding forum, but on the ground that I'm still musing on effect of this patch I'll post here).

Misused Leaders: With a toolbox of just ChngLocalIntrst and AIaggro, I suppose there's nothing that can be done about silly developments like Gates leading a supply convoy or the Continental Army consisting of two elements of Indians (Washington's Redskins? :D ). There isn't an event command to move a leader from one force to another which could be conditioned on force size, is there?

Dispersal of effort/failure to regroup: As of 1.05, the Yankee AI is much less passive at start - but if it suffers defeat early on (which it probably will against a human), it needs to shift to a defensive strategy and tone down the aggro.

Essentially, I think some events are needed to teach the AI to run for cover when losing and come out swinging later when the balance of force is improved. Is this technically possible? The trouble with the strategic problem for the AI might be that it is better at holding a specific ground - say, hold on to Vicksburg, Atlanta and Richmond. But Washington's problem was that any ground would do as long as he kept a force in being - even Philadelphia or New York were expendable as long as he kept enough ground to draw recruits and supplies from. AI doesn't do that kind of balancing act very well, but I wonder if it can be helped along?

What event conditions are available to determine whether a faction is winning, and how precise can this determination be made? I've gone hunting for a list of conditions, but all I find is the AACW wiki event-mod page and that list doesn't seem complete.

If it's possible, maybe substantially lowering the aggro in a theatre when the balance of forces in that theatre becomes very lopsided? Is there a condition which can check relative strength in a particular theatre?

User avatar
arsan
Posts: 6244
Joined: Tue Nov 28, 2006 6:35 pm
Location: Madrid, Spain

Mon Sep 28, 2009 12:06 pm

Hi!

Very good comments Squarian! :coeurs:
I’ve been also playing a 1775 campaign as the brits after 1.05 patch was released, so I find very interesting to compare your experience with mine.
In my camping things were somewhat different, as the Ai chose the more traditional “park the continental army at Philly to defend the capital” approach so I didn’t saw Washington leading Indians around. At least its shows variability, what is good for the replayability. :thumbsup:

But there are some good news regarding the AI :w00t: :
- First, check this new post by Pocus.
http://www.ageod-forum.com/showpost.php?p=159919&postcount=23
It seems a bug was introduced this summer on the games AI routines (shared by all games AACW, WIA) that crippled her efforts. That’s the Ai we have been playing against on 1.05. So hopefully we will soon see a new patched .exe and see what she’s able to do with all their routines “on” and with some new tweaks Pocus has been doing on her. :coeurs:

- Second: even with this important bug, you have saw certain improvement on her play on 1775, and what’s better, none of the improvement is because of the 1.05 “AI help” events as these are 100% (or at least 95%) done for the 1775 British AI, not the USA AI. So probably you haven’t still saw them!! ;)

Basically, the new “AI help events” relate to amphibious operations, something the Ai can do but is not very good at. :bonk:
The main one is a “Boston evacuation” event that may fire on the first year of the war and help Athena to extricate her main army trapped at Boston with little supply. If on certain date they are still blocked there by the rebels, the event will evacuate most of the force and make them land on some USA objective on the coast. As in history, New York is one of them, but there are some alternative places that will be chosen randomly. ;)
On my tests I’ve seen the Ai do their own (only partial) Boston evacuation and some other cool amphibious invasions on the coast. But its not 100% guaranteed she will be able to evacuate Boston as soon and as completely as needed to avoid mass starvation on her main army.
So the event helps her a lot and make the campaign much more fun. :thumbsup:
The other big part of the “AI helps” consist on changing the arrival place of some historic reinforcements and the units you but with EP’s. Instead of arriving at Halifax (which ask for some planning to move them by sea to the Colonies) the Ai will receive them on a series of British controlled ports on the Colonies.
This way the reinforcements will be used sooner and better instead of waiting several turns at Halifax for lack of transports or try to move by land across east Canada and arrive at the front in sorrowful state.

Sorry but I know nothing about AI tweaking parameters. Other will have to answer that. :bonk:

But I think Athena may have a specially hard time to play well as the USA in 1775. As you explain, the USA must not seek big engagements with the British or even defend at all cost some places. They mostly have to evade big British stacks, hit all the weak enemy stacks and objectives they find and concede territory as needed to remain alive and more or less fit until the foreign aid arrive. That’s easier said that done against a human player.
Besides, the annually militia disbanding and reforming certainly doesn’t help her to concentrate and organize forces.
All in all, I think he is not doing it so bad, considering all these difficulties and i hope it will improve much with Pocus AI fix. :coeurs:

Have you tried reversing sides on 1775with the last patch?? My experience is that the AI brits are a much more able and fun enemy (with the 1.05 “AI help” tweaks). Give them a try! :)

Cheers!

User avatar
arsan
Posts: 6244
Joined: Tue Nov 28, 2006 6:35 pm
Location: Madrid, Spain

Mon Sep 28, 2009 12:09 pm

squarian wrote:If it's possible, maybe substantially lowering the aggro in a theatre when the balance of forces in that theatre becomes very lopsided? Is there a condition which can check relative strength in a particular theatre?


This i think i know.
Yes, the Ai checks theatre enemy strength.
At least i've seen lines that seem to be that on the AI log the game generates each turn.
Have you checked it?? I don't understand most of it, but it's kind of interesting to see what calculations she does :blink: :D

User avatar
Pocus
Posts: 25432
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Mon Sep 28, 2009 1:17 pm

Thanks for your valuable feedback squarian.

The problem with the AIs in general is that they see the trees, not the forest. The current AI (nicknamed Athena) has already at her disposal several algorithms to concentrate forces, but this is always triggered by local constraints (one is called 'Merge Threatened Groups' ... a too weak stack, in danger of being crushed, will target and try to merge into a stronger one e.g

But there is no overall guideline, like 'on this theater, all mobiles forces no in very important missions should concentrate toward Washington' and such. This would need another level of thinking of the AI that I have not yet started to program (I could with more free time, and gave some thoughts on that already).

Also, already, the AI is thinking in term of relative strength per theater of operation, and is capable of being aggressive in one and defensive in another, thus lending to different missions.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
squarian
Brigadier General
Posts: 481
Joined: Thu Aug 07, 2008 7:41 pm
Location: Pittsburgh, Pennsylvania

Mon Sep 28, 2009 3:39 pm

Arsan & Pocus,

I hadn't noticed Pocus' announcement, so thanks for the link - a broken Athena would explain much, and once she's fixed I hope some of what I've observed will change for the better.

Arsan, after posting, I did go looking for the "AI help events" and couldn't find them in the American files - you've explained my confusion on not finding any there. The Brit helpers only make sense, IMO.

Pocus, a "theatre-level AI" which could help coordinate efforts among individual forces would certainly be a major step forward (but with VGN and RoP on the boards, I'll abide in patience). Would it be possible to have a theatre AI choose its agenda, then use it as a modifier on the selection of agendas by local forces in that theatre, thereby creating some unity of purpose? Or would that just be unnecessary duplication?

Naturally the first thing to do is evaluate Athena's performance after she's fixed, but the point I made earlier about the strategic problem for the American side being difficult for AI is likely still to be valid. If so, it might be a good idea to work up some events to help it along - whether done "in-house" or by modders (which would include me if I could find a comprehensive list of event conditions and actions :bonk :) .

But that's for later - in the meantime many thanks to you both, and especially for your continuing work on these games.

Return to “BoA2: Wars in America”

Who is online

Users browsing this forum: No registered users and 1 guest