AI (general): location v. destruction of enemy

A forum for the discussion of the World in Flames AI Opponent.

Moderator: Shannon V. OKeets

User avatar
peskpesk
Posts: 2591
Joined: Thu Jul 17, 2003 5:44 pm
Location: Stockholm, Sweden

RE: AI (general): location v. destruction of enemy

Post by peskpesk »

If we focues only on the defenders choice.

When defending, default choose is assault because:
- Assault gives a higher chance of keeping the hex than Blitz
- Assault inflicts more casualties to attacker than Blitz.
- Assault disrupts the attacker more than Blitz.
- Assault does not give the attacker the chance of a breakthrough.

Possible exceptions are:
- The attacker does not having adequate casualties on hand (usually no divisions just, HQ-A, ARM, MECH).
- The defender needs units more than the hex (usually early war China (Russia sometimes) has ground to give but not units).
- The attacked unit(s) is an expensive or key unit (usually just a single, expensive unit, ex Chinese HQ attacked and the attacker has low cost units to scarify).
- There is a limited risk with a Blitz attack when:
* The effect of a breakthrough is small (usually in bad weather/terrain or the defender has defences in depth behind the hex being attacked or the attacker does not have adequate stack(s) to move into the break).
* The effect a retreat is small (usually all units have valid retreat path).
* The effect on the frontline is small (usually the hex being attacked is NOT a key part of the front).
* The effect of later, mop up attacks are limited (usually late in turn or risk of bad weather or attacker has high chances of being flipped and has a low reorganization capability).
"'Malta - The Thorn in Rommel's Side"
Shannon V. OKeets
Posts: 22136
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: AI (general): location v. destruction of enemy

Post by Shannon V. OKeets »

Thanks.
Steve

Perfection is an elusive goal.
npilgaard
Posts: 176
Joined: Wed May 03, 2006 6:09 pm

RE: AI (general): location v. destruction of enemy

Post by npilgaard »

ORIGINAL: peskpesk

If we focues only on the attacker choice.

The default choose is Blitz, because:
- Blitz gives a higher chance of taking the hex than Assaults
- Blitz inflicts fewer casualties to attacker than Assault.
- Blitz disrupts the attacker less than Assault.
- Blitz gives a chance of a breakthrough.
- Defending units with no valid retreat path are killed.

Two important additions:

If playing with 2D10 CRT then blitz in the open in fine weather with lots af ARM/MECH is crucial to a successful offensive - the blitz-bonuses (e.g. 3 stacks each providing +3 means a +9 bonus - even against a max defended hex with a -5 modifier this still means a net +4 bonus).
So in Russia and late war western front, where there are lots of ARM/MECH blitz is the way to go imho (if nothing else, then because of the huge bonus from multiple blitz-stacks) - only major exceptions is when attacking cities or other non-blitzable hexes, or in non-fine weather. Much better to gather all available blitz-units for a single, high-bonus blitz attack (that will also mean enough units to exploit a breakthrough result) than doing multiple attacks with few blitz-units.

