Jump to content

Amph/Offensives


Recommended Posts

Does the AI perform 1 Offensive at a time till its resolved? One minor amph, 1 major?

I set a specific function for japan. I popped them up with 3 HQs and 6 infantry in Japan to set out and invade Phil, Singapore, and Rabual.

Only Rabual amph gets done the others dont. I tried all sorts of things like putting one set in Saigon -> sing offensive, Truk -> Rab (amph), and Japan -> Philippines amph.

But it only always pulls the amph offensive for Rab and never does the other 2 when the resources are avail. The friendly cities were the right under where the units were and the right sizes. The scripts are correct.

Making AI for Japan is a PITA

Link to comment
Share on other sites

What happens if you increase the number of units threefold (with varying types too: Corps; Armies; SNLF) and give Japan plenty of Yen to start with? I would just be interested to see if this makes any difference, so that by a process of elimination we can work out what the problem might be.

In OpZ the Japanese carry out a number of operations simultaneously, but I've not experimented much with it outside of the historical scenarios in the Pacific theater, so it would be good to know if we can eliminate these factors from the equation.

Link to comment
Share on other sites

It could be one of two things, either there is an error in the scripts or perhaps not enough units as Bill has alluded to.

For size there are some notes for each AI scripts and I would double check these as this is likely the cause of the issue regarding the AI. Here are the notes from the Amphibious script:

#SIZE - This value must be satisfied or the event will not occur. For example, if the game engine cannot find enough

; enough units to satisfy the #SIZE requirement the event will not be added to the active plan list.

; Note: #SIZE values refer to the number of Land units assigned to a plan except for HQ, Rocket, Artillery, Anti-Tank, Anti-Air,

; Air Fleet, Tactical Bomber and Bomber units. These units are added to the plan (closest available unit without a plan)

; after all other land units. Therefore, a plan set to #SIZE= 5 would infact end up being a plan with a size equal to 6

; after the game engine includes an HQ and so on. Essentially, in order to have the plan satisfy the #SIZE requirement

; keep in mind the original count does not include available HQ, Rocket, Artillery, Anti-Tank, Anti-Air, Air Fleet,

; Tactical Bomber and Bombers as these are added in after the #SIZE value is satisfied.

If this is satisfied then the AI can run as many operations that there are enough units available for etc.

Hope this helps,

Hubert

Link to comment
Share on other sites

Read that too. I think I know what it is. I have various units assigned to ports but it seems to me they all have to be ready to embark like RFN for it to work.

So lets say I have an island where there are 3 units. One is a garrison and 2 others. The size is 2 for the invasion force but one of the units cant reach the port. Well then it wont activate. So I gotta swap things around. Too many ships in the area? wont activate.

Link to comment
Share on other sites

Ok this is getting frustrating.

Does steal have anything to do with it?

I put a steal of 1 and a type of 2 for some invasions.

Does steal of 1 ONLY take from other offensive missions and ignores units with no plans?

And I have to assume type 2 for an invasion means "keep trying till you take the damn thing"

I noticed in your scripts you have type 0 and steal 0 for invasions. Thats like the very last difference I can see.

Link to comment
Share on other sites

Just to confirm, steal just means that it will include units, in its search for available units, from those plan types as well. It doesn't ignore available units.

Type 2 does mean that it will keep trying. For the scripts I've written if I want it to only try once then type=0 is appropriate and steal=0 would mean that it doesn't need to steal any units to get the job done. Note, these are usually plans that have units starting on islands that wouldn't actually have any default plans assigned to them as they are not connected to territory with enemy units etc.

Why not post your scripts and perhaps a screenshot of Japan so we might get an idea why it is not working for you?

Hubert

Link to comment
Share on other sites

Ok here is an one of my scripts. Its basically the same one in your scenarios. It tells the USA to invade Oran (gives them a port). I have an offensive script to attack Algiers and its activated when they take Oran (town).

I have 3 of these invasion scripts. This one listed below is #1 (its above the other 2 in the amphibious.txt file) The only difference between #1 #2 and #3 I listed in the next couple lines.

#NAME= USA Build Up Amphibious - Vichy Algeria (2)

changes only size = 5, type = 0

#NAME= USA Build Up Amphibious - Vichy Algeria (3)

changes only size = 4, type = 2 so in case the other 2 dont execute the last one will and continue to try.

I GIVE the 4 units (army, tank, 2 corps) needed for the invasion to the USA months ahead of time (they start with an HQ). The USA never ever ever invades Algeria. Not all of them are near the a port. The USA has more cities than units on the map.

; USA prepares to attack Vichy Algeria:

{

#NAME= USA Build Up Amphibious - Vichy Algeria (1)

#POPUP=

#FLAG= 1

#TYPE= 0

#COUNTRY_ID= 3 --- verified USA

#TRIGGER= 100

#GV= 1[1,100]

#LINK= 0[0]

#LEVEL= 0

#SIZE= 6

#BUILD_LENGTH= 2 --- is this enough should I make it 5 or 10?

#LENGTH= 20

; Algiers

#GOAL_POSITION= 184,47 --- oran verified

#GOAL_POSITION= 167,28

#GOAL_POSITION= 170,46

#COASTAL_POSITION= 183,45

;DATE= 1942/6/1 --- units arrive 1942/1/1

#STEAL= 1

; Set friendly positions: --- all verified twice

; 1st Line - Glasgow

; 1st Line - New York

; 2nd Line - Gibraltar

#FRIENDLY_POSITION= 180,24

#FRIENDLY_POSITION= 109,42

#FRIENDLY_POSITION= 180,45

; Set variable conditions:

; 1st Line - USA politically aligned with Allies and not surrendered

#VARIABLE_CONDITION= 3 [2] [100] [0] --- verified USA

; Set tactical conditions:

; 1st Line - Washington D.C. not tactically threatened

#TACTICAL_CONDITION= 109,42 [1]

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

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

; NO Allied units in london

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

}

