AI for MWIF - Spain

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

Moderator: Shannon V. OKeets

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

AI for MWIF - Spain

Post by peskpesk »

Spain setup AI

Spain Forces
3-3 RES MIL. 2-3 RES MIL, 1-3 INF DIV, 2-5 CAV, 3-1 GAR, 3-3 INF, 4-1 GAR, 4-3 INF, 5-3 INF, 6-3 INF wp, 5-4 MOT, 5-2-3 HQI, 1 FTR2, 1941 6-5 MEC, 1943 7-6 ARM, 7 CA, 1 TRS

Spain has one basic setup strategy:

* Region defence (Normal defence): Spain is divided into regions and each region is given units to face the threat to it, depending on the size of the threat and the priority of the region

Spain has four special setup strategies:

* Capital defence: Is just as the name suggests a setup where the Spain
land units are setup to defend Madrid.
- Primary Region: Madrid

* Hero city Barcelona defence: When faced with a mighty enemy the chance of holding the border is slim, but the mountain region around Barcelona could stop any attacker. The Spanish land units are setup around Barcelona.
- Primary Region: Barcelona

* Hero city Barcelona and Bilbao defence: When faced with a mighty enemy the chance of holding the border is slim, but the mountain region around Barcelona and Bilbo could stop any attacker. The Spanish land units are setup around Barcelona and Bilbo
- Primary Region: Barcelona and Bilbao

* El-Rif (Spanish Morocco) defence: Escaping certain doom and saving the Rock (Gibraltar) is possible by setting up the a significant force of Spanish Forces in Spanish El-Rif (Spanish Morocco), where they can fight on after Spain is incompletely conquered.
- Primary Region: El-Rif (Spanish Morocco)

Spain has five extreme strategies:

* Attack Portugal: An attacking force of units, not needed in defence against the current threat or factory defence, are placed near Portugal to attack it if the chance is given.
- Primary Region: Portugal Border

* Attack France: An attacking force of units, not needed in defence against the current threat or factory defence, are placed near France to attack it if the chance is given. Normally used after the Axis captures Gibraltar and activates Spain while Mainland France is still not in Axis hands.
- Primary Region: France Border

* Attack Morocco: An attacking force of units, not needed in defence against the current threat or factory defence, are placed near Morocco to attack it if the chance is given
- Primary Region: El-Rif (Spanish Morocco)

* Attack Algeria: An attacking force of units, not needed in defence against the current threat or factory defence, are placed near Algeria to attack it if the chance is given
- Primary Region: El-Rif (Spanish Morocco)

* Attack Gibraltar: An attacking force of units, not needed in defence against the current threat or factory defence, are placed near Gibraltar to attack it if the chance is given
- Primary Region: South border, El-Rif (Spanish Morocco)

Declaration of war
Given a GE/IT declaration of war and Western allies control of Spain OR an alignment by the GE/IT OR USSR/Western allies declaration of war and GE/IT control of Spain. The suggested reasoning for the AI could be as below.

Threats to guard against:

* Threat of enemy land units entering Spain from France
* Threat of enemy land units entering Spain from Portugal
* Threat of enemy land units entering Spain from Gibraltar
* Threat of enemy land units entering Spain from Vichey France
* Threat of enemy land units entering El-Rif (Spanish Morocco) from Algeria
* Threat of enemy land units entering El-Rif (Spanish Morocco) from Marroco
* Threat of enemy land units entering El-Rif (Spanish Morocco) from Gibraltar
* Threat of paradrop on/close to Madrid
* Threat of paradrop on/close to Barcelona
* Threat of paradrop on/close to Bilbao
* Threat of invasion from Bay of Biscay
* Threat of invasion from Western Mediterranean sea
* Threat of invasion from Cape St Vincent
* Threat of invasion from Western Mediterranean sea against El-Rif (Spanish Morocco)
* Threat of invasion from Cape St Vincent sea against El-Rif (Spanish Morocco)
* Threat of having the land unit disrupted