Second: in long summer-turns with expected good weather, breaching the enemy lines and thus forcing him to retreat and make a new line or to leave his units in a poorer defensive position (especially if the attacker manages to breakthrough at two points 2-3 hexes apart - then the defending units in between are unable to escape).
Also, if planning to or using land offensive chits such breakthroughs can be very useful.
Breakthroughs can lead to a somewhat vulnerable position for counterattacks for the attacker, though - especially if the defender has lots of ARM/MECH as well (e.g. in Russia). One way to counter this is to make ground strikes not only at the chosen target hex (or maybe even leaving that hex alone if having enough blitz+odds level bonuses for a unsuccessful attack), but instead ground strike the adjacent hexes. That will limit counterattack capability and leave those flipped units vulnerable to attack next impulse, from 3-4 sides (usually a breakthrough means an additional 1-2 sides on a defending stack if it doesn't retreat into a better position.)

So, imho blitz is by far the best way do attack, even if losing an occasional MECH (btw.imho it is not worth it to build MOTs to take the blitz casualty - better to pay that extra BP and then get a MECH, which provides a +1 blitz bonus).
Regards
Nikolaj
Shannon V. OKeets
Posts: 22136
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: AI (general): location v. destruction of enemy

Post by Shannon V. OKeets »

ORIGINAL: npilgaard
ORIGINAL: peskpesk

If we focues only on the attacker choice.

The default choose is Blitz, because:
- Blitz gives a higher chance of taking the hex than Assaults
- Blitz inflicts fewer casualties to attacker than Assault.
- Blitz disrupts the attacker less than Assault.
- Blitz gives a chance of a breakthrough.
- Defending units with no valid retreat path are killed.

Two important additions:

If playing with 2D10 CRT then blitz in the open in fine weather with lots af ARM/MECH is crucial to a successful offensive - the blitz-bonuses (e.g. 3 stacks each providing +3 means a +9 bonus - even against a max defended hex with a -5 modifier this still means a net +4 bonus).
So in Russia and late war western front, where there are lots of ARM/MECH blitz is the way to go imho (if nothing else, then because of the huge bonus from multiple blitz-stacks) - only major exceptions is when attacking cities or other non-blitzable hexes, or in non-fine weather. Much better to gather all available blitz-units for a single, high-bonus blitz attack (that will also mean enough units to exploit a breakthrough result) than doing multiple attacks with few blitz-units.

Second: in long summer-turns with expected good weather, breaching the enemy lines and thus forcing him to retreat and make a new line or to leave his units in a poorer defensive position (especially if the attacker manages to breakthrough at two points 2-3 hexes apart - then the defending units in between are unable to escape).
Also, if planning to or using land offensive chits such breakthroughs can be very useful.
Breakthroughs can lead to a somewhat vulnerable position for counterattacks for the attacker, though - especially if the defender has lots of ARM/MECH as well (e.g. in Russia). One way to counter this is to make ground strikes not only at the chosen target hex (or maybe even leaving that hex alone if having enough blitz+odds level bonuses for a unsuccessful attack), but instead ground strike the adjacent hexes. That will limit counterattack capability and leave those flipped units vulnerable to attack next impulse, from 3-4 sides (usually a breakthrough means an additional 1-2 sides on a defending stack if it doesn't retreat into a better position.)

So, imho blitz is by far the best way do attack, even if losing an occasional MECH (btw.imho it is not worth it to build MOTs to take the blitz casualty - better to pay that extra BP and then get a MECH, which provides a +1 blitz bonus).
Ok.

What Peter and I are working on is answering the very narrow question of Blitz or Assault CRT, as posed every time, just before a land combat is about to be resolved. I have purposely take a very simple decision point so we can define the language for the AI opponent (LAIO). I expect before the end of the month, I will be able to post a mostly complete rule set for that decision, written in LAIO. By the way this is FM 33, the 33rd decision point in the list of decisions to be made by a Field Marshal (one of the AIO's 8 decision makers - DMs)
Steve

Perfection is an elusive goal.
npilgaard
Posts: 176
Joined: Wed May 03, 2006 6:09 pm

RE: AI (general): location v. destruction of enemy

Post by npilgaard »

33! - there sure is a lot of decisions to be taken at each and every action. The complexity of the AI is quite overwhelming - I am very impressed by the way you handle it.

Regarding the blitz/assault decision:
I think that decision has to be taken much earlier (or at least be considered much earlier). Often an attack in the open is only worth it if blitz can be chosen, otherwise one won't get all those blitz-bonuses, and then the attack will be to risky. So when deciding where to attack, before moving the units into position, the preferred attack-type (blitz or assault) should be determined. Also, if attacking e.g. a city, then those valuable ARM/MECH (/MOT) should not be moved there - leave that attack to MIL/GAR/INF if possible.
So maybe two rounds of combat table decision is required - at the start of the impulse, when deciding target hexes, and then just before the attack.
Regards
Nikolaj
Shannon V. OKeets
Posts: 22136
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: AI (general): location v. destruction of enemy

Post by Shannon V. OKeets »

Here is the first rule that Peter and I put together for the AI Opponent. We are still feeling our way forward but this looks pretty complete.

I think you can figure out how this works without more details from me.

Image
Attachments
AM0503022008.jpg
AM0503022008.jpg (477.45 KiB) Viewed 359 times
Steve

Perfection is an elusive goal.
User avatar
Froonp
Posts: 7998
Joined: Tue Oct 21, 2003 8:23 pm
Location: Marseilles, France
Contact:

RE: AI (general): location v. destruction of enemy

Post by Froonp »

ORIGINAL: Shannon V. OKeets

Here is the first rule that Peter and I put together for the AI Opponent. We are still feeling our way forward but this looks pretty complete.

I think you can figure out how this works without more details from me.
This looks good !!!
User avatar
warspite1
Posts: 41916
Joined: Sat Feb 02, 2008 1:06 pm
Location: England

RE: AI (general): location v. destruction of enemy

Post by warspite1 »

Steve
 
How does the AI "know" to defend against attack?  For example when playing WIF and on the defensive I never wanted to commit my aircraft too early in the turn unless the hex was abolutely vital. 
 
However, if the weather was good for attacking and again I was on the defensive, I would try and counter as many ground strikes as possible to avoid the +1 modifier.
 
What is the process for the AI a) not defending, b) some aircraft defending or c) throwing the Kitchen sink at the enemy?
What is the process for choosing to defend Ground Strikes or waiting and choosing to provide air support in a battle?  
Now Maitland, now's your time!

