Sluggish AI

Moderators: The Artistocrats, Order of Battle Moderators

Post Reply
conboy
Sergeant First Class - Elite Panzer IIIL
Sergeant First Class - Elite Panzer IIIL
Posts: 434
Joined: Sun Apr 09, 2017 4:18 pm

Sluggish AI

Post by conboy » Fri Sep 13, 2019 3:11 pm

Hidee-ho --
I am working on a scenario with a lot of enemy on an 84x79 map. The map is way down the road so I can't resize without re-doing the scenario.
The scenario is very sluggish, meaning that the AI sometimes takes 5 minutes to get a turn processed and start movement/counterattacks.

So, I request that y'all post whatever you know about what to check for to ensure that one has done all one might to ensure alacrity in AI turn processing.

I don't have any "Any Event" Triggers. But I have several "Set AI Team" and "Set Unit AI Team" effects, the former for counterattacks and the latter for retreat and set up defense at another point. I use Static Defense as much as possible and activate the units with "Set AI Team" effect when allies approach a key point. At the start of the scenario there are 94 enemy units on the board, counting from AI Team assignments. 62 are static (awaiting triggers for counterattack or retreat) and 32 are local defense or move to hex. It sounds like a lot but the allies engage them sequentially, not at once. It is boggiest at the first 5 turns or so, then it starts moving ok.

I don't know what else to check so please provide hints, advice, abjurations, accusations, or whatever else you might have in your sock drawer to assist in this regard.

thanks,

conboy

Erik2
Order of Battle Moderator
Order of Battle Moderator
Posts: 6273
Joined: Thu Jul 14, 2011 12:59 pm
Location: Norway

Re: Sluggish AI

Post by Erik2 » Fri Sep 13, 2019 3:36 pm

I've created scenarios with more units (at least 150), so that should be ok in itself.

Maybe create more AI teams with fewer units in each team? 10-15 units pr team is my standard, but I've had 20-30 land units without problems.

I usually find it better to use Local Defense tasks with a radius set to whatever range you want them to engage eventual enemies nearby. I only use static for units that need to stay on primary objectives and structures.

If the map is very large the AI needs more time to calculate movements. This also puts a burden on the CPU and the graphic card (I think).

Sorry about not having a solid solution to your issue.
Maybe you could PM a link to the scenario and let another scenario tinkerer have a look at it?

bru888
Order of Battle Moderator
Order of Battle Moderator
Posts: 3381
Joined: Sun Jan 10, 2016 5:39 pm

Re: Sluggish AI

Post by bru888 » Fri Sep 13, 2019 5:12 pm

Conboy, you and Erik have touched upon what I believe are the three main factors for determining gameplay efficiency:

Any Event - this was identified by the designer a long time ago as a setting that should be used sparingly.
Map Size - as Erik mentioned, the game seems to need to address each hex on every turn; the more hexes, the more processing needed.
Units per Team - this one gets the grand prize, according to experiences shared here in the forums.

Any Event
There's not much more to be said about this. The designer did mention it once; who knows if it still pertains? Still, it makes sense because in any event - and there are many of them happening each turn - the game must stop and consult the conditions of a trigger set for Any Event, over and over again. Any Event can't be avoided if any other setting might cause a problem with trigger activation but when you can be specific with some other Trigger Event, it's advisable.

Map Size
Let's compare your current scenario under construction with your previous work. Here are the map sizes (estimates):
  • Anzio Beachhead 40 x 48 hexes
  • Operation Dragoon 50 x 40 hexes
  • To Le Tholy 55 x 40 hexes
You say this new scenario is 84 x 79 hexes. That shouldn't be a dramatic difference from your previous work, considering the maximum size is 120 x 120 hexes.

Units per Team
This is where you might find your devil. Did you have sluggish problems with Anzio Beachhead, Operation Dragoon, or To Le Tholy? Let's take a look at their AI teams.

Anzio Beachhead:

Screenshot 1.jpg
Screenshot 1.jpg (255.34 KiB) Viewed 258 times

You have 26 units in AI Team 1. However, they are not moving anywhere, just defending a hex. (Which is set for the map origin, a point at sea. Did I sweep this for you? If so, I apologize for missing this.)

Operation Dragoon:

Screenshot 2.jpg
Screenshot 2.jpg (193.09 KiB) Viewed 258 times

Only 18 units in AI Team 1 which is set for Static Defense. Not a problem.

To Le Tholy:

Screenshot 3.jpg
Screenshot 3.jpg (198.46 KiB) Viewed 258 times

