Jump to content

Recommended Posts

For something to digest (mostly for Edwin ;) ) while we get there... here is the latest AI planning notes hot off the presses:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; PLAN SCRIPT (Handle AI Planning)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;

; USAGE:

;

; Basic structure of an AI planning event:

; {

; #NAME= Event name (this will be shown as a selectable event under an options menu within the game)

; #POPUP= Event popup text (this will be displayed when the event occurs)

; #FLAG= Will this be a default event for the campaign? (values range [0, 1]; True= 1; False= 0)

; #TYPE= With all other factors satisfied will this be a (values range [0, 2]):

; A) Single check regardless if trigger is satisfied= 0

; B) Multiple check until trigger is satisfied= 1

; C) Reoccuring check until end of game= 2

; #COUNTRY_ID= Country ID associated with this event

; #TRIGGER= Trigger percentage that the event will occur (values range [0, 100])

; #PLAN_ID= What type of plan will this be? (See PLAN_ID_CONSTANTS below)

; #SIZE= How many units should be assigned to this plan?

; #LENGTH= How many game turns (Axis or Allied) should pass before the plan is finalized and/or cancelled?

; #GOAL_POSITION= What is the map position that is the object of this plan?

; #DATE= Date that must be satisfied (in game) for event to occur (format yyyy/mm/dd)

; #STEAL= Set priority by stealing units from other plans (values range [0, 1]; True= 1; False= 0)

; #FRIENDLY_POSITION= Positions that must be under friendly control in order for event to occur

; #VARIABLE_CONDITION= Under what variable conditions will this event occur

; Format: country_id [political_alignment] [min_activation%] [surrendered_flag]

; #TACTICAL_CONDITION= Tactical map position (resource) that currently MUST NOT be threatened for event to

; occur, i.e. plan owner should have tactical advantage over this position

; Format: x,y [tactical_flag]

; #CONDITION_POSITION= Condition positions that will serve to CANCEL the event.

; Looks at distance as well as a selected number of Axis/Allied units as specified by 'alignment' flag

; Format: x,y [min_range, max_range] [min_units, max_units] [alignment]

; }

;

; EXAMPLE:

;

; Sample event for Germany preparing to attack Benelux:

; {

; #NAME= Germany Prepares For War With Benelux

; #POPUP=

; #FLAG= 1

; #TYPE= 2

; #COUNTRY_ID= 5

; #TRIGGER= 100

; #PLAN_ID= 1

; #SIZE= 8

; #LENGTH= 3

; Set goal position of Brussels

; #GOAL_POSITION= 70,16

; #DATE= 1940/01/01

; Set top priority for this plan and use any necessary units from other plans (except Garrison)

; #STEAL= 1

;

; Set friendly positions:

; 1st Line - Berlin

; 2nd Line - Frankfurt

; 3rd Line - Essen

; #FRIENDLY_POSITION= 82,16

; #FRIENDLY_POSITION= 75,17

; #FRIENDLY_POSITION= 74,16

;

; Set variable conditions:

; 1st Line - Poland politically aligned with Allies and surrendered

; 2nd Line - Benelux politically aligned with Allies and not surrendered

; #VARIABLE_CONDITION= 33 [2] [100] [1]

; #VARIABLE_CONDITION= 12 [2] [0] [0]

;

; Set tactical conditions:

; 1st Line - Berlin not tactically threatened

; #TACTICAL_CONDITION= 82,16 [0]

;

; Set dummy condition position (single neutral unit at position 0,0). This is not possible as no

; unit can occupy tile 0,0 so event will not be cancelled due to #CONDITION_POSITION:

; #CONDITION_POSITION= 0,0 [0,0] [1,1] [0]

; }

;

;

; NOTES:

;

; Each event must be preceded by a '{' and end with a '}'

;

; Plan identity is determined by #COUNTRY_ID, #PLAN_ID, and #GOAL_POSITION. A country can only have a

; single plan based on this criteria and will be assigned the first valid plan regardless of duplicate

; script entries (even if the remaining control '#' values are different).

; Note: This will also allow you to set up a variety of plans with the same identity but different

; control '#' parameters where the first 'event' satisfied will be the fist plan assigned (for added variability).

;

; Once the number of turns passed has reached the #LENGTH value for any of the BUILD_UP plans they are

; automatically switched to an applicable OFFENSIVE, AMPHIBIOUS or SEA_TRANSPORT plan. For example, a

; BUILD_UP_AMPHIBIOUS plan that has a #LENGTH= 3 will (after 3 AI turns) automatically become an AMPHIBIOUS plan.

; Note: All successfully converted BUILD_UP plans are given a new #LENGTH value of 5 turns to complete their task.