Duke of Wellington to 1st Guards Brigade - Waterloo 18 June 1815
npilgaard
Posts: 176
Joined: Wed May 03, 2006 6:09 pm

RE: AI (general): location v. destruction of enemy

Post by npilgaard »

Looks very good!
Good rules of thumb you are using.

A few comments:
I assume that ACV is an overall value of the AC (how is the ACV defined?)

I think maybe some kind of 'how-important-is-success-of-the-mission'-variable, and a 'high-importance-AC'-flag is needed.
With low mission importance it can be worthwhile to abort if things start looking bad. In such case, it is often better to have the best AC (ACV value-wise or if 'important') in the back, to avoid it being shot down (especially if playing without the bounce optional rule).
E.g.: carrying out an escorted not-to-important bombing mission on land having both LNDs and a single long range NAV with few land bombing factors which doesn't have anything better to do atm, but which will be needed for ASW next turn - in that case it might be better to place the important NAV in the back to protect it (even though it has only a few factors), and then just abort if things look bad.

Other 'important' ACs could be (assuming playing with relevant options):
7-range CVP (if playing with the search bonus option, and only a few 7-range are available)
white-circle bombers
long range NAV if needed against fx ASW
red-circled AC if facing lots of ARM/MECH
Late game: LND capable of carrying A-bomb
Long range FTR if needed to reach high sea box
LBA FTR in naval air battles if plenty of CVPs (to maintain the +1 bonus) - especially if plenty of CVPs are in reserve
Night fighters if risking enemy night missions in the near future
Long range FTR is facing a large front and has little air cover
FTR with naval air factor if required to maintain supply

If more than one or two of one of the above is available, then their 'importance' decline, since losing one of them is not a crucial blow, and their special abilities are probably included in the ACV anyway (?).

Night missions:
Night fighters always in front, except if much poorer than other FTR

Btw - what does difficulty 4 mean?
Regards
Nikolaj
User avatar
Norman42
Posts: 206
Joined: Fri Feb 08, 2008 10:09 pm
Location: Canada

RE: AI (general): location v. destruction of enemy

Post by Norman42 »

I'm not sure what the term ACV stands for ...Air Combat Value? Is it a production cost value? 
 
Bombing factors wouldn't be the only variable in the choice of front bomber.  Since a 4 engine bomber costs 2x more and takes 2x longer to produce then a 1 engine bomber it might be worth protecting even at a potentially slight downgrade in bomb factors getting through.  In sorting out these front bombers you might choose a (2) cost bomber as front aircraft instead of a (4) cost bomber depending on the situation, even if the (2) cost aircraft had superior bomb factors.
 
An example:
 