43 units in AI Team 1! But again, it's set for Static Defense which means there is not much for the computer to figure out each turn.

You touched on an important point, however. I scanned through the triggers for these scenarios and I saw none which subsequently reassigned these large teams en masse to some task like "Move to Hex" or even "Seek & Destroy." That would slow things down, I'd say.

What I found in my own disasters is that with dozens of units in one team being told to move to a hex or seek and destroy, the game has to figure out the optimal paths for each unit to carry out the task. This must mean hundreds, if not thousands, of calculations which take up processing time.

One thing I will caution about is to not make too many AI teams, either. We've heard that, if given a choice of many units on fewer AI teams, or few units on more AI teams, we should choose the latter and I agree with this. However, dozens of AI teams for the game to handle every turn may slow things down, too. Making, say, 60 or 70 AI teams each with 1 or 2 units, is overkill in my opinion.

So. How does your current scenario stack up against all this? Maybe you will find the answer that way.
- Bru

conboy
Sergeant First Class - Elite Panzer IIIL
Sergeant First Class - Elite Panzer IIIL
Posts: 434
Joined: Sun Apr 09, 2017 4:18 pm

Re: Sluggish AI

Post by conboy » Fri Sep 13, 2019 5:34 pm

wow, what service!

Bru, thanks for the exposition. I have a lot of units on Team 2 and there are several twists and turns at which I reassign them to other teams and have the new teams pirouette or open fire. I think it might be combination of factors. But I don't want to submit one for peer review that grinds and grinds. So thanks again for the attention you gave it.

Erik,
comen atchee, bro!

conboy

Erik2
Order of Battle Moderator
Order of Battle Moderator
Posts: 6273
Joined: Thu Jul 14, 2011 12:59 pm
Location: Norway

Re: Sluggish AI

Post by Erik2 » Sat Sep 14, 2019 7:45 am

I've taken a look at the scenario in the editor. Quite some complex trigger stuff here, worthy of the famous Bru Sweep whenever the scenario's ready.

I notice that you have 50 units in one team with Static Defense order. If these units are later activated and receiving a 'normal' order I think the AI will take some time moving all 50 units.
I recommend using static order only for units that will stay static during the scenario, protecting primary objectives etc.
I would probably split the team with 50 units into 3-5 teams with local orders.

You spawn a large number of XV Corps units amd add resources by activating a speficic XV trigger. This trigger is enabled whenever the Allies occupy 2 locations.
Any reason these occupations can't spawn all the XV Corps units directly?

There are a number of cloned Phalsbourg Defense triggers that assign various German units to the Phalsbourg team whenever the Germans are spotted.
Not sure what you want to accomplish here. Why not have the Germans assigned from the start with local order and change the order to defend when the Allies spot them? Seems simpler.

BTW, you have a Phase 1 objective trigger that completes both Allied and German objective.

Is the AI issue present from any specific turn? I ran the scenario for the first 4-5 turns and the AI finished in 20-30 seconds.

conboy
Sergeant First Class - Elite Panzer IIIL
Sergeant First Class - Elite Panzer IIIL
Posts: 434
Joined: Sun Apr 09, 2017 4:18 pm

Re: Sluggish AI

Post by conboy » Sat Sep 14, 2019 2:17 pm

Erik, thanks for the look-through!
I recommend using static order only for units that will stay static during the scenario, protecting primary objectives etc.
I would probably split the team with 50 units into 3-5 teams with local orders.
Ok I'll check it closely and split up.
You spawn a large number of XV Corps units amd add resources by activating a speficic XV trigger. This trigger is enabled whenever the Allies occupy 2 locations.
Any reason these occupations can't spawn all the XV Corps units directly?
Is there a better way to have the same trigger Condition actuate several Effects without reproducing the trigger Condition for each Effect? If so, please advise! I need that! I wanted the capture of those two points to switch battle phases from VI Corps infantry in the Vosges Mountains to XV Corps armor in the Alsatian plains. So: 1) Slow down battle in the woods 2) Have rest of French 2nd Armored show up along with the US XV Corps elements 3) Provide resources for XV to conduct the attack on Strasbourg. All of these were a little complex so I wanted to use a single trigger Condition for all of them in case there was a problem it would be easier to troubleshoot, and not have to reproduce the trigger Conditions for each Effect.