So you tell me. Im ripping my hair out. Does adding more US cities allow it to use them to embark? Storm of Steal USA map has a more straightened coast line so its a little easier to handle then mine. Also your USA is ~5-8 hexes closer to Europe than mine is. Am I not giving it enough time to get its crap together? I checked the planning logs and it doesnt even register the invasion. I dont even get a fail. it seems like it simply never starts.

I have weird problems with Japs too. Some invasions work some dont I change things, then others work and old ones dont. Is there a limit to the # of plans on the stack? Like for Japanese I have 5 different invasions at once when they enter the war vs USA. They might execute 2-3.

Perhaps make the Japs linear like I did the USA? 1st take thins, if you have this take that, if you have that now take the other thing, if you have the other thing.....

Link to comment
Share on other sites

Hi Al,

I think I see at least one major issue and it has to do with the FRIENDLY_POSITIONs you are using. See the following note that can be found in the AI script files:

; #FRIENDLY_POSITION - First position must refer to a land tile, subsequent positions can refer to either land or coastal tiles.

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

; plan. Each #FRIENDLY_POSITION will be read using AND logic.

;

; For all AI scripts that use the #FRIENDLY_POSITION tag, the AI generally picks available units closest to and connected to

; the first #FRIENDLY_POSITION and then sends them to the nearest available position for the script; e.g., a city for a Garrison

; script, a port for a Transport script, etc. All AI scripts require that the first #FRIENDLY_POSITION be a land tile, with the

; exception of Fleet scripts.

You'll see that the AI refers to the first FRIENDLY_POSITION when it looks for units for the plan you are attempting to execute, i.e. the first friendly position tells the AI where the plan should be executed from as otherwise it would not know etc. If you change the first listed friendly position back to New York then it should run as you were expecting it to.

Beyond that everything else looks ok to me and your assumptions are mostly correct, i.e. build length is not too short (this just tells the AI how many turns should it wait before launching the boats towards the target as sometimes it takes a few turns for the units to assemble in their transports).

For the limit to the number of plans there are none and likely it is as mentioned before a script error or simply not enough units available for the number of plans desired. Remember not all units count toward an invasion, only the basic unit types so you have to make sure that there are enough of those as the AI will automatically add in the special types such as HQs, AT, Rockets etc., but only after the initial plan size is satisfied.

Link to comment
Share on other sites

Can the AI have multiple plans for the same target?

Like fleet mission and I have

size = 5, type = 0

size = 4, type = 0

size = 3, type = 0

size = 2, type = 0

size = 1, type = 1

Lets say I have 8 ships...

Will the program look and run the size = 5 script, then then size = 4 and NOT execude, then look at size = 3 and EXECUTE for the rest of my 3 ships, then cancel the rest?

So when you build a layered script of decreasing sizes you effective allow for any size fleet that is equal to all the scripts of the same destination? So in the above example the largest fleet would be a size 15 (5+4+3+2+1)

Link to comment
Share on other sites

No for each specific AI script type, there can only be one plan for the same target. This is also described in the script notes as seen below:

; Plan identity is determined by #COUNTRY_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).

Link to comment
Share on other sites

Ahh ok. I was trying to find an easy way to send fleets out.

But then I can assume I can do this with fleet.txt giving each fleet assignment a different goal_position that is close to each other.

Size = 5, type =0, goal_position = 25,15

Size = 4, type =0, goal_position = 23,15

Size = 3, type =0, goal_position = 22,15

Size = 2, type =0, goal_position = 21,15

Size = 1, type =0, goal_position = 20,15

Total max fleet to general area 5+4+3+2+1 = 15

This then SHOULD duplicate what I am trying to do, because all the goal positions are different, and make it more efficient for ships to move and give me much more flexability than this...

Size = 15, type =0, goal_position = 25,15

Size = 14, type =0, goal_position = 25,15

Size = 13, type =0, goal_position = 25,15

Size = 12, type =0, goal_position = 25,15

Size = 11, type =0, goal_position = 25,15

Size = 10, type =0, goal_position = 25,15

Size = 9, type =0, goal_position = 25,15

Size = 8, type =0, goal_position = 25,15

Size = 7, type =0, goal_position = 25,15

Size = 6, type =0, goal_position = 25,15

Size = 5, type =0, goal_position = 25,15

Size = 4, type =0, goal_position = 25,15

less scripting. I am trying to make it faster also. So is less actual scripting makes it faster or the mechanics of how your single goal method works will make it faster because once the 1st goal is achieved it will cancel the rest of the plans to the same target?

I am still working on both PDE AI and PAC version of my game for human vs human. Im going to move the AI from PDE to PAC once its working right.

thx for the help BTW.

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...