The Commonwealth has 2 bombers going on a Ground Support Mission: one 1937 Fairey Battle (2 tac factors, 2 cost), and one 1940 Halifax Mk1 at extended range (1 tac factor, 4 cost).
 
You would very likely put the cheap 2 cost bomber front and have a better chance of surviving with the 4 engine bomber, especially if you only need 1 bomber to get through to achieve your goals. As well the Halifax bombers values are being artificailly deflated due to extended range in this particular fight, further pushing the potential risk of a superior aircraft.
 
Perhaps use something like (Modified Bomb Value + Aircraft Cost)/2 to represent the comparative values for choosing front aircraft.
 
In the above example that would make the 1 engine Fairy Battle have a 2 value, and the 4 engine Halifax have a 2.5 value, putting the better aircraft (the Halifax) in the rear (safer) position.
 
 
-------------

C.L.Norman
User avatar
peskpesk
Posts: 2591
Joined: Thu Jul 17, 2003 5:44 pm
Location: Stockholm, Sweden

RE: AI (general): location v. destruction of enemy

Post by peskpesk »

Combat Values
The combat value of any land unit on the map is measured in CVs.
Conceptually, the CV cost of losing a unit on the map measures the unit’s combat worth.
The simplest case is setting the value for a 6-4 infantry unit. It’s strength is 6 and that gives it an CV of 6.

Air Unit Combat Values
For an air unit, its CVs (ACVs) depend on its primary purpose: air-to-air factor for fighters,
and tactical, strategic, and naval factors for bombers. Air transport units (ATRs) are handled differently.

/Peter
"'Malta - The Thorn in Rommel's Side"
Shannon V. OKeets
Posts: 22136
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: AI (general): location v. destruction of enemy

Post by Shannon V. OKeets »

CV is Land combat value; ACV is an Air combat value; and NCV is a Naval combat value. The last two can be converted to CVs when necessary.

Calculation of these is very dependent on the situation. So the unit's factors, range, and cost are only part of the story. The current circumstances in the theater of operations (e.g., whether air to sea factors are crucial because it is the MED early in the war, even if the unit is currently flying a tactical mission) drives the relataive worth of the various factors (tactical, strategic, air to sea, and air to air). If there is a scarcity of fighters, then the air to air rating for a bomber might be worth a lot, or ignored if in the future escorting fighters can be practically guaranteed or there are no enemy fighters.

I expect to have to tweak the parameters for determining ACV and NCV as part of the AIO development/refinement process.

For every example I gave for ACV, a comparable one can be said about NCV as well.
------------
This rule set for AM 05 is narrowly focused. It does not know how the units became engaged in air to air combat. Its awareness of the mission is indirect, in that the overall value of the bombers accomplishing the mission is all that it is concerned with.

Whether to stay for another round or not, which casualties to take/inflict, etc. are all separate decisions. Just as they are for human players.
Steve

Perfection is an elusive goal.
npilgaard
Posts: 176
Joined: Wed May 03, 2006 6:09 pm

RE: AI (general): location v. destruction of enemy

Post by npilgaard »

ORIGINAL: Shannon V. OKeets
Calculation of these is very dependent on the situation. So the unit's factors, range, and cost are only part of the story. The current circumstances in the theater of operations (e.g., whether air to sea factors are crucial because it is the MED early in the war, even if the unit is currently flying a tactical mission) drives the relataive worth of the various factors (tactical, strategic, air to sea, and air to air). If there is a scarcity of fighters, then the air to air rating for a bomber might be worth a lot, or ignored if in the future escorting fighters can be practically guaranteed or there are no enemy fighters.

Sounds very good indeed! Looking forward to face such a well-thought-out AI [:)]
Regards
Nikolaj
User avatar
composer99
Posts: 2931
Joined: Mon Jun 06, 2005 8:00 am
Location: Ottawa, Canada
Contact:

RE: AI (general): location v. destruction of enemy

Post by composer99 »

Wouldn't you have a provision for sorting bombers by air-to-air rating (highest first) if there are no fighters? I do not see one in the code - I do see a call to sort the bombers by a2a rating; just not under those specific circumstances.
~ Composer99
Shannon V. OKeets
Posts: 22136
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: AI (general): location v. destruction of enemy