So: Is there a way to have a single trigger Condition actuate multiple trigger Effects (without repeating the Trigger Condition for each effect?)
There are a number of cloned Phalsbourg Defense triggers that assign various German units to the Phalsbourg team whenever the Germans are spotted.
Not sure what you want to accomplish here. Why not have the Germans assigned from the start with local order and change the order to defend when the Allies spot them? Seems simpler.
I got tired of wipeouts being the only way to move a unit out of a sector so I had them retreat on various combat conditions (<7 strength, allies get too close) and they retreat all the way to Phalsbourg. When they get there, I found they just sat around and moved aimlessly about the destination point without digging in. If one has them switch teams to defend when they come in sight of the German unit there, they settle down and dig in and wait for Allies in combat-ready state. The same units defend one sector, retreat, then set up for defense in another sector.
BTW, you have a Phase 1 objective trigger that completes both Allied and German objective.
Thanks! That would have driven me batty so thanks for spotting it!
Is the AI issue present from any specific turn? I ran the scenario for the first 4-5 turns and the AI finished in 20-30 seconds.
Ok, so the whole thing is that my computer doesn't drive the AI fast enough. Well, I don't want to get another computer so I better fix the scenario to speed it up some. Also, lots of players don't have hot-shot ASUS laptops like mine so I'll try to make the scenario run faster.

Erik, thanks for taking the time out -- you answered a very important question (last one about speed) and pointed out some very interesting points for investigation. I'm wondering if this scenario is just too dang big... I wanted to avoid having yet another Vosges scenario - a slog in the wet mountains and wood - followed by a brief breakout scenario, so I put them into the same scenario. Turns out the scenario breakout takes more days that the actual battle and I can't get the Phase I objectives set where they fall more-or-less simultaneously. Also, I have to set up the whole of Phase II using triggers -- which is probably what slows the scenario down (as you and Bru discussed). Whole thing feels clunky and inelegant, while it actually runs slow on the computer. What a dilemma -- got too many weeks invested in this to start over so ...

ps, Erik, turns 2, 3, and 4 load at about 4 minutes each. After that, it runs quite nicely. Maybe if I make a few changes it'll speed those turns up. Also, maybe I'm almost done with beta of this beast after all!

thanks again,

conboy

terminator
Major-General - Jagdtiger
Major-General - Jagdtiger
Posts: 2983
Joined: Mon Aug 15, 2011 12:48 pm

Re: Sluggish AI

Post by terminator » Sat Sep 14, 2019 3:58 pm

Erik2 wrote:
Fri Sep 13, 2019 3:36 pm
I've created scenarios with more units (at least 150), so that should be ok in itself.
What is the scenario with the most units you have created ?

Erik2
Order of Battle Moderator
Order of Battle Moderator
Posts: 6273
Joined: Thu Jul 14, 2011 12:59 pm
Location: Norway

Re: Sluggish AI

Post by Erik2 » Sat Sep 14, 2019 4:05 pm

terminator wrote:
Sat Sep 14, 2019 3:58 pm
Erik2 wrote:
Fri Sep 13, 2019 3:36 pm
I've created scenarios with more units (at least 150), so that should be ok in itself.
What is the scenario with the most units you have created ?
I have not kept track of number of units for each scenario :D
But since I basically use my 1 resource income pr unit pr turn this roughly equals the number of units for a faction (minus structures).
So some numbers you kind of remember.

Erik2
Order of Battle Moderator
Order of Battle Moderator
Posts: 6273
Joined: Thu Jul 14, 2011 12:59 pm
Location: Norway

Re: Sluggish AI

Post by Erik2 » Sun Sep 15, 2019 1:06 pm

I'm working on a new campaign and just tested the opening turn in a scenario.
There are about 180 units in 17 AI teams and one of the team has currently 60 (!) units assigned with a Search & Destroy order.
There are 12 location objectives on the map, so plenty of moves to consider.

I was expecting long AI thinking times, but the whole turn was over in 5 minutes with continuous AI action.
I think this is perfectly acceptable.
(I have a fairly powerful PC and graphics card.)

terminator
Major-General - Jagdtiger
Major-General - Jagdtiger
Posts: 2983
Joined: Mon Aug 15, 2011 12:48 pm

Re: Sluggish AI

Post by terminator » Sun Sep 15, 2019 1:21 pm

I have the impression that there is perhaps a parameter that can play its importance: the pathfinding.
The more difficult the terrain is with forests, hills, mountains, rivers... the longer the AI will take to find the best pathfinding for the land units (?)

conboy
Sergeant First Class - Elite Panzer IIIL
Sergeant First Class - Elite Panzer IIIL
Posts: 434
Joined: Sun Apr 09, 2017 4:18 pm