Good hopes:
* Chance of intervention from controlling power
* Chance to try to capture Gibraltar
* Chance to try to conquer Portugal
* Chance to try to conquer Morocco
* Chance to try to conquer Algeria
* Chance to try to attack France
* Chance to try to step on facedown allied/axis unit(s)

Simplified data for the setup script:

Threat Levels

* Small: 1-3 DIV or 1-2 CORP/ARMY + or 1 CORP/ARMY + 1-2 DIV
* Medium: More that Small and less than Large
* Large: 5+ CORP/ARMY OR 8+ DIV

Spanish Forces groups:

1939
* Poor: 1-3 INF DIV, 2-5 CAV, 3-1 GAR
* Fair: 3-3 INF, 4-1 GAR, 4-3 INF
* Good: 5-3 INF, 6-3 INF wp, 5-4 MOT
* HQ: 5-2-3 HQI

1941
* Poor: 1-3 INF DIV, 2-5 CAV, 3-1 GAR
* Fair: 3-3 INF, 4-1 GAR, 4-3 INF
* Good: 5-3 INF, 6-3 INF wp, 5-4 MOT, 6-5 MEC
* HQ: 5-2-3 HQI

1943
* Poor: 1-3 INF DIV, 2-5 CAV, 3-1 GAR
* Fair: 3-3 INF, 4-1 GAR, 4-3 INF
* Good: 5-3 INF, 6-3 INF wp, 5-4 MOT, 6-5 MEC, 7-6 ARM
* HQ: 5-2-3 HQI

Spanish Regions

Image

Bilbao
Hexes = Biblao + 1 // 1 hex around
Priority = 1 //1 highest, 5 lowest

Barcelona
Hexes = Barcelona + 1 // 1 hex around
Priority = 1

Madrid
Hexes = Madrid + 1 // 1 hex around
Priority = 2

North coast
Hexes = InvadableCoast(Spain, Bay of Biscay) + 1 // 1 hex inland from the coast
Priority = 4

South coast
Hexes = InvadableCoast Coast(Spain, Cape St Vincent) + 1 // 1 hex inland from the coast

East coast
Hexes = InvadableCoast(Spain, Western Mediterranean sea) + 1 // 1 hex inland from the coast
Priority = 3

South border
Hexes = Border(Spain, Gibraltar) + 1 // 1 hex inland from border
Priority = 3

Portugal border
Hexes = Border(Spain, Portugal) + 1 // 1 hex inland from the border
Priority = 3

France border
Hexes = Border(Spain, France) + 1 // 1 hex inland from the border
Priority = 3

El-Rif (Spanish Morocco)
Hexes = Governed Region El-Rif (Spanish Morocco) // All hexes within the El-Rif (Spanish Morocco) territory
Priority = 5

Simplified logic of the primary rule of the setup script

1 Set the threat level for all Spanish regions

2 Calculate the number of units needed to meet the given threats for all Spanish regions

3 Calculate whether there are extra or too few units to handle all threats

4 Consider using a special defense

5 For all Spanish regions decide how many units each it is assigned.
  • 5a If a Normal defence is chosen, modify allocation of defending units to each Spanish region depending on whether there are extra or too few units.
  • 5b If a Special defense is chosen, the defence has coded how many of the available units the primary region(s) is assigned. The rest of the units are assigned like by Normal defence.


6 Sort all Spanish regions according to their threat level and priority

7 For all Spanish regions pick which units it is assigned.
  • 7a Assign 1 poor unit to each region with a Small threat level, until there are no more poor units, or no more regions with a Small threat level. The
    purpose behind doing this is to limit the number of good or fair units given
    to regions with a Small threat level. Note that this does not apply to
    regions with a No threat level that have 1 unit allocated (e.g., regions with
    a priority of 1 or 2).
  • 7b Assign 1 good unit to each region with a Large threat level, until there are
    no more good units, or no more regions with a Large threat level
  • 7c Distribute any remaining units