;

; #GOAL_POSITION - This must be either a Port, City, Capital or Fortress unless it is a #PLAN_ID= GARRISON event.

; More than one #GOAL_POSITION can be set but only for GARRISON plans. If more than one #GOAL_POSITION is set for

; the alternative plans only the first one will be read.

;

; #FRIENDLY_POSITION - This must refer to a land tile.

;

; GARRISON - This plan does not consider #SIZE (always 1 unit). GARRISON plans are only cancelled either by

; condition failure or #LENGTH has been surpassed.

; Note: If you would like a repeating GARRISON plan you can always set it to be #TYPE= 2 with a #LENGTH= 1 and in

; this case it will be constantly reassigned so long as all control '#' parameters are satisfied

;

; BUILD_UP_OFFENSIVE, BUILD_UP_AMPHIBIOUS, BUILD_UP_SEA_TRANSPORT - Thesse plan must have be able to satisfy the

; #SIZE requirement otherwise they will not be assigned.

; Note: BUILD_UP_AMPHIBIOUS or BUILD_UP_SEA_TRANSPORT plans will only be assigned to fully activated countries.

;

; BUILD_UP_OFFENSIVE - Once this plan is successfully converted to an OFFENSIVE plan the game engine will

; automatically declare war once if the goal position still refers to a currently inactive country.

; Note: This plan may also be cancelled (prematurely) and reassessed if the goal position refers

; to a recently activated country (i.e. through diplomacy, events, opponent's declaration of war etc.)

;

; Internally the game engine automatically assigns OFFENSIVE and DEFENSIVE plans depending on the current tactical

; situation. In this case the plan keeps track of several tactical rations. A CANCEL_RATIO is assigned that is

; 1/2 of the plan's START_RATIO. If the CANCEL_RATIO is met then the plan is cancelled and reassessed.

; For example, a CANCEL_RATIO= 1 and a #PLAN_ID= OFFENSIVE would mean that the plan would be cancelled

; if we ever reached a tactical situation of 1-to-1. Meaning tactically the current offensive presence must

; remain greater than the current defensive presence of your opponent. For DEFENSIVE plans a lower CANCEL_RATIO

; value such as CANCEL_RATIO= .5 would mean that the plan's defensive presence is now 2-to-1 in comparison to the

; presence of enemy offensive units. Subsequently this plan would now be cancelled in favor of a new OFFENSIVE

; plan (automatically handled by the game engine). See CURRENT_RATIO formulas below for more details.

;

; The CURRENT_RATIO forumals:

; OFFENSIVE, BUILD_UP_OFFENSIVE, BUILD_UP_AMPHIBIOUS, BUILD_UP_SEA_TRANSPORT ->

; current ratio := tactical defense / tactical attack (threat)

;

; DEFENSIVE -> current ratio := tactical attack (threat) / tactical_defense

;

; A unit's tactical value is calculated as follows:

; LAND/AIR (ATTACK) = (SA + TA + AA + BA) / 4 * unit.readiness / 100 + unit.experience

; LAND/AIR (DEFENSE) = (SD + TD + AD + BD) / 4 * unit.readiness / 100 + unit.experience

; NAVAL (ATTACK) = (NA + CA + UA) / 3 * unit.readiness / 100 + unit.experience

; NAVAL (DEFENSE) = (ND + CD + UD) / 3 * unit.readiness / 100 + unit.experience

;

; Mapwise, the tactical situation is assessed for each unit and resource based on each offensive/defensive unit

; within a 5 tile range (8 tiles for naval units) and by the tactical attack/tactical defense values divided by

; their distance. Note, air units are assessed if they are within general strike range of a unit or resource.

; For AI units the planning and tactical assessments can be determined by selecting an AI unit and then pressing

; the tilde ('~') key. General AI info can be also accessed at any time by pressing the tilde key when nothing

; else is selected.

; Note: This can also be viewed during FoW so don't check unless you really want to know what the AI is up to!

;

; More than one #VARIABLE_CONDITION can be set. Under #VARIABLE_CONDITION you can also list countries

; that have not yet fully entered the war. For example by listing an activation % less than 100% you

; are providing a check where the #VARIABLE_CONDITION country must meet a minimum activation % (but is

; not yet at 100%) in order for the event to occur. To check for a fully activated country simply

; list the activation % at 100%. Each #VARIABLE_CONDITION line will be read using AND logic.

;

; More than one #FRIENDLY_POSITION can be set. #FRIENDLY_POSITION refers to the current side associated with

; this plan. Each #TACTICAL_CONDITION will be read using AND logic.

;

; More than one #TACTICAL_CONDITION can be set. #TACTICAL_CONDITION refers to the current side, i.e.

