Page 1 of 1

FoF AI

Posted: Thu Dec 04, 2008 1:51 pm
by siRkid
Last night I was happy to get into a huge detailed combat, 90K on each side. I was on the defense so I set up like I normally do, a line mid map running from top left to bottom right. It was raining so visibility was low. To my horror the entire Union army showed up on my right flank. I thought I’m in for it now. However, the AI made a very bad move. It slid all of its units across my line to the left flank. By the time it repositioned, I had decimated the Union units. Looking back the AI almost always shifts to my left flank but never really makes a forceful attack. If the AI had of slammed into my right flank with everything, it would have won the battle.

RE: FoF AI

Posted: Thu Dec 04, 2008 2:19 pm
by Rexor
This is an excellent point. I think FoF already has an unusually strong AI, it just needs a few tweaks to become formidable.

RE: FoF AI

Posted: Thu Dec 04, 2008 3:15 pm
by 2ndACR
I noticed that tendency awhile back. My left flank is the strongest. Once the AI hits my lines, it will always start shifting to the left.

RE: FoF AI

Posted: Thu Dec 04, 2008 6:00 pm
by Xerkis
Good to hear it wasn't just me thinking this. no matter what the terrain or situation.
"Out flank em boys.."
"Which flank sir?"
"To the left son. Always to the left."
 

RE: FoF AI

Posted: Thu Dec 04, 2008 9:39 pm
by mishagoe
Noticed the same thing on large engagements.  AI starts on my right and slowly moves to my left, all the while getting chewed up and eventually breaking and retreating off the map.  AI could have had a chance and cleaned up my act, but never follows up the initial attack, and never concentrates on any one point in my defensive line.  Looks as if it's always trying to outflank my left, can't, and get's broken in the process.  Can someone who knows, explain what the AI is trying to do?  Is the code really looking to outflank the enemy or is it just getting confused with too many units to control?  Trying to keep moral up, maybe?  In either case, play would be more challenging if AI simply picked a random point to mass against and pounded that part into the proverbial ground.  As much as I enjoy the tactical battles, the larger engagements are no challenge because of this AI behavior, smaller or midsize still remain fun though. 

Just to be clear, AI does attack at difference points in my line, but the general movement seems to be from my right to my left every time. AI may attack on my left (maybe because of a victory hex on my left, let's say), but again does not follow up the initial attack, regiments route, and moves off to left, next unit saunders by, but most likely is already low on moral having been shot up on it's way down the line, rinse and repeat.

RE: FoF AI

Posted: Fri Dec 05, 2008 3:55 pm
by ericbabe
It's difficult to have the AI "close in the for the kill" at just the right moment.  Code designed to do this all too often ends up making the AI engage in suicidal attacks -- then people write "why does the AI engage in suicidal attacks?"  We spent a while tweaking the aggressiveness of the AI to get it where it's at.  If we were to work on improvements, I think a good mechanism would be to vary the aggressiveness of the AI between battles, so players can't as easily predict just how hard the AI will move at them.  We are working on a FOF patch right now, and I may be able to insert a randomized aggression factor, or to vary the level of aggression during the course of a battle based on global parameters, without too much extension to our schedule. 

For what it's worth, for COG:EE we have made many improvements to the AI along these lines -- both on offense and defense.  If we do a full FOF expansion some day, we may be able to fit many of these improvements back into the FOF engine.

As for explaining how the AI works, the core movement routines for the detailed battle AI are almost 5,000 lines long, so it's not easy to explain the algorithm with anything like concision.  There are several different modes of movement the AI can be in depending on the global situation (advancing, fighting, falling back, retreating, etc.) and there are some variant routines among these modes (different routines for advancing, for instance).  The core of the fighting mode optimizes the best attack a unit can make relative to the best attacks that can be made on that unit from that position, multiplied by a scalar factor.  There are other factors applied to this, such as the vicinity of friendly units, supply, terrain, and so forth.  The way these factors work, the AI does preponderately try to keep its lines together and avoid taking large casualties at the expense of making a strong attack.


RE: FoF AI

Posted: Wed Dec 10, 2008 9:00 pm
by mishagoe
Thanks for the detail on AI routines.
 
Re delaying the patch, I would vote to not delay it.  Randomizing the agressiveness may or may not accomplish a better detail battle experience.  Another solution might be for me to go on the attack to up my entertainment value.  Longer term though it would be nice if the AI routines could be improved (that's of course always nice).  If the new COG:EE routines are a step up, maybe they could ported back into FoF with a future patch? 

RE: FoF AI

Posted: Thu Dec 11, 2008 7:27 am
by Mutation2241
Another point relating to this: I've noticed the AI will send vastly understrength units (brigades that have been badly mauled in previous battles, sometimes containing less then 1000 men) as the first wave of attack in detailed combat, while it has several full-strength units in the 2nd and 3rd wave. The weak brigades are of course more easily repelled than brigades of 2500 or 3000, so its no good for AI's will to fight to do so.
Perhabs there's a possibility that can be applied to AI routines not to make the initial attacks with vastly understrength brigades but rather send his send full-strength units into action first!?