Re: Sluggish AI

Post by conboy » Sun Sep 15, 2019 2:19 pm

All,
Buried within my last post was a question that I would really like to have answered, and I'm sorry if there's an obvious answer but I haven't found it.
Is there a [simple] way to have a single trigger Condition actuate multiple triggers (without repeating the Trigger Condition for each trigger)
right now I have to do this, which is cumbersome:
Screenshot 5.jpg
Screenshot 5.jpg (398.95 KiB) Viewed 152 times
When the XV Trigger Set-up trigger conditions are met, the XV Corps Deploys trigger is enabled and I can use that as the Condition for several other triggers without having to set up the same conditions again for each trigger. XV Corps Deploys is just a check-off, no other conditions or effects are assigned to it. That way, if I want to change the condition, or if it needs troubleshooting, it's one place (XV Trigger Setup) for several triggers. In this case, I want to have several units deploy and have several different events occur to start off Phase II of the battle.

Is there simpler way to accomplish this, such as putting the main trigger in a folder and having all subtriggers in the folder respond to it?

I haven't been able to figure it out.

thanks in advance!

conboy

terminator
Major-General - Jagdtiger
Major-General - Jagdtiger
Posts: 2983
Joined: Mon Aug 15, 2011 12:48 pm

Re: Sluggish AI

Post by terminator » Sun Sep 15, 2019 2:33 pm

conboy wrote:
Sun Sep 15, 2019 2:19 pm
All,
Buried within my last post was a question that I would really like to have answered, and I'm sorry if there's an obvious answer but I haven't found it.
Is there a [simple] way to have a single trigger Condition actuate multiple triggers (without repeating the Trigger Condition for each trigger)
right now I have to do this, which is cumbersome:Screenshot 5.jpg
When the XV Trigger Set-up trigger conditions are met, the XV Corps Deploys trigger is enabled and I can use that as the Condition for several other triggers without having to set up the same conditions again for each trigger. XV Corps Deploys is just a check-off, no other conditions or effects are assigned to it. That way, if I want to change the condition, or if it needs troubleshooting, it's one place (XV Trigger Setup) for several triggers. In this case, I want to have several units deploy and have several different events occur to start off Phase II of the battle.

Is there simpler way to accomplish this, such as putting the main trigger in a folder and having all subtriggers in the folder respond to it?

I haven't been able to figure it out.

thanks in advance!

conboy
Yes, we can...

Capture d’écran (150).jpg
Capture d’écran (150).jpg (246.79 KiB) Viewed 147 times

terminator
Major-General - Jagdtiger
Major-General - Jagdtiger
Posts: 2983
Joined: Mon Aug 15, 2011 12:48 pm

Re: Sluggish AI

Post by terminator » Thu Sep 19, 2019 7:50 am

Phalsbourg, Strasbourg... -> Operation Nordwind ?

conboy
Sergeant First Class - Elite Panzer IIIL
Sergeant First Class - Elite Panzer IIIL
Posts: 434
Joined: Sun Apr 09, 2017 4:18 pm

Re: Sluggish AI

Post by conboy » Thu Sep 19, 2019 10:45 pm

Terminator:
Phalsbourg, Strasbourg... -> Operation Nordwind ?
This scenario precedes it. It's the final clearance of the Vosges and capture of Strasbourg. I bit off more than I wanted to chew on this one because it's a big map (for me) with lots of turns and complicated battle events (to me). Maybe I'll be done with it in a few weeks.

I'm having trouble keeping this straight -- I think Nordwind was north of the Colmar Pocket clearance, and Colmar fit into the same time frame as Operation Nordwind. I'm going to do Colmar Pocket, not the overall Operation Nordwind. I haven't done enough reading yet to figure out if Colmar Pocket defense was part of Operation Nordwind. Got plenty of time, though.

I'll spell all the French location names correctly this time! A good way to get the French names properly spelled is to copy them off Google Earth Pro and then paste them into the name field of the OoB Scenario Editor. You can start typing them in Google Earth Pro and it'll complete the name, properly spelled and accented for you to copy. Then all the diacritical marks come over without messing with the French keyboard. I didn't know that trick when I did Operation Dragoon scenario, so some of the names are misspelled, as you kindly pointed out previously. I have no idea how to do French spelling phonetically.

Also, Terminator, thanks for the answer you posted to my question in this thread. It confirmed my suspicion that there's a multiple step process to create a Trigger that can actuate multiple other triggers.

conboy

Post Reply

Return to “Order of Battle : World War II - Scenario Design”