Post by Shannon V. OKeets »

ORIGINAL: composer99

Wouldn't you have a provision for sorting bombers by air-to-air rating (highest first) if there are no fighters? I do not see one in the code - I do see a call to sort the bombers by a2a rating; just not under those specific circumstances.
You're right. I'll fix that so there is a check for no fighters as the first condition to check for sorting bombers.
Steve

Perfection is an elusive goal.
Shannon V. OKeets
Posts: 22136
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: AI (general): location v. destruction of enemy

Post by Shannon V. OKeets »

Here is the revised rule set.

Rule Set
// ****************************************************************************
// This rule set uses the following variables:
// FFighters = friendly fighters
// FBombers = friendly bombers
// TestPhase = phase of the game for which the rule is being executed. Typically this is
// equal to Phase, but the rule can also be used to evaluate hypothetical situations.
FighterList := FFighters
BomberList := FBombers
TestPhase := Phase
// ****************************************************************************
// Primary rule
// ****************************************************************************
// If there is none or one fighter and none or one bomber, there is no decision to make.
// ****************************************************************************
IF FighterList^Count > 1
THEN R.SortFighters

IF BomberList^Count > 1
THEN R.SortBombers
// ****************************************************************************
// There is more than one fighter, either intercepting or flying escort.
// Sort fighters in descending order by air-to-air factor, break ties by ACV.
// ****************************************************************************
R.SortFighters
SORT (FighterList, Air2Air, DESC, ACV, ASC)
// ****************************************************************************
// There is more than one bomber/air transport.
// ****************************************************************************
R.SortBombers
IF FighterList^Count = 0
// ****************************************************************************
// There are no fighters; sort so the bomber with the best air-to-air is in front, break ties by ACV.
// ****************************************************************************
THEN SORT (BomberList, Air2Air, DESC, ACV, ASC)
ELSE IF TestPhase IN (pGroundSupport, pGroundStrike)
// ****************************************************************************
// Sort so least capable bomber is in front, break ties by ACV.
// ****************************************************************************
THEN SORT (BomberList, Tactical, ASC, ACV, ASC)
ELSE IF TestPhase IN (pAirSupply)
// ****************************************************************************
// Sort least capable bomber is in front, break ties by ACV.
// ****************************************************************************
THEN SORT (BomberList, AirTransport, ASC, ACV, ASC)
ELSE IF TestPhase IN (Air transport, pParadrop)
// ****************************************************************************
// Sort so bomber with least valuable cargo is in front, break ties by transport’s ACV.
// ****************************************************************************
THEN SORT (BomberList, TransportedBy^CV, ASC, ACV, ASC)
ELSE IF TestPhase IN (pStrategicBombardment, pCarpetBombing)
// ****************************************************************************
// Sort so least capable bomber is in front, break ties by ACV.
// ****************************************************************************
THEN SORT (BomberList, Strategic, ASC, ACV, ASC)
ELSE IF TestPhase IN (pPortAttack)
// ****************************************************************************
// Sort so least capable bomber is in front, break ties by ACV.
// ****************************************************************************
THEN SORT (BomberList, AirSea, ASC, ACV, ASC)
// ****************************************************************************
// Sort so the least valuable bomber is in front.
// ****************************************************************************
ELSE SORT (BomberList ACV, ASC)
Steve

Perfection is an elusive goal.
User avatar
warspite1
Posts: 41916
Joined: Sat Feb 02, 2008 1:06 pm
Location: England

RE: AI (general): location v. destruction of enemy

Post by warspite1 »

Steve: Re my questions in post 68, how will the AI decide what aircraft to fly to a given hex whether in attack or defense?  
Now Maitland, now's your time!

Duke of Wellington to 1st Guards Brigade - Waterloo 18 June 1815
Shannon V. OKeets
Posts: 22136
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: AI (general): location v. destruction of enemy

Post by Shannon V. OKeets »

ORIGINAL: warspite1

Steve: Re my questions in post 68, how will the AI decide what aircraft to fly to a given hex whether in attack or defense?  
A very difficult question.

Where to begin?

