Field of Glory 2 Developers Diary - A.I.

Field of Glory II is a turn-based tactical game set during the Rise of Rome from 280 BC to 25 BC.
Daniele
Slitherine
Slitherine
Posts: 833
Joined: Thu Oct 02, 2014 9:17 am

Field of Glory 2 Developers Diary - A.I.

Post by Daniele »

The AI for FOG2 has been developed by building on the knowledge gained from developing the generally praised AI for Pike and Shot and Sengoku Jidai.

Deployment
For non-preset scenarios, it is important that the AI can deploy its army in a sensible formation, taking account of the prevailing terrain.
Generally speaking, most ancient armies would deploy with an infantry centre in one or more lines. (Usually three for Romans, usually only one for Hellenistic armies). They would then have cavalry on both wings and perhaps in reserve, plus light troops both in the centre and on the wings.

Except for cavalry armies, the “autodeploy” routine therefore starts with the infantry centre, in one or more solid lines. If the army has a mixture of heavy and medium foot, it will deploy the heavy foot where the terrain is most open, and the medium foot where it is most uneven. This takes into account not just the deployment line but also the map in front of where the line will advance.

If it is possible to rest one flank of the infantry on a river or a coastline, it will do so.

Cavalry are then assigned to each wing depending on the amount of adverse terrain on each wing. More cavalry will be deployed on an open wing than on one with lots of rough or difficult terrain or a river. Some cavalry may be assigned to a reserve behind the infantry.

Light troops are then assigned in a similar way to the cavalry, but more light foot will be deployed on the wing with more terrain, and more light horse on the more open wing.

For cavalry armies, the cavalry is divided into centre and two wings, and the usually weak infantry deployed at the back in reserve.

High Level AI
This level of AI governs the actions of the main divisions of the army – the centre, the wings, the reserve, and the various groups of light troops. For pre-set scenarios, it is usually scripted specifically to fit the scenario, but for custom and campaign battles a generic but highly-detailed AI script is used to make a sensible initial plan and then react appropriately to subsequent enemy actions.

This “AI_Masterplan” script refreshes its plans every turn. It takes into account not only the initial divisions into which the enemy army is divided, but any changes to those divisions. Thus, if most of the enemy left wing cavalry rides across to reinforce its right wing, the AI will reassign those units to the enemy right wing before making its plans for the turn.

The first decision the AI makes is whether to advance from the outset. A primarily infantry army will not do so, for example, if its infantry are outmatched, taking into account any high ground the enemy army may occupy.

If the infantry are not advancing, the cavalry wings will also usually hang back, so that they cannot be defeated piecemeal by the enemy before the infantry engage. Even if the infantry are advancing, the cavalry will not forge ahead unless they outmatch the enemy cavalry on that wing and are not facing enemy non-light infantry.
Likewise the light troops will not advance too far ahead, unless they overmatch their counterparts on the enemy side.

Low Level AI
This is what governs the behaviour of the troops once they approach the enemy. Numerous things are taken into account. For example:
• Heavy troops will try to avoid terrain that would disorder them.
• Units won’t advance into situations where they could be charged in flank or rear. (Although non-lights will ignore lights for this purpose.) If they can’t avoid being flanked they will form square if pikes, otherwise will turn to leave their flank threatened by the least dangerous enemy unit.
• Units will actively seek out enemy flanks to attack.
• Units pick their chosen target enemy unit for the turn based on their threat to it and its threat to them.
• Units will usually avoid charging enemy who overmatch them in close combat. Such calculations are made using the actual combat resolution mechanisms, taking into account the actual situation (terrain etc.) in which the units will fight.
• Light troops and non-lancer cavalry will evade charges by troops that outmatch them in close combat, unless the enemy is so close that they are likely to be caught and charged in the rear.
• Units with longer range shooting will stop outside the range of enemy shooters.
• Light troops that are close to breaking will retreat out of range of the enemy.

AI development philosophy
From a development point of view, we believe that the AI is the most important part of a wargame, and development of the AI needs to start at the very beginning of the game development process. It also needs, where possible, to work off the actual combat mechanisms rather than using approximate pre-calculated estimates. This greatly improves the quality of its decisions.

Most importantly, the AI needs to be designed by someone who is a skilled wargamer themselves. It is hard enough to make the AI follow an effective plan even if you know what an effective plan is. If the writer of the AI is hazy about this, there is little chance that the AI will play very well.

We also don’t believe that easier difficulty levels should be achieved by nobbling the AI, nor harder ones by giving the AI unfair advantages in the combat or morale mechanisms. Our AI behaves the same at all difficulty levels, and both sides play to exactly the same rules at all difficulty levels without any hidden bonuses and random number tweaks to help the AI.

Instead, we achieve the different difficulty levels by adjusting the balance of the opposing forces – few if any historical battles were fought between exactly equal strength armies.

With six difficulty levels, we are confident that the AI in FOG2 will give players of all abilities an enjoyable challenge.