8 The exact placement of units in each region is decided by a special AIO routine.


Attachments
SpainRegions.jpg
SpainRegions.jpg (251.47 KiB) Viewed 442 times
"'Malta - The Thorn in Rommel's Side"
Shannon V. OKeets
Posts: 22138
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: AI for MWIF - Spain

Post by Shannon V. OKeets »

Intuitively obvious to the casual observer.[;)]

Peter has been working on this for a while, with my assistence.[&o][&o][&o]
---
Peter, since you restricted the definition of a coastal hex to be one that can be invaded, then when determining 1 hex inland from the 'coast', I believe that Seville would not be included (since it is not adjacent to an invadable hex).
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 for MWIF - Spain

Post by Froonp »

ORIGINAL: Shannon V. OKeets

Intuitively obvious to the casual observer.[;)]

Peter has been working on this for a while, with my assistence.[&o][&o][&o]
---
Peter, since you restricted the definition of a coastal hex to be one that can be invaded, then when determining 1 hex inland from the 'coast', I believe that Seville would not be included (since it is not adjacent to an invadable hex).
Don't forget that PARA can assault those coastal hexes that invasion can't invade, for nearly the same benefit.
So when PARA are around, don't fall into the trap of not defending hexes that can't be invaded from the sea, and look for the skies.
Shannon V. OKeets
Posts: 22138
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: AI for MWIF - Spain

Post by Shannon V. OKeets »

ORIGINAL: Froonp

ORIGINAL: Shannon V. OKeets

Intuitively obvious to the casual observer.[;)]

Peter has been working on this for a while, with my assistence.[&o][&o][&o]
---
Peter, since you restricted the definition of a coastal hex to be one that can be invaded, then when determining 1 hex inland from the 'coast', I believe that Seville would not be included (since it is not adjacent to an invadable hex).
Don't forget that PARA can assault those coastal hexes that invasion can't invade, for nearly the same benefit.
So when PARA are around, don't fall into the trap of not defending hexes that can't be invaded from the sea, and look for the skies.
The basic concept behind the logic is supply for the invader, whether he comes by sea or land. The threat level to any hex is aggregated. So, Bilbao has all 3 of the possible threats: land, sea, and air. Every hex has a potential para threat to it, dependnig on the availability and disposition of enemy para units (et al).
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 for MWIF - Spain

Post by Froonp »

ORIGINAL: Shannon V. OKeets

ORIGINAL: Froonp
Don't forget that PARA can assault those coastal hexes that invasion can't invade, for nearly the same benefit.
So when PARA are around, don't fall into the trap of not defending hexes that can't be invaded from the sea, and look for the skies.
The basic concept behind the logic is supply for the invader, whether he comes by sea or land. The threat level to any hex is aggregated. So, Bilbao has all 3 of the possible threats: land, sea, and air. Every hex has a potential para threat to it, dependnig on the availability and disposition of enemy para units (et al).
Coastal hexes have an increased PARA threat, in that after the drop the invaders can debark more units where the para droped, and this hex in which they could not invade initialy turns in into a bridgehead. This was what I meant.

I speak from the experience as the German as having overlooked an invasion in Venice, thinking that Venice was not invadable. The allies came from the air, and Venice was their bridgehead.
Shannon V. OKeets
Posts: 22138
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: AI for MWIF - Spain

Post by Shannon V. OKeets »

ORIGINAL: Froonp
ORIGINAL: Shannon V. OKeets