Air units are built by the Manufacturing Council as a trade off of how to spend the available BPs. There are several DMs (decision makers) providing input to that: MC wants fighters and AA to defend against strategic bombing and convoys to build/maintain the convoy pipelines, Foreign Liaison wants to send BPs to allies, Grand Strategist wants strategic bombers and fighter escorts for strategic bombing missions against the enemy, JCS potentially wants all combat unit types to fulfil requests by the Air Marshal, Admiralty, and Field Marshals. What to build is one of the hardest decisions.

Once the air units arrive as reinforcements, the Air Marshal assigns them to theaters of operations, which may put them under the control of the MC, GS, AD, or FM, for the purposes described above.

Those DMs get to use their air units as they see fit. Bascially, they have made the case to the AM that the value of each air unit for their air missions is higher that the value for other air missions. So, the Admiralty might have a fighter to fly on a naval air mission, and the MC is not going to have it available to defned against Strategic bombing. I might put in emergency exceptions, but they would be just that.

Therefore, a Field Marshal knows which air units are his to use during the turn. It is up to him to make the trade-offs between offense and defense. Note that each air unit has an ACV that can be translated into a CV (land combat value), so the FM can decide whether the risk to the air unit flying a mission is justified by how it will lower the risk to a land unit.

The squishy area is how to incorporate the value of a hex (e.g., losing Paris/Leningrad/London) into this mix.
Steve

Perfection is an elusive goal.
User avatar
warspite1
Posts: 41916
Joined: Sat Feb 02, 2008 1:06 pm
Location: England

RE: AI (general): location v. destruction of enemy

Post by warspite1 »

Also - just a few random thoughts at present:
- Re-basing after an attack or defense.  If Germans say in Russia in 41 or 42 for example, need to rebase fighters as far forward as possible.  If on the defensive, need to ensure they are not on the front line in case the hex is lost while they are flipped.
- Needs to have a random element to avoid the human knowing what the AI will do.  E.g the attack on Poland.  Sometime the Polish aircraft fight and sometimes not (to save the pilot for the CW).
- Early in the turn as a general rule do not commit all aircraft too soon.
- On key hexes make defence of ground strikes a goal to avoid the + 1, other wise better off taking the hit and providing defensive bombing factors.
- I think all options should have a % based randomness to avoid predictability. For example despite the comment on defending against ground strikes above, the AI should sometimes defend non-key hexes anyway so the human cannot confidantly know the hex won`t be defended.
- Finally can the AI scan to check who has air superiority in a given hex and again have its decision partly influenced by that?
 
Thats all I can think of for now and am just thankful I do not have to try and program this!!
Now Maitland, now's your time!

Duke of Wellington to 1st Guards Brigade - Waterloo 18 June 1815
Shannon V. OKeets
Posts: 22136
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: AI (general): location v. destruction of enemy

Post by Shannon V. OKeets »

ORIGINAL: warspite1

Also - just a few random thoughts at present:
- Re-basing after an attack or defense.  If Germans say in Russia in 41 or 42 for example, need to rebase fighters as far forward as possible.  If on the defensive, need to ensure they are not on the front line in case the hex is lost while they are flipped.
- Needs to have a random element to avoid the human knowing what the AI will do.  E.g the attack on Poland.  Sometime the Polish aircraft fight and sometimes not (to save the pilot for the CW).
- Early in the turn as a general rule do not commit all aircraft too soon.
- On key hexes make defence of ground strikes a goal to avoid the + 1, other wise better off taking the hit and providing defensive bombing factors.
- I think all options should have a % based randomness to avoid predictability. For example despite the comment on defending against ground strikes above, the AI should sometimes defend non-key hexes anyway so the human cannot confidantly know the hex won`t be defended.
- Finally can the AI scan to check who has air superiority in a given hex and again have its decision partly influenced by that?

Thats all I can think of for now and am just thankful I do not have to try and program this!!
Yes, I have these items listed. For randomness I prefer 3 categories: always do good stuff, never do bad stuff, and only randomize stuff in between.
Steve

Perfection is an elusive goal.
Post Reply

Return to “AI Opponent Discussion”