; country associated with this plan having tactical superiority over the specified map position.

; Tactical superiority can be fine tuned via the TACTICAL_ID flag. Each #TACTICAL_CONDITION line will

; be read using AND logic.

;

; More than one #CONDITION_POSITION can be set. Distance or range checks will be based on the

; specified x,y position. For example if the x,y position is a coastal tile then range checks will

; be made on sea tiles, otherwise if it is a land tile range checks will be made on land tiles only.

; Each #CONDITION_POSITION line will be read using AND logic.

;

; Use the reference values provided for #COUNTRY_ID and not the country names

; Use the reference values provided for #PLAN_ID and not plan names

; Use the reference values provided for TACTICAL_ID and not tactical names

; Use the reference values provided for POLITICAL ALIGNMENT and not names

; Use the reference values provided for SURRENDER flags and not names

;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; COUNTRY ID REFERENCE VALUES

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;

; UK= 1

; FRANCE= 2

; USA= 3

; USSR= 4

; GERMANY= 5

; ITALY= 6

;

; ALBANIA= 8

; ALGERIA= 9

; AUSTRIA= 10

; BALTIC_STATES= 11

; BENELUX= 12

; BULGARIA= 13

; CANADA= 14

; CZECHOSLOVAKIA= 15

; DENMARK= 16

; EGYPT= 17

; ESTONIA= 18

; FINLAND= 19

; GREECE= 20

; HUNGARY= 21

; ICELAND= 22

; IRAN= 23

; IRAQ= 24

; IRELAND= 25

; JORDAN= 26

; LIBYA= 27

; LITHUANIA= 28

; LUXEMBOURG= 29

; MOROCCO= 30

; NETHERLANDS= 31

; NORWAY= 32

; POLAND= 33

; PORTUGAL= 34

; REPUBLICAN_SPAIN= 35

; ROMANIA= 36

; SAUDI_ARABIA= 37

; SPAIN= 38

; SWEDEN= 39

; SWITZERLAND= 40

; SYRIA= 41

; TUNISIA= 42

; TURKEY= 43

; VICHY_FRANCE= 44

; YUGOSLAVIA= 45

;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; PLAN ID REFERENCE VALUES

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;

; GARRISON= 0

; BUILD_UP_OFFENSIVE= 1

; BUILD_UP_AMPHIBIOUS= 2

; BUILD_UP_SEA_TRANSPORT= 3

;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; TACTICAL ID REFERENCE VALUES

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;

; ANY= 0

; LAND= 1

; SEA= 2

; AIR= 3

;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; POLITICAL ALIGNMENT REFERENCE VALUES

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;

; NEUTRAL= 0

; AXIS= 1

; ALLIED= 2

;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; SURRENDERED FLAG REFERENCE VALUES

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;

; NOT_SURRENDERED= 0

; SURRENDERED= 1

;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Link to comment
Share on other sites

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

Well, there you have it, direct from the master programmer himself. Like I said, these scripts are not trivial and we'll all be experimenting with these for a long time. Modders should have a great time with all this. :cool:

Just a comment about the country IDs you see listed. These are not all used in the standard campaigns, but could be used for custom campaigns. Alternatively, any or all countries can be edited with different names and customized flags created.

Link to comment
Share on other sites

Many thanks, this will certainly take some time for me to digest. Looks good. Most interesting.

I already have a few questions (offense vs defense, strategic withdrawal from a region - ie North Africa, movement of naval units, using engineers to build defensive lines), but will hold off on asking till Friday so HC can focus on the AI ;) , and I can study the AI notes in detail.

Many thanks, HC. smile.gif

[ February 13, 2006, 08:02 AM: Message edited by: Edwin P. ]

Link to comment
Share on other sites

The biggest problem I have with computer games is AI predictability.

When I think of an AI, I think of a computer response that learns, that is trained by experience. Most interesting would be if there was an option so that some of these scripts remain modified between games. So, at least in repeated games between the same human opponent and the computer, the computer responds at a basic level to the style of play. Its not really learning, but it would help.

Link to comment
Share on other sites

Since the AI planning events are read in listed order an easy way to add variability is to use the alternate #TYPE and #TRIGGER values.

For example, I could set a possible Sea Lion plan for the AI to pursue as a one time event of #TYPE=0 with a #TRIGGER=50.

What this means is that if all other control '#' factors are satisfied then there is a 50% chance that the Sea Lion plan will take place. Since it is a #TYPE=0 the plan will only be read once and if the #TRIGGER fails the plan will not be executed.

In order to make sure the AI still does something you simply set the subsequently listed plan to have a #TRIGGER=100, meaning this plan will be executed 100% of the time.