ORIGINAL: Froonp
Don't forget that PARA can assault those coastal hexes that invasion can't invade, for nearly the same benefit.
So when PARA are around, don't fall into the trap of not defending hexes that can't be invaded from the sea, and look for the skies.
The basic concept behind the logic is supply for the invader, whether he comes by sea or land. The threat level to any hex is aggregated. So, Bilbao has all 3 of the possible threats: land, sea, and air. Every hex has a potential para threat to it, dependnig on the availability and disposition of enemy para units (et al).
Coastal hexes have an increased PARA threat, in that after the drop the invaders can debark more units where the para droped, and this hex in which they could not invade initialy turns in into a bridgehead. This was what I meant.

I speak from the experience as the German as having overlooked an invasion in Venice, thinking that Venice was not invadable. The allies came from the air, and Venice was their bridgehead.
Good point. Shore bombardment support can also be used to aid the paradrop, can't it?
Steve

Perfection is an elusive goal.
User avatar
paulderynck
Posts: 8367
Joined: Sat Mar 24, 2007 5:27 pm
Location: Canada

RE: AI for MWIF - Spain

Post by paulderynck »

Yes.
Paul
User avatar
Froonp
Posts: 7998
Joined: Tue Oct 21, 2003 8:23 pm
Location: Marseilles, France
Contact:

RE: AI for MWIF - Spain

Post by Froonp »

ORIGINAL: Shannon V. OKeets
Good point. Shore bombardment support can also be used to aid the paradrop, can't it?
Sure it can. The only thing that can't be done on coastal hexes that do not have a full all sea hexside, is invasion. All the rest is available. Shore bombardment, debarkation, supply (depending on the rules you use, you may need an HQ in the Bridgehead for debarkation & supply).
oscar72se
Posts: 100
Joined: Mon Aug 28, 2006 3:40 pm
Location: Gothenburg Sweden

RE: AI for MWIF - Spain

Post by oscar72se »

Well, in addition to this there is a +1 bonus for each unit that makes it to the drop. On the other hand I'd like to point out some potential draw-backs with paradrops as opposed to "traditional" sea invasions:
1. It is far easier for an axis player to intercept units invading from the air than from the sea.
2. The paradropping consumes vital air missions (unless using up an OC in a super combined) that could be used for preemptive tac-bombing.
3. Paradropping is far less "sneaky" than a sea invasion because of the positioning of the ATRs and paratroopers, this means that the axis player propably would try to spare 1-2 fighters "just-in-case"
4. Paratroopers are EXPENSIVE and take a long time to build....

I'm not saying that paradropping is a bad idea, I'm just saying that there are elevated risks and drawbacks.

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

RE: AI for MWIF - Spain

Post by peskpesk »

ORIGINAL: Shannon V. OKeets

Intuitively obvious to the casual observer.[;)]

Peter has been working on this for a while, with my assistence.[&o][&o][&o]
---
Peter, since you restricted the definition of a coastal hex to be one that can be invaded, then when determining 1 hex inland from the 'coast', I believe that Seville would not be included (since it is not adjacent to an invadable hex).

Correct, I have not had the time to update the region borders on the map yet, there are several hexes that are not invadable.
"'Malta - The Thorn in Rommel's Side"
User avatar
peskpesk
Posts: 2592
Joined: Thu Jul 17, 2003 5:44 pm
Location: Stockholm, Sweden

RE: AI for MWIF - Spain

Post by peskpesk »

The question is: Against a Small, Medium or Large threat (by invasion/paradrop) how would you defend the north cost of Spain? How many units would the required and where should they normally be placed?

Look on the image:

Image

Ex for a small threat my suggestion is that the standard hexes, in priority order are:
  • Bilbao
  • Port of Ferrol
  • Mountain Hex (62,20)

and that a maximum of three units are assigned to the region.
Attachments
BayOfBiscay.jpg
BayOfBiscay.jpg (111.33 KiB) Viewed 442 times
"'Malta - The Thorn in Rommel's Side"
oscar72se
Posts: 100
Joined: Mon Aug 28, 2006 3:40 pm
Location: Gothenburg Sweden

RE: AI for MWIF - Spain

Post by oscar72se »