Excited? We have more content to share in the coming days. Check out our official product page and the forums to be updated on the progress of Field of Glory 2!
Adraeth
Sergeant First Class - Panzer IIIL
Sergeant First Class - Panzer IIIL
Posts: 358
Joined: Mon Jun 29, 2009 8:19 am

Re: Field of Glory 2 Developers Diary - A.I.

Post by Adraeth »

That's why i love so much this system, it has an excellent AI. Thanks again from Pike and shot through SJ to FOG2 and more to come
Solaristics
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 138
Joined: Sun Nov 15, 2009 10:17 am

Re: Field of Glory 2 Developers Diary - A.I.

Post by Solaristics »

It's good to see such attention to detail concerning the AI, and your design philosophy concerning it. My purchase decisions for wargames pretty much hinge on how much emphasis designers put into this area.
JaM2013
Sergeant Major - Armoured Train
Sergeant Major - Armoured Train
Posts: 595
Joined: Fri Mar 29, 2013 1:02 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by JaM2013 »

Is AI going to follow certain battle strategy, or just do variations checks? Personally, i'd prefer if AI was actually using some basic strategic principles of Economy of Force, or would be able to effectively use Refused Flank tactics.. Economy of force is probably the most important thing in combat, where AI needs to be able to assess the power of own and enemy units and distance these units are at, so it could properly decide to use reserves to maximize chances at certain point, instead of just committing them to match the player's behavior..

Small example how it should work - two sides have same strength with cavalry on flanks and infantry in center. Instead of facing cavalry with cavalry and infantry clashing frontally, AI should just refuse one flank and use the cavalry that was on that flank originally, to gain local superiority on another flank, defeat opposing cavalry and outflank the enemy infantry.

Overall, AI that knows how to use these basic strategy principles would be very challenging to beat, these principles were used by every military leader since first documented battle..

and just side note - Refused Flank tactics doesnt have to have one flank "refused" - common was also refusing center or refusing both flanks.. so technically, you would need to have AI that will chose out of four possible battle strategies, and just keep using them thorough the battle...
Image
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28014
Joined: Sun Dec 04, 2005 6:25 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by rbodleyscott »

The AI does decide whether to refuse one or both flanks and/or the centre, and when to commit reserves.
Richard Bodley Scott

Image
Jafele
Lance Corporal - SdKfz 222
Lance Corporal - SdKfz 222
Posts: 26
Joined: Mon Jul 21, 2014 7:18 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by Jafele »

Another classic game! Thanks for the AI development, it´s obvious I will buy this one. :wink:
RFC
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 5
Joined: Mon Nov 10, 2014 6:45 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by RFC »

A definite purchase for me. Looking forward to it.
XOPT13
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 67
Joined: Sun Dec 23, 2012 8:23 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by XOPT13 »

Will it be possible to create a map for 3 or more sides (players)?
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28014
Joined: Sun Dec 04, 2005 6:25 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by rbodleyscott »

XOPT13 wrote:Will it be possible to create a map for 3 or more sides (players)?
Not currently.
Richard Bodley Scott

Image
VegasOZ
Lance Corporal - SdKfz 222
Lance Corporal - SdKfz 222
Posts: 23
Joined: Mon Jun 23, 2014 7:25 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by VegasOZ »

I am starting to have chest pains, headaches and shortness of breath waiting for this game to be released...

PLEASE HURRY...



LOL
Bombax
Staff Sergeant - StuG IIIF
Staff Sergeant - StuG IIIF
Posts: 251
Joined: Sat Jul 02, 2016 1:44 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by Bombax »

The AI is the most important part of a wargame, and development of the AI needs to start at the very beginning of the game development process. It also needs, where possible, to work off the actual combat mechanisms rather than using approximate pre-calculated estimates. This greatly improves the quality of its decisions.
Most importantly, the AI needs to be designed by someone who is a skilled wargamer themselves. It is hard enough to make the AI follow an effective plan even if you know what an effective plan is. If the writer of the AI is hazy about this, there is little chance that the AI will play very well.


I agree that this is the key to a successful game, and it looks like the AI for FoG II will be even more impressive than the already superb AI used in Pike & Shot and Sengoku Jidai. I have never looked forward quite so eagerly to the release of a new computer game!!!
Soar
Sergeant - Panzer IIC
Sergeant - Panzer IIC
Posts: 177
Joined: Sun Jan 12, 2014 10:07 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by Soar »

I wasn't especially impressed with the AI in Sengoku Jidai. Like I've said before on the Sengoku Jidai forums, it kept getting its units shot up piecemeal by marching them into shooting lines in a deep formation instead of a wide one, and deployed its reserves way too far in the back where they had little chance of affecting the actual battle. I can't consider the AI competent when it consistently lines itself up right into a defeat in detail.

Hopefully the AI in FoGII will put up a better fight, if the developers are as serious about improving it as they say. It's an interesting-looking game for sure, and I think I prefer the Greco-Roman Antiquity setting to the East Asian one, but I feel the previous game fell a bit short in this particular aspect.
JaM2013
Sergeant Major - Armoured Train
Sergeant Major - Armoured Train
Posts: 595
Joined: Fri Mar 29, 2013 1:02 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by JaM2013 »