By tweaking the various condition values and/or requirement dates the script gives you lots of flexibility towards AI planning. In fact all scripts use the #TYPE and #TRIGGER scheme for this very purpose.

Link to comment
Share on other sites

Just a note to say that I am really impressed by the flexibility included in these AI Scripts.

The Variable Condition will allow one to insure that certain events - ie attacking Vichy France - only occur while Russia is neutral. Perhaps this will be enhanced so an event can only be triggered if; for example, Russian readiness is below XX%., in addition to allowing for conditions where a minimum acitivation % must be met for event acitivation.

Why? I don't want the Axis AI to invade Vichy France or Sweden if Russian readiness is above XX%.

The Garrison plans appear to offer lots of flexibility for forming a defensive line, with one able to set more than one goal position for Garrison plans.

I especially like the number of different plans - Offensive, Build-up Amphibious, Amphibious, Sea Transport, Build-Up Sea Transport and Garrison plans. Though it will take some serious playtesting to see how the tactical AI executes these plans.

One item I do not see mentioned here is a way to allocate; for example, 80% of Air Units and 100% of Armor units to a specific front (ie Russian Front) or 100% of Allied Bombers to England. Nor do I see specific instructions for using special unit types - ie bombers. But this may be coming in future AI notes, or perhaps the AI will know to do this.

The Cancel_Ratio is really a good feature, as it allows the plan - offensive or defensive to be affected by the relative balance of forces, with the AI automatically switching between defensive and offensive plans as the situtation changes.

One item I am looking forward to is creating a Nordic Liberation Script for the Allies, where they will attempt to liberate Norway if it has a status of surrendered while the Germans are still fighting the French.

#NAME= Nordic Liberation Force

#POPUP=

#FLAG=1

#TYPE=1 (Multiple checks until trigger is satisfied)

#COUNTRY_ID=1

#TRIGGER= 20

#PLAN_ID=BUILD_UP_AMPHIBIOUS

#SIZE=4

#LENGTH=8

#GOAL_POSITION= XX,XX (Bergan)

#DATE=

#STEAL=1

#FRIENDLY_POSITION= XX,XX (London)

#FRIENDLY_POSITION= XX,XX (Manchester)

#FRIENDLY POSITION= XX,XX

#VARIABLE_CONDITION=32[1][100][1] (Norway is German Occupied)

#VARIABLE_CONDITION=2[1][100][0] (Germany is focused on fighting the French)

Then another plan will activate (a Garrison Plan) if Norway is liberated from the Axis.

This structure of having a plan's activation triggered by specific conditions is really flexible with Variable Conditions, Tactical Conditions, and Condition_Postion. With the Condition_Position variable you can trigger a plan if a specific title(s) are not occupied or protected by X units in a specific radius. Example: You can tell the AI to take Cairo if there are no Allied units within a radius of X tiles of Cairo. If there are the plan is canceled. I wonder if you can limit this check to exclude Naval Units, as their presence should not influence occupying Cairo. I assume so per, the quote below:

More than one #CONDITION_POSITION can be set. Distance or range checks will be based on the ; specified x,y position. For example if the x,y position is a coastal tile then range checks will ; be made on sea tiles, otherwise if it is a land tile range checks will be made on land
I also wonder if future AI scripts will allow the player to aid the AI in deciding which cities, ports and resource tiles deserve AA improvements (which in SC2 must be purchased on a city by city basis).

Its really going to take a bit of playtesting to explore the full functionality of these AI scripts.

I wonder how I could tell the AI to evacuate North Africa if there are more pressing needs elsewhere. :confused:

[ February 16, 2006, 06:33 AM: Message edited by: Edwin P. ]

Link to comment
Share on other sites

One of my pet peeves about the SC1 AI was that the French Corps in Beruit would never move to UK territory so that it would become Free French upon the surrender of France.

With the new AI scripts it appears that you can have it to just that.

#NAME= Free French or Bust

#POPUP=

#FLAG=1 (Default event)

#TYPE=1 (Multiple checks until trigger is statisfied)

#COUNTRY_ID= 2 (France)

#TRIGGER= 75 (AI will execute 75% of the time)

#PLAN_ID= 0 (Garrison Plan)

#SIZE= 1 (use only 1 unit)

#LENGTH= 3 (It should take 3 turns to move to the Suez Tile)

#GOAL_POSITION= xx,yy (i.e. Suez Canal)

#DATE= 10/01/1939 (occurs after this date)

#STEAL=1

VARIABLE_CONDITION= 6[1][95][0] (unit will not move until Italian War Readiness is 95 or higher)