If you get your opponent to commit his troops to the northwest of Spain you have gained a lot! I think that a defence of Spain should be focused on bogging down the opponent in the mountains. IMO the key to a successful defence of Spain is taking the fight to the mountains where the odds favor the defender. Therefore the hexes around Bilbao are super important whilst the Port of Ferrol could "be let go". Just defend hex 63,18 and let the invader come from the northwest, he is surely to bogged down and is likely to choose another option instead. If you are to use only three non-divisional units to defend Northern Spain i would put one land unit in each the following hexes:
  • Bilbao
  • Santander
  • In the Wood Hex (63,19), this is a reserve unit. If the invader lands in the northwest this unit rushes to hex 63,18 in order to slow the advance dowin. If he lands in the east this land unit helps there instead.

This way I believe Spain utilizes her troops better. IMO it is very important for a "weak" nation not to defend hexes that doesn't need defending.

Regards,
Oscar
User avatar
composer99
Posts: 2931
Joined: Mon Jun 06, 2005 8:00 am
Location: Ottawa, Canada
Contact:

RE: AI for MWIF - Spain

Post by composer99 »

I would agree with Orm's proposed unit placement. The best way to stop an invasion of northern Spain by sea is to boost the notional and kill the invaders on the beaches. If they get ashore and have flipped your units in the rear, you can't stop them from pressing inland. In particular, if the Allies have just declared war on Spain and they are invading from the north, the notional will be 0 factors anywhere where you don't have a ZoC.
 
Of course, if the Allies are smart they will have threats to Spanish Morocco and southern Spain as well so as to stretch the Spanish defenders everywhere.
~ Composer99
oscar72se
Posts: 100
Joined: Mon Aug 28, 2006 3:40 pm
Location: Gothenburg Sweden

RE: AI for MWIF - Spain

Post by oscar72se »

I agree, it would be ideal to try to stop the invaders from getting ashore. But given the number of defenders and possible number of invasion hexes, you must choose what to prioritize. A defending unit in the northwest is a unit not defending in the south. My experience is that if the allied player really, really wants to invade somewhere he will propably be successful. The only thing the axis player can do is try to make it as difficult as possible.

So, let the invader enter the beaches in the northwest and then swarm the mountains where there is no shore bombardment, double movement costs and double defensive factors...

Regards,
Oscar
User avatar
praem
Posts: 78
Joined: Sat Dec 15, 2007 10:38 am

RE: AI for MWIF - Spain

Post by praem »

I've never tried to either defend nor invade Spain by sea, but looking at the map, given 3 corps I think I'd place them like this (in order of priority):
1 corps in Bilbao (protect that factory)
1 corps in the on the resource-hex (ZOC on two minor ports og Vigo and Ferrol and 1 coastal hex)
1 corps in hex 62:20 - ZOC the rest of the northen beach
 
Given 1 more corps, I'd place that in Santander - if one more, then beef up the defence of Bilbao.
 
 
User avatar
Mad Russian
Posts: 13255
Joined: Sat Mar 15, 2008 9:29 pm
Location: Texas

RE: AI for MWIF - Spain

Post by Mad Russian »

Spain is in a bad way. They have to defend against both an Axis and an Allied attack and the defenses are greatly different depending on which side attacks them.

If the Axis comes there will be no stopping the flood. In that case it's just a matter of how long you can hold out and how soon the Allies can come to your aid. With a little luck and no Allied support, for even an average length turn, the war in Spain can be over before you know what hit you.

If the Allies come they generally won't get Spain in a single turn. That allows the Axis a turn to respond which is good since they are generally not in a position to support Spain. Any uncommitted Italian naval units can play an extremely important role in Spain's survival. As can any Axis ground units that can get close enough to support the defense.

Good Hunting.

MR
The most expensive thing in the world is free time.