one question regarding AI - in recent youtube videos i have noticed one thing with Pike Phalanx, where AI is quite willing to break own formation and chase enemy units around.. I think this behavior should be adjusted a bit, at least for disciplined phalanx units, which should keep the line standing. This was commonly mentioned by ancient historians when writing about Pyrrhus campaign against Romans, that his veteran pikemen were frustrated by the roman tactics, where if they beat one maniple, another would take its place, but they couldnt press forward, because they would end up being surrounded.

Similar issue was observed during Roman-Macedonian wars, where less experienced formations broke the pike line just to get surrounded and slaughtered. Battle of Pydna was specifically famous for this, as Romans practically presented uneven resistance across the line, and less experienced Macedonians pressed forward where they could, breaking the line and allowing smaller Roman units to get into these gaps, surround the pikemen syntagmas and wiping them out..
Image
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28014
Joined: Sun Dec 04, 2005 6:25 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by rbodleyscott »

JaM2013 wrote:one question regarding AI - in recent youtube videos i have noticed one thing with Pike Phalanx, where AI is quite willing to break own formation and chase enemy units around.. I think this behavior should be adjusted a bit, at least for disciplined phalanx units, which should keep the line standing. This was commonly mentioned by ancient historians when writing about Pyrrhus campaign against Romans, that his veteran pikemen were frustrated by the roman tactics, where if they beat one maniple, another would take its place, but they couldnt press forward, because they would end up being surrounded.

Similar issue was observed during Roman-Macedonian wars, where less experienced formations broke the pike line just to get surrounded and slaughtered. Battle of Pydna was specifically famous for this, as Romans practically presented uneven resistance across the line, and less experienced Macedonians pressed forward where they could, breaking the line and allowing smaller Roman units to get into these gaps, surround the pikemen syntagmas and wiping them out..
That happens in the game when the pikes follow up pushed back enemy.
Richard Bodley Scott

Image
JaM2013
Sergeant Major - Armoured Train
Sergeant Major - Armoured Train
Posts: 595
Joined: Fri Mar 29, 2013 1:02 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by JaM2013 »

i know, im asking if there is some mechanism for more skilled (Veteran) pike units to NOT follow retreating enemy to preserve line.
Image
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28014
Joined: Sun Dec 04, 2005 6:25 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by rbodleyscott »

JaM2013 wrote:i know, im asking if there is some mechanism for more skilled (Veteran) pike units to NOT follow retreating enemy to preserve line.
Not currently.
Richard Bodley Scott

Image
Igorputski
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 300
Joined: Sat Nov 14, 2009 1:08 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by Igorputski »

This is what I have seen in the videos as well. Too many troops are following a retreating unit into a death trap. I'd prefer a random choice from time to time telling these units not to advance. The AI is already at a handicapped level; why have it do something as silly as this whereby the player will just destroy it in the aftermath?

It's the one thing that may keep me from buying this version. At least have it be by some choice depending on where it would be if it did charge. If nothing else is around then I see no reason for it to be halted, but, if there are 3 or 4 enemy units within the rout path then it should hold it's ground or maybe only advance one space.
devoncop
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1636
Joined: Fri Nov 20, 2009 8:46 am

Re: Field of Glory 2 Developers Diary - A.I.

Post by devoncop »

To be fair there are multiple examples of even "disciplined" troops displaying exactly this type of behaviour in this era (and later). I do agree though that veteran infantry should be much less likely to uncontrollably pursue....cavalry were always more likely to pursue regardless.....inconvenient and annoying for players...but not unrealistic.
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28014
Joined: Sun Dec 04, 2005 6:25 pm

Re: Field of Glory 2 Developers Diary - A.I.

Post by rbodleyscott »

Igorputski wrote:This is what I have seen in the videos as well. Too many troops are following a retreating unit into a death trap. I'd prefer a random choice from time to time telling these units not to advance. The AI is already at a handicapped level; why have it do something as silly as this whereby the player will just destroy it in the aftermath?
Shock foot (legions, warbands, pikes, hoplites etc.) follow up pushed back enemy foot. This applies equally to AI and player units, it is not specifically part of the AI.

It is intended to get them into trouble if the enemy has another line - as it did the Macedonians vs the Romans.
devoncop wrote:To be fair there are multiple examples of even "disciplined" troops displaying exactly this type of behaviour in this era (and later). I do agree though that veteran infantry should be much less likely to uncontrollably pursue....cavalry were always more likely to pursue regardless.....inconvenient and annoying for players...but not unrealistic.
Infantry don't pursue routers at all - unless they are warbands or raw troops. (Cavalry do.) The only exception is that infantry who charge fragmented troops who break before contact will complete their charge through the enemy position, which may get them into trouble.
Richard Bodley Scott

Image
devoncop
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1636
Joined: Fri Nov 20, 2009 8:46 am

Re: Field of Glory 2 Developers Diary - A.I.

Post by devoncop »

Thanks for the clarification....in which case not a problem in my view.
Post Reply

Return to “Field of Glory II”