VARIABLE_CONDITION= 2[2][100][0] (Can only be triggered if French Alignment is Allied and France has not surrendered.

#VARIABLE_CONDITION= Under what variable conditions will this event occur

; Format: country_id [political_alignment] [min_activation%] [surrendered_flag]

In the above script I presume that the French AI would steal the Beruit corps from its garrison duties, as it is the closest French unit, and move it to the Suez Canal tile.

One flag I don't see in the AI script notes so far is an AI_Level flag. The AI event would be canceled if the AI_Level flag was higher than the AI Level. Example: A Script Flaged as AI_Level=5 would only execute if playing the Expert AI (Expert = 5, Intermediate = 4, Beginner = 3,....). AI_Level= 0 would execute at all AI Levels of play. This would allow one to build an AI whose skill appears to increase as the AI level increases from Novice to Expert.

[ February 16, 2006, 06:35 AM: Message edited by: Edwin P. ]

Link to comment
Share on other sites

Many thanks HC. Looking forward to reading your comments when you have time.

In the meantime,

The Naval AI has always interested me, as Naval combat is totally different from Land Combat. Why - Naval ships are expensive. You lose a fleet or two and you will likely never replace it. If the UK loses their navy (as I learned the hard way from Rambo a long time ago when he used his Axis carrier strategy) they are sunk.

So, here goes the first of several attempts at a naval AI. The Goal is to sink the Italian Navy at upon their entry into the war, and then take their ports in North Africa.

Update: Pzgndr used a variant of this strategy in TCIP AAR #2
The plan is broken into three main parts with subparts in each one;

1. Position the Fleets

1b. Move the Royal naval ships to position (GARRISON)

1b. Move the French Naval Ships to Position (GARRISON)

2. Order them to attack once Italy enters the war. (OFFENSIVE)

2a. Royal Navy Offensive

2b. French Navy Offensive

3. Then conquer/liberate Libya.

3a. Sea Transport

3b. Offensive

I wonder if I can link the execution of one plan to another? I.e. if UK chooses to execute Sink Italian Navy Strategy, can I have France always (100%) choose a related plan also? :confused: and also activate the Sea Transport Plans in Phase 3? :confused: I would most certainly not want either the French Navy or the Royal Navy to attempt this on their own. The two fleets operating together can certainly decimate the Italian fleet, but alone, both sides will be decimated and the UK navy too weak to stop a German submarine campaign.

Scripts to Position the Fleets:

{

#NAME= POSITION Royal Navy TO SINK ITALIAN NAVY

#POPUP=

#FLAG= 1

#TYPE= 0 'A single check at the start of the game

#COUNTRY_ID=1 'UK

#TRIGGER= 20 '20% of the time the AI will select this option.

#AI_FLAG= 4 'THE AI will only execute this script at intermediate (4) and higher (Expert=5) AI levels (This Flag is not in the scripts yet, but I think it would be useful, so I am including it as an example of what it could do.)

#PLAN_ID=0 'Garrison plan to station 8 Royal navy ships around Malta, so they will be prepared to strike when Italy enters the war.

#SIZE= 8 'Most of the Royal Navy is committed to this.

#LENGTH=8 'Eight turns to get ships into position

#GOAL_POSITION= xx,yy (sea tile fot 1st fleet)

#GOAL_POSITION= xx,yy (sea tile for 2nd fleet)

#GOAL_POSITION= xx,yy

#GOAL_POSITION= xx,yy

.................

(I assume that you can list more than one Garrison position and that the AI will deploy the units to these positions)

#DATE= / / - This would be the first turn of the game as the fleets must start moving early to be in position.

#STEAL=1

#FRIENDLY POSITION= xx,yy (Gibraltar)

#VARIABLE_CONDITION= 2 [2] [100][0] France has not surrendered and the Royal Navy can count on the support of the French Naval Fleets

#TACTICAL CONDITION= xx,yy Manchester is safe. (I want the AI to cancel this script and recall the navy if the Gemrans launch a sea lion)

Question: I see how the AI responds negatively to a threat; it cancels an event, but I don't see a positive response. IF LONDON is threatened I don't see how I can program the AI to recall all Fleets to defend the England, Scotland and Wales. :confused:

But as you say that the AI executes the scripts in order, perhaps it can be done.

-------------------------------------------

A similar Garrison script would be written to pre-position the French navy.

-------------------------------------------

Scripts to Attack the Italian Navy

#NAME= SINK ITALIAN NAVY

#FLAG= 1

#TYPE= 1 - A recurring check

#TRIGGER=100

Plan_ID= Offensive

#SIZE=8

#GOAL_POSITION= :confused: A port, city, capital or fortress for a naval unit?

Variable_Condition= 6[1][100][0] - Italy has entered the War, though I could use another script for the Expert AI where it would be 10% likely to make a surprise attack on Italy while it is still neutral. :eek:

CANCEL_RATIO=1.3 'The allies must have a 1.3 advantage for this attack to proceed.

[ February 17, 2006, 04:46 PM: Message edited by: Edwin P. ]

Link to comment
Share on other sites

In combat, there are two paths to conflict - threats (offensive actions) and responses (defensive actions).

From my reading of the scripts it handles offensive actions very well, and allows for events to be canceled based on tactical conditions and Condition Postions.

Yet I can't imagine how to create an event that will respond to a threat.

Example: Take my UK expendition to the Mediterranean. If I set the plan to cancel if London or Manchester is threatened does this mean that the Royal Navy will be recalled to the UK or will they merely sit in the Mediterranean.

Example: Axis subs are raiding convoy routes. How can I trigger the Royal Navy to search out and sink these subs or perhaps base a bomber in Iceland or Ireland or Nova Scotia?

Example: Axis forces are building up to Attack Egypt, how do I tell the UK to send reinforcements to Egypt by way of the Horn of Africa, and not via the Mediterranean where they will likely be sunk (unless the reports screen says that they have no navy ;) .

Example: Russian forces are about to cut off the AI controlled armies in the Crimean Peninsula. How can I tell them to withdraw? The current SC1 AI often allows 3 to 4 Axis armies plus an Axis HQ unit to be isolated here in the Fall Blau scenario.

My guess is that HC probably has more commands that he is planning to add later.

---------------------------------------------

What I would like to see is some sort of Conditional flag based on the reports. Then the AI can adjust its actions based on the perceived strengths and weaknesses of the human player.

Ie: Report_Condition:= Unit Count that must not be exceeded for event to occur.

Format: Country_ID [Tactical ID Reference] [limit]

Example: Report_Condition:= 6 [2][4]

I.e. If Italy has 4 or more naval units this event will be canceled. (I assume that the Condition_Position can't be used due to FOW).

6 = Country Code

2 = Tactical ID Reference Value

4 = Unit Count Limit

PS: Perhaps this script, or a variant thereof would also be useful in guiding AI research and purchase decisions?

------------------------------

Example: I am playing Ike99 now in a PBEM game. According to the Reports Screen, after a fierce naval battle the relative naval strengths are:

UK 9 (probably including 1 transport), USA 2, USSR 2, Italy 2 with todate losses of 5 Allied Naval units and 11 Axis Naval Units. Based on this aggressive naval action by the Allies is warranted, and the Axis probably wants to undertake a defensive naval strategy.

Simarily, according to the reports screen, in the game vs Ike99, he has 5 German Air Units and 1 Italian Air Unit. I spotted all of them in the Eastern front when he attacked. That leaves no Air Units in Western Europe. The AI would never take advantage of this, unless FOW is off, but a human player will.

[ February 16, 2006, 07:48 PM: Message edited by: Edwin P. ]

Link to comment
Share on other sites

My guess, and this is purely a guess, is that FLAG= 0 gives you the option of manually selecting an event for a particular game. If you don't want the AI to [For example: invade the USA] then don't select this AI event.

I.e.

FLAG=1 - Means that the event is always selected for this scenario, but can be turned off.

FLAG=0 - Means that the script is user selectable, but normally turned off. It can be turned on.

[ February 16, 2006, 09:59 PM: Message edited by: Edwin P. ]

Link to comment
Share on other sites

My guess, and this is purely a guess, is that FLAG= 0 gives you the option of manually selecting an event for a particular game. If you don't want the AI to [For example: invade the USA] then don't select this AI event.

I.e.

FLAG=1 - Means that the event is always selected for this scenario, but can be turned off.

FLAG=0 - Means that the script is user selectable, but normally turned off. It can be turned on.

Correct
Link to comment
Share on other sites

--Draft Mode ----

In Sc1 the AI never sends the Italian Navy through to the Atlantic after Bombarding the port of Gibraltar to zero, as Human players sometimes do. Perhaps it can be done using the new scripts.

#GOAL_POSITION - This must be either a Port, City, Capital or Fortress unless it is a #PLAN_ID= GARRISON event.
First, if the GOAL_POSITION is a port does this mean that Naval units will attack the port until it is reduced to zero?

If so, then perhaps I can have Italian Naval units sail through the port of Gibraltar tile to an Atlantic Garrison tile(s) once it is reduced to zero. (of course it would be easier with a script for Port_Tile=0 ... ie Activate Script if port tile is zero)

Of course, if the Axis AI controls Egypt - checked with:

#FRIENDLY_POSITION xx,yy - Cairo

#TACTICAL_CONDITION= x,y - to ensure that Egypt is not threatened.

#CONDITION_POSITION= x,y [2,10][3,8][2] - to further insure that no large allied forces are nearby.

Then perhaps a Garrison command is used to send the Italian Naval Task force to the Transit Tiles at the south end of the Red Sea so the naval units can transit the Horn of Africa.

Of course, once these units reach the Atlantic, they need a plan of action. Perhaps positioning themselves off the coast of the USA perepared to sink the American fleet when it enters the war?

or Perhaps moving to interdict Merchant Shipping (Garrison_Plan moves ships to Friendly_Postion of following script) and then moving away (Friendly_POSITION triggers new garrison plan), then moving back to interdict a different tile along the shipping route(GARRISON)and then moving away again (FRIENDLY_POSITION).

-------------------------------------------

Will there be a command that will allow one to send an Italian sub (and not a battleship or cruiser) to a garrison_position in the Mediterranean - so it can inderdict Merchant shipping?

i.e.

#TYPE=2 (Checked each turn, will remain active so long as all control parameters are met)

#PLAN_ID= Garrison or Offensive?

#SIZE=1

#LENGTH=1

#UNIT_TYPE=5 (to specify submarine unit, where 5 = submarine - this parameter is currently not in the AI script notes)

#GOAL_POSITION= xx,yy - Merchant shipping tile in the Mediterranean

#TACTICAL_CONDITION= xx,yy (so that sub will move here only if not threatened)

#TACTICAL_CONDITION= xx,yy (Rome not threatened)

#TACTICAL_CONDITION= xx,yy (Sicily not threatened)

-----------------------------------------

Of course I may not want to execute the send Italian Fleet to Atlantic strategy if Allied Naval Forces are too strong.

Using information from the Reports Menu a Human player can evaluate the strength (Air, Naval and Land) of his opponenet. I wonder if a condition will be added so the AI can do the same?

Example:

REPORT_CONDITION_G= Country_ID [unit type reference value][unit count from the Reports screen]- Condition where the unit count on the Intelligence Report will cancel the event. The G is for Greater Than.

Example:

REPORT_CONDITION_G= 1[2][6] : Cancel Event if UK royal naval fleet units are 6 or more. The G at the end is for Greater than.

Ideally there would be another condition for REPORT_CONDITION_L= 6[2][8] Where the A at the end is for Less Than. Cancel the plan if the Italian Navy has 8 or fewer naval units.

Thus one could have a script that would be executed - based on information from the reports screen - by the Italian AI ONLY if UK Naval Forces are Less than 6 AND Italian Naval forces are greater than 8.

[ February 17, 2006, 10:02 AM: Message edited by: Edwin P. ]

Link to comment
Share on other sites

In refering to HC's above example of an AI script for Germany to attack LC, I don't see a START_RATIO/CANCEL_RATIO entry.

I'm assuming that this is an internal AI game function and a modder will not have control over S_R/C_R entries? Maybe it is dependent on the #SIZE entry? In the above case 8, which would mean 1/2 the start ratio and if cancel ratio=1 then the plan would be cancelled if Benelux has 4 units within a tactical conditon/condition position set for the German plan.

Also the tactical assesment value range is set at 5(land) and 8(sea), again I'm assuming these are not editable, but can be viewed with the ~ key?

[ February 17, 2006, 11:30 AM: Message edited by: SeaMonkey ]

Link to comment
Share on other sites

One concept I can't seem to understand is how to make the AI make a choice between 2 plans with two different goal positions.

Plan identity is determined by #COUNTRY_ID, #PLAN_ID, and #GOAL_POSITION. A country can only have a ; single plan based on this criteria and will be assigned the first valid plan regardless of duplicate ; script entries (even if the remaining control '#' values are different).

; Note: This will also allow you to set up a variety of plans with the same identity but different ; control '#' parameters where the first 'event' satisfied will be the fist plan assigned (for added variability).

Example: Operation Torch or Operation Nordic Liberation

Both would have the same country ID (USA), have the same plan type but different position goals. Perhaps using the Steal parameter will ensure that only one plan will be exected.

Example:

Operation Torch

#TRIGGER=20

#Size = 5

#Steal = 1

Operation Nordic Liberation

#TRIGGER=30

#Size = 5

#Steal = 0

Thus if Operation Torch is selected, Operation Nordic Liberation can't be triggered as it would not have enough units to meet the Size Parameter since it can't steal units from Operation Torch. Is this correct?

Link to comment
Share on other sites

Edwin, you could use the #VARIABLE_CONDITIONS to define certain countries leanings to trigger the operation.

Some countries likely will never be biased to certain percentages and others in the proximity of your operations or because of your operations will change their leanings.

Perhaps TACTICAL_CONDITION parameter to let the AI evaluate which plan is more likely according to the disposition of friendly and enemy units.

Who knows.....right now is time for study and contemplation as we can't really model anything with the game to ascertain the detailed consequences of our AI script entries. We have some definitions and we can get clarifications from HC and we can theorize.

Link to comment
Share on other sites

No no, Hubert, you are not allowed to comment.

You should be programming tongue.gif

But simply, Edwin, as you can see, you'll be able to make the AI as complete as you wish, don't expect Hubert to do so, if he did, the game would not be out for the next 2 years.

Link to comment
Share on other sites

Originally posted by SeaMonkey:

Who knows.....right now is time for study and contemplation as we can't really model anything with the game to ascertain the detailed consequences of our AI script entries. We have some definitions and we can get clarifications from HC and we can theorize.

Agreed. smile.gif
Link to comment
Share on other sites

RE: Engineers. I would like to see scripts where I can tell the AI to use Engineer Units to fortify specific tiles. Then I can use the Plan: Garrison to have those tiles garrisoned under specific circumstances.

Example: Fortify the tiles north and south of Warsaw and have them Garrisonned if Russian units approach. Or perhaps have Engineers create a Seigfreid line to guard Germany against a future Allied Invasion in the West.

Example:

AI event that is 90% likely to execute at Expert Level and 50% at beginner or intermediate. Uses Idea (not approved) for AI_LEVEL condition check.

If the Expert Level Script is triggered then the next script will not be as both have the same Plan Country_ID, Plan_ID, and #Goal_Position.

{

#NAME= Fortify Italy

#FLAG= 1

#TYPE= 1 (multiple check until trigger satisfied - ie will only execute once per game)

#COUNTRY_ID=6

#TRIGGER=50

#PLAN_ID= 4 (Fortify - idea for new plan type, will use only Engineer units)

#AI_LEVEL=5 (will only execute at Expert level -idea for new parameter, not in current AI script)

#SIZE=1

#LENGTH=4

#GOAL_POSITION= xx,yy (tile that will be fortified)

#STEAL=0

#FRIENDLY_POSITION= xx,yy (target tile must be in friendly hands)

#TACTICAL_CONDITION= xx,yy (target tile is not threatened)

#CONDITION_POSTITION= xx,yy [1,10][2,99][2] (No more than 1 enemy Allied unit is within 10 tiles of the tile being fortified)

}

{

#NAME= Fortify Italy

#FLAG= 1

#TYPE= 1 (multiple check until trigger satisfied - ie will only execute once per game)

#COUNTRY_ID=6

#TRIGGER=50

#PLAN_ID= 4 (Fortify - idea for new plan type, will use only Engineer units)

#AI_LEVEL=3 (will only execute at Beginner(3) and higher AI levels - idea for new parameter, not in current AI script)

#SIZE=1

#LENGTH=4

#GOAL_POSITION= xx,yy (tile that will be fortified)

#STEAL=0

#FRIENDLY_POSITION= xx,yy (target tile must be in friendly hands)

#TACTICAL_CONDITION= xx,yy (target tile is not threatened)

#CONDITION_POSTITION= xx,yy [1,10][2,99][2] (No more than 1 enemy Allied unit is within 10 tiles of the tile being fortified)

}

------------------------------------------------

PS: Just reading the new AARs will give one ideas for scripts (UK Tanks invading Iraq in January 1940), that will take advantage of HC's AI script editor.

-------------------------------------------------

One item, though I like and greatly appreciate the flexibility of the Scripts they appear to stand alone without any concept of grand strategy that would execute several scripts as part of a grand plan.

Example: Control MED Allied AI: Take Middle East & Take Libya & Operation Torch & Sink Italian Fleet. Not Take Libya 50% and Operation Torch 50%, but one check that triggers all the related operational and production and diplomatic and research plans if the conditions are met.

I wonder what HC's thoughts are on this.

Perhaps a Person_ID or Strategy_ID. At game start the system randomly or by choice stores a Person_ID/Strategy_ID (ie RAMBO or TERIF or SEAMONKEY or CRACK_NAVAL). Only scripts or an AI Folder with that Person_ID can be triggered. Of course this may lead to exceesively large AI files.

Or perhaps a master trigger for related plans?

#MASTER_PLAN_ID= ## - i.e. if Master Plan is activated then all plans with Master_ID flag of same number are also triggered. This would allow you to link activation of related plans to a single trigger condition.

In related AI Plans is the flag:

#MASTER_ID= ##

Just another idea. ;)

[ February 17, 2006, 05:06 PM: Message edited by: Edwin P. ]

Link to comment
Share on other sites


×
×
  • Create New...