Founder of HSG scenario design group for Combat Mission.
Panzer Command Ostfront Development Team.
Flashpoint Campaigns: Red Storm Development Team.
User avatar
Orm
Posts: 28028
Joined: Sat May 03, 2008 7:53 pm
Location: Sweden

RE: AI for MWIF - Spain

Post by Orm »

ORIGINAL: peskpesk

The question is: Against a Small, Medium or Large threat (by invasion/paradrop) how would you defend the north cost of Spain? How many units would the required and where should they normally be placed?

Look on the image:

Image

Ex for a small threat my suggestion is that the standard hexes, in priority order are:
  • Bilbao
  • Port of Ferror
  • Mountain Hex (62,20)

and that a maximum of three units are assigned to the region.

Looks like a nice defence against a minor invasion.

Against a major invasion I would place 4 to 6 units to defend against an invasion from Bay of Biscay.

1 strong unit in Bilbao
Resource-Hex(62,18)
HQ in forest Hex(64,20)
Mountain Hex(62,20)

Or perhaps even:
2 units in Bilbao. ( 1 corp and 1 div)
1 corps in each the minor ports of Vigo, Ferrol and Satander.
1 corps in Mountain Hex. (62,20)
And the HQ in the forrest hex for supply in fine weather. (64,20)

If the force invading has major air and shore bombardment it might be wise to abandon the costal defence and defend one hex behind or even two hexes. Are not the setup areas a bit small?
Have a bit more patience with newbies. Of course some of them act dumb -- they're often students, for heaven's sake. - Terry Pratchett
User avatar
Froonp
Posts: 7998
Joined: Tue Oct 21, 2003 8:23 pm
Location: Marseilles, France
Contact:

RE: AI for MWIF - Spain

Post by Froonp »

ORIGINAL: Mad Russian
If the Axis comes there will be no stopping the flood. In that case it's just a matter of how long you can hold out and how soon the Allies can come to your aid. With a little luck and no Allied support, for even an average length turn, the war in Spain can be over before you know what hit you.
Still assuming that you refer to ancient WiF versions, I have to add that in WiF FE you have to control the capital PLUS any factory hex in the country to conquer it.
In your old time, conquering Madrid was enough, now you also need Bilbao (Mountain) and Barcelone (mountain + difficult access from the north).
I can assure you that the Axis invading Spain from the Pyrenees won't conquer it in 1 turn without a stroke of good luck or very bad allied play.
christo
Posts: 99
Joined: Wed Nov 23, 2005 11:00 pm
Location: adelaide, australia

RE: AI for MWIF - Spain

Post by christo »

ORIGINAL: Mad Russian

Spain is in a bad way. They have to defend against both an Axis and an Allied attack and the defenses are greatly different depending on which side attacks them.

snip

If the Allies come they generally won't get Spain in a single turn. That allows the Axis a turn to respond which is good since they are generally not in a position to support Spain. Any uncommitted Italian naval units can play an extremely important role in Spain's survival. As can any Axis ground units that can get close enough to support the defense.

Good Hunting.

MR

Just a query..
In peoples experience, how many games have the allies attacked a neutral Spain? There is no way that they could do it early in the game and when they are on the offensive it does not make much sense to make a new enemy, give Adolf factories, several resources and fantastic defensive terrain. Granted this does need to factored in as a possible for the AIO but 99.9% of the time the aggressor is the axis.
User avatar
Froonp
Posts: 7998
Joined: Tue Oct 21, 2003 8:23 pm
Location: Marseilles, France
Contact:

RE: AI for MWIF - Spain

Post by Froonp »

ORIGINAL: christo
Just a query..
In peoples experience, how many games have the allies attacked a neutral Spain? There is no way that they could do it early in the game and when they are on the offensive it does not make much sense to make a new enemy, give Adolf factories, several resources and fantastic defensive terrain. Granted this does need to factored in as a possible for the AIO but 99.9% of the time the aggressor is the axis.
Never seen (about 20 games played).
Post Reply

Return to “AI Opponent Discussion”