Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

The following is from a discussion Thoba and I have been having. This in regards to maximizing the AI scripts in game already.

All the comments are in regards to WW2 Intermediate mod.


WW2_DB

Battleship = BB

Transport = TR

Armor Transport = T6

Liberty Ship = T8

Oceanliner =T9


Below says if loaded transport is 1 hex away melee

[SAI_ROE][BB][(A)(TYPE)(EQ)(T6)(UNIT)(EQ)(T)(TYPE)(EQ)(T6)(DIS)(EQ)(1)][ME]

[SAI_ROE][BB][(A)(TYPE)(EQ)(TR)(UNIT)(EQ)(T)(TYPE)(EQ)(TR)(DIS)(EQ)(1)][ME]

[SAI_ROE][BB][(A)(TYPE)(EQ)(T8)(UNIT)(EQ)(T)(TYPE)(EQ)(T8)(DIS)(EQ)(1)][ME]

[SAI_ROE][BB][(A)(TYPE)(EQ)(T9)(UNIT)(EQ)(T)(TYPE)(EQ)(T9)(DIS)(EQ)(1)][ME]


The below line basically says if it's loaded and over 1 space away and under max range of 8 then fire.

[SAI_ROE][BB][(A)(TYPE)(EQ)(T6)(UNIT)(EQ)(T)(TYPE)(EQ)(T6)(DIS)(GT)(1)(TYPE)(EQ)(T6)(DIS)(LT)(9)][FE]

[SAI_ROE][BB][(A)(TYPE)(EQ)(TR)(UNIT)(EQ)(T)(TYPE)(EQ)(TR)(DIS)(GT)(1)(TYPE)(EQ)(TR)(DIS)(LT)(9)][FE]

[SAI_ROE][BB][(A)(TYPE)(EQ)(T8)(UNIT)(EQ)(T)(TYPE)(EQ)(T8)(DIS)(GT)(1)(TYPE)(EQ)(T8)(DIS)(LT)(9)][FE]

[SAI_ROE][BB][(A)(TYPE)(EQ)(T9)(UNIT)(EQ)(T)(TYPE)(EQ)(T9)(DIS)(GT)(1)(TYPE)(EQ)(T9)(DIS)(LT)(9)][FE]


Below says if unloaded transport is more than 1 hex or equal to 4 hexes or less away then fire.

[SAI_ROE][BB][(A)(TYPE)(EQ)(T6)(UNIT)(EQ)(F)(TYPE)(EQ)(T6)(DIS)(GT)(1)(TYPE)(EQ)(T6)(DIS)(LE)(4)][FE]

[SAI_ROE][BB][(A)(TYPE)(EQ)(TR)(UNIT)(EQ)(F)(TYPE)(EQ)(TR)(DIS)(GT)(1)(TYPE)(EQ)(TR)(DIS)(LE)(4)][FE]

[SAI_ROE][BB][(A)(TYPE)(EQ)(T8)(UNIT)(EQ)(F)(TYPE)(EQ)(T8)(DIS)(GT)(1)(TYPE)(EQ)(T8)(DIS)(LE)(4)][FE]

[SAI_ROE][BB][(A)(TYPE)(EQ)(T9)(UNIT)(EQ)(F)(TYPE)(EQ)(T9)(DIS)(GT)(1)(TYPE)(EQ)(T9)(DIS)(LE)(4)][FE]


I would set the order of the three above examples above so the loaded transports would be acted on first before unloaded transports.

Medium Bomber = F8

Ground Attack = F4

Battlecruiser = S8

Cruiser = CR

Light Cruiser - S5

Carrier = AC

AA Destroyer = X1

AA Frigate = X2

Light Cruiser AA = X3


Below example Medium Bomber only attacks if target is at crippled 1\2 threshold.

[SAI_ROE][F8][(A)(TYPE)(EQ)(BB)(DMG)(LT)(13)(TYPE)(EQ)(BB)(DIS)(EQ)(1)][ME]

[SAI_ROE][F8][(A)(TYPE)(EQ)(S8)(DMG)(LT)(11)(TYPE)(EQ)(S8)(DIS)(EQ)(1)][ME]

[SAI_ROE][F8][(A)(TYPE)(EQ)(CR)(DMG)(LT)(9)(TYPE)(EQ)(CR)(DIS)(EQ)(1)][ME]

[SAI_ROE][F8][(A)(TYPE)(EQ)(S5)(DMG)(LT)(8)(TYPE)(EQ)(S5)(DIS)(EQ)(1)][ME]

[SAI_ROE][F8][(A)(TYPE)(EQ)(AC)(DMG)(LT)(9)(TYPE)(EQ)(S5)(DIS)(EQ)(1)][ME]

[SAI_ROE][F8][(A)(TYPE)(EQ)(X1)(DMG)(LT)(3)(TYPE)(EQ)(S5)(DIS)(EQ)(1)][ME]

[SAI_ROE][F8][(A)(TYPE)(EQ)(X2)(DMG)(LT)(4)(TYPE)(EQ)(S5)(DIS)(EQ)(1)][ME]

