Jump to content

Scripts database?


Recommended Posts

OK, I think most of us can agree that making AI scripts that work and have variability will probably be the toughest thing in campaign design. For example most of the scenarios I have seen so far look great for PvP, but have the AI scripts untouched.

Although they SEEM simple at first look, the script format can raise many questions that the provided instructions do not answer:

If two plans with the same plan ID become valid at the same time, which does the AI pick?

Do ALL conditions (Date, tactical, friendly, variable) in place need to be satisfied for a plan?

If I have two plans with the same country ID, plan ID, and goal position ID, but with the goal position IDs arranged differently, do they both still have the same plan ID, or will these be considered seperate plans?

Why are ALL plans given 10 turns to complete their task after build up is complete? And what happens after the 10 turns? And why are some of the scripts for Barbarossa build-up defined as having 100 turns, while others have 10 turns?

These are merely sample questions I have come across while experimenting with the AI scripts. Sure, every player who scripts could spend hours, days, or weeks starting and re-starting games by experiment to find out what these answers are, but I believe that would be a major waste of time and effort.

I believe the crux of script development is not within the individual scripts themselves, but HOW THOSE SCRIPTS INTERACT WITH EACH OTHER TO CREATE AN EFFECTIVE, VARIABLE AND FLEXIBLE STRATEGY. It gets really complicated when you try to design AI scripts that are not completely linear, for example the Benelux, Paris, or Barbarossa scripts. These are one-way and the conclusion is virtually assured. But what if after Paris falls, you want the AI to choose between a Sealion, a Scandinavia strategy, a Balkens strategy, or a Med strategy, or a combination? Now those conditions, and how they interact with each other, get really tricky. I have been experimenting with this and so far have been hitting a brick wall... the AI just decides to do nothing at all.

That is why I believe us modders need to get together and start a techniques database of how to impliment AI strategies successfully. For example, someone could publish their findings on how to force the AI down certain strategic roads. Another could publish findings on how the conditions flags interact with each other and with different plans.

Also, we could publish our scripts! This would save modders the trouble of re-inventing the wheel, over and over again, and allow improvement.

I will start this off with the first contribution, a re-worked script of the German diplomacy script for a Fall WeiB game. This works! The German AI usually starts getting Spain success within a few turns! Also, the scripts are designed to be dependant on what strategic area the AI is pursuing, so that it doesnt waste chits.

Here is a summary of the scripts so that you dont have to pick through the code:

Germany Diplomacy:

Germany Presses Spain:

Start Date: Sep 39 Trigger: 75

Type 2. Spain being on Axis can only be good, regardless of the strategy employed, so for this script it is a default event.

Germany Presses Sweden:

Start Date: Sep 39. Trigger: 75

Type 2.

Conditions: Oslo controlled by Axis, and Norway politically aligned with Allies, 100 percent activated, and surrendered.

OR Spain politically aligned with Axis, 100 percent activated and not surrendered.

OR Egypt politically aligned with Allies and surrendered.

So for this, the trigger that set Germany to pursue a Sweden diplomacy are:

1. The surrender of Norway, which is a sure sign that the AI is pursuing a Scandinavia strategy.

2. The entrance of Spain on Axis side, allowing the AI to switch attention to new fronts once one has been successfully completed.

3. The fall of the Med to the Axis, allowing the AI to switch attention to new fronts once one has been successfully completed.

Germany Presses Iraq:

Start Date: Jan 40. Trigger: 100

Type 1.

Conditions: Egypt surrendered, or Syria surrendered. This assures that the AI will get Iraq on their side after the pro-axis coup, AND after the Med has been secured.

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

; AXIS SCRIPTS - Germany

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

;

{

#NAME= Germany Presses Spain (1939 - )

#POPUP=

#FLAG= 1

#TYPE= 2

#COUNTRY_ID= 5

#TRIGGER= 75

#LEVEL= 0

#DIPLOMATIC_ID= 38

#DATE= 1939/09/03

; Set friendly positions:

; 1st Line - Berlin

#FRIENDLY_POSITION= 84,16

; Set variable conditions:

; 1st Line - Germany politically aligned with Axis and not surrendered

#VARIABLE_CONDITION= 5 [1] [100] [0]

; Set tactical conditions:

; 1st Line - Berlin not tactically threatened (dummy condition)

#TACTICAL_CONDITION= 84,16 [3]

; Set dummy activate position (no units at position 0,0)

#ACTIVATE_POSITION= 0,0 [0,0] [0,0] [0]

; Set dummy cancel 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

#CANCEL_POSITION= 0,0 [0,0] [1,1] [0]

}

{

#NAME= Germany Presses Sweden (1939 - )

#POPUP=

#FLAG= 1

#TYPE= 2

#COUNTRY_ID= 5

#TRIGGER= 75

#LEVEL= 0

#DIPLOMATIC_ID= 39

#DATE= 1939/09/03

; Set friendly positions:

; 1st Line - Berlin

; 2nd Line - Oslo

#FRIENDLY_POSITION= 84,16

#FRIENDLY_POSITION= 80,8

; Set variable conditions:

; 1st Line - Germany politically aligned with Axis and not surrendered

; 2nd Line - Norway politically aligned with Allies and surrendered

; 3rd Line - Spain politically aligned with Axis and not surrendered

; 4th Line - Egypt politically aligned with Allies and surrendered

#VARIABLE_CONDITION= 5 [1] [100] [0]

#VARIABLE_CONDITION= 32 [2] [100] [1]

#VARIABLE_CONDITION= 38 [1] [100] [0]

#VARIABLE_CONDITION= 17 [2] [100] [1]

; Set tactical conditions:

; 1st Line - Berlin not tactically threatened (dummy condition)

#TACTICAL_CONDITION= 84,16 [3]

; Set dummy activate position (no units at position 0,0)

#ACTIVATE_POSITION= 0,0 [0,0] [0,0] [0]

; Set dummy cancel 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

#CANCEL_POSITION= 0,0 [0,0] [1,1] [0]

}

{

#NAME= Germany Presses Iraq (1940 - )

#POPUP=

#FLAG= 1

#TYPE= 1

#COUNTRY_ID= 5

#TRIGGER= 100

#LEVEL= 0

#DIPLOMATIC_ID= 24

#DATE= 1940/01/01

; Set friendly positions:

; 1st Line - Berlin

#FRIENDLY_POSITION= 84,16

; Set variable conditions:

; 1st Line - Germany politically aligned with Axis and not surrendered

; 2nd Line - Egypt politically aligned with Allies and surrendered

; 3rd Line - Syria politically aligned with Allies and surrendered

#VARIABLE_CONDITION= 5 [1] [100] [0]

#VARIABLE_CONDITION= 17 [2] [100] [1]

#VARIABLE_CONDITION= 41 [2] [100] [1]

; Set tactical conditions:

; 1st Line - Berlin not tactically threatened (dummy condition)

#TACTICAL_CONDITION= 84,16 [3]

; Set dummy activate position (no units at position 0,0)

#ACTIVATE_POSITION= 0,0 [0,0] [0,0] [0]

; Set dummy cancel 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

#CANCEL_POSITION= 0,0 [0,0] [1,1] [0]

Link to comment
Share on other sites

Also, I should mention that I am currently creating a comprehensive flow chart describing Axis AI logical strategy for a vanilla Fall WeiB game on Microsoft Office Visio, might be useful to visualize how the scripts need to interact with each other, I'll make that avaiable when i finish it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...