[SAI_ROE][F8][(A)(TYPE)(EQ)(X3)(DMG)(LT)(7)(TYPE)(EQ)(S5)(DIS)(EQ)(1)][ME]


Below example Ground Attack only attacks if target is at crippled 1\2 threshold for smaller AA vessels and more than half damage Capitol Ships.

[SAI_ROE][F4][(A)(TYPE)(EQ)(BB)(DMG)(LT)(9)(TYPE)(EQ)(BB)(DIS)(EQ)(1)][ME]

[SAI_ROE][F4][(A)(TYPE)(EQ)(S8)(DMG)(LT)(9)(TYPE)(EQ)(S8)(DIS)(EQ)(1)][ME]

[SAI_ROE][F4][(A)(TYPE)(EQ)(CR)(DMG)(LT)(9)(TYPE)(EQ)(CR)(DIS)(EQ)(1)][ME]

[SAI_ROE][F4][(A)(TYPE)(EQ)(S5)(DMG)(LT)(7)(TYPE)(EQ)(S5)(DIS)(EQ)(1)][ME]

[SAI_ROE][F4][(A)(TYPE)(EQ)(AC)(DMG)(LT)(9)(TYPE)(EQ)(S5)(DIS)(EQ)(1)][ME]

[SAI_ROE][F4][(A)(TYPE)(EQ)(X1)(DMG)(LT)(3)(TYPE)(EQ)(S5)(DIS)(EQ)(1)][ME]

[SAI_ROE][F4][(A)(TYPE)(EQ)(X2)(DMG)(LT)(4)(TYPE)(EQ)(S5)(DIS)(EQ)(1)][ME]

[SAI_ROE][F4][(A)(TYPE)(EQ)(X3)(DMG)(LT)(6)(TYPE)(EQ)(S5)(DIS)(EQ)(1)][ME]


How the EDCE engine reads the AI script:Important stuff must be queried first as AI reads it in this fashion: first line of data in process line of data out. So ya the fifo computer expression is the golden rule. First in first out

As we say in Italy "Never contradict a mad man"

The idea is, BB should (must) as first line check for transports.

Considering Enhanced EDCE game.


The AI should disturb human player prioritizing the attack, when the condition is met.

Condition 1 = human player - Host true - distance 2 - if condition is met [ME] until next turn - if not met go to next line

[SAI_ROE][BB][(A)(TYPE)(EQ)(TR)(HOST)(EQ)(T)(TYPE)(EQ)(TR)(PLY)(MAN)(TYPE)(EQ)(TR)(DIS)(LE)(2)][ME]

Condition 2 = computer player - Host true - distance 2 - if condition is met [ME] until next turn - if not met go to next line

[SAI_ROE][BB][(A)(TYPE)(EQ)(TR)(HOST)(EQ)(T)(TYPE)(EQ)(TR)(PLY)(COMP)(TYPE)(EQ)(TR)(DIS)(LE)(2)][ME]

Condition 3 = human player - Host false - distance 2 - if condition is met [ME] until next turn - if not met go to next line

[SAI_ROE][BB][(A)(TYPE)(EQ)(TR)(HOST)(EQ)(F)(TYPE)(EQ)(TR)(PLY)(MAN)(TYPE)(EQ)(TR)(DIS)(LE)(2)][ME]

Condition 4 = computer player - Host false - distance 2 - if condition is met [ME] until next turn - if not met go to next line

[SAI_ROE][BB][(A)(TYPE)(EQ)(TR)(HOST)(EQ)(F)(TYPE)(EQ)(TR)(PLY)(COMP)(TYPE)(EQ)(TR)(DIS)(LE)(2)][ME]

and so on... From near to far.


[SAI_ROE][BB][(A)(TYPE)(EQ)(TR)(HOST)(EQ)(T)(TYPE)(EQ)(TR)(PLY)(MAN)(TYPE)(EQ)(TR)(DIS)(LT)(9)][FE]

[SAI_ROE][BB][(A)(TYPE)(EQ)(TR)(HOST)(EQ)(T)(TYPE)(EQ)(TR)(PLY)(COMP)(TYPE)(EQ)(TR)(DIS)(LT)(9)][FE]

[SAI_ROE][BB][(A)(TYPE)(EQ)(TR)(HOST)(EQ)(F)(TYPE)(EQ)(TR)(PLY)(MAN)(TYPE)(EQ)(TR)(DIS)(LT)(9)][FE]

[SAI_ROE][BB][(A)(TYPE)(EQ)(TR)(HOST)(EQ)(F)(TYPE)(EQ)(TR)(PLY)(COMP)(TYPE)(EQ)(TR)(DIS)(LT)(9)][FE]


With these new concepts means that we may be able to tell the AI what to attack first and concentrate the attack on a specific unit as a human would due. Yes there will be some homework to do, and still some knowledge to gather.

My comment:

Having a very strong AI , may be seen as step that players love and miss from the old times🙂AI_standard & AI_Advanced

Or having three AI approach steps:

AI_Easy

AI_Medium

AI_Hard