AI Move Orders for Ground Units

Moderators: Order of Battle Moderators, The Artistocrats

Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

AI Move Orders for Ground Units

Post by Horst »

I've done some more tests about AI behaviors/tasks, and this time mainly about making the AI move ground units to a certain hex like a flag.

Move to Hex: the units move to the flag and sometimes keep dancing around it what is rather bad. Entrenching is more desired. I bet every player has occasionally noticed this nervous AI behaviour during scenarios. This misbehaviour isn’t always happening though.
What is also important to know that flags/supplies are ignored which are even next to units and not directly on the way. That is also a very undesirable feature and can cause out-of-supply situations.
Move to Hex can cause unrest.jpg
Move to Hex can cause unrest.jpg (602.87 KiB) Viewed 2705 times
Move to Hex ignores flags.jpg
Move to Hex ignores flags.jpg (603.41 KiB) Viewed 2705 times
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: AI Move Orders for Ground Units

Post by Horst »

Defend Hex without positions: the units will only move to the flag if an enemy unit is within the defined radius, otherwise they become idle in the original positions.
With enemy unit detected, even in the fog of war and/or camouflaged, they move & capture & possibly attack and return afterwards exactly in the same original positions they started the scenario what is really not bad at all if you want them to raid a location and return. It still has the disadvantage that there has to be an enemy detected within defend-radius to make units move to capture the flag. Given a large radius this can be somewhat compensated.
Note that camouflaged units still can’t be spotted as long as they don’t sit on the defended hex or around it and are stumbled upon.
Flags/supplies are captured even in opposite direction if within movement range, but units will focus on reaching the defended hex.
Defend Hex without positions.jpg
Defend Hex without positions.jpg (605.4 KiB) Viewed 2704 times
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: AI Move Orders for Ground Units

Post by Horst »

Defend Hex with positions: the units will move to the flag even if no enemy units are present. With positions defined, they will entrench themselves there. It’s rather random or the fastest unit decides which hex-position it takes, but I’ve already observed some position switching among the AI units before the whole group entrenched. If there aren’t enough defined hexes, the units will still all try to entrench themselves around the positions without anyone returning to original positions.
If you want to keep units on their defined positions then set the radius to 0, otherwise they act like with Local Defense 1+ and can temporarily leave their entrenched positions to fight off enemies in radius.
If you like to avoid complicated AI task switches then this behaviour is possibly the best to choose for a single move & capture & hold order. You only need to define a single defensive position to make it work although more are desirable to prevent sitting on river hexes and other unfavourable hexes.
The disadvantage is that there is no aggression setting, so it’s possibly 50 by default.
In my screenshot with the 5-star fully entrenched I/O tank, the AI group was quite careful and first bombarded with arty before surrounding and attacking the tank.
This nicely showed that Defend Hex is also capable to do effective combined arms maneuvers in the offensive.
Flags/supplies are captured even in opposite direction if within movement range, but units will focus on reaching the defended hex position.
Defend Hex with positions.jpg
Defend Hex with positions.jpg (603.02 KiB) Viewed 2704 times
Defend Hex against powerful foe.jpg
Defend Hex against powerful foe.jpg (607 KiB) Viewed 2704 times
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: AI Move Orders for Ground Units

Post by Horst »

Local Defense: this seems rather useless to get units moving, especially without enemies around. The radius defines how far a unit moves out to attack favourable targets within its movement limit. That means if a unit can move 5 hexes on open ground, it can move that far away from its original spot on Local Defense 5. However, if a local defender moves to attack within its movement range, it can still move further as long as it is within the defined radius.
E.g. an infantry only attacks everything in 3 hexes reach on open ground, but could still possibly move further afterwards for another attack as long as it is within movement and the defense radius of its original location.
In the first example, the recon vehicle won’t move to attack further than 3 hexes with Local Defense 3. It will stay there like a guard dog barking behind a fence.
In the second example, the recon vehicle even circles around the enemy with Local Defense 5. After defeating the enemy, local defenders return to their original position they became idle.
Enemies are only attacked if actually spotted, so no cheating there.
Keep in mind that units with ranged attacks can always attack beyond any defined radius.
Flags/supplies are captured even in opposite direction if within movement range. If the flag/supply location is reachable by transport, it will be captured. If the transported unit’s original movement is not in range of the original location, the AI unit will return. This way, a tank is much more likely staying on nearby flag/supply locations than an infantry unit with transport.
Local Defense 3.jpg
Local Defense 3.jpg (608.79 KiB) Viewed 2703 times
Local Defense 5.jpg
Local Defense 5.jpg (606.16 KiB) Viewed 2703 times
Local Defense 5e.jpg
Local Defense 5e.jpg (607.02 KiB) Viewed 2703 times
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: AI Move Orders for Ground Units

Post by Horst »

Seek & Destroy: this is a pure hunting mode for AI units. They will capture flags and attack everything spotted within a radius. AI units become idle if no enemies are spotted within the defined radius. That means that even if flags/supplies are within radius but not within movement range and no enemy around, the AI units become idle. There is no return to original locations here.
Note the ignored enemy unit out of spotting range in my screenshot. The AI units are eager to capture the flag but don’t move to the enemy unit. This can be seen as semi-cheating same with Defend Hex without positions defined. The AI knows there is an enemy around but has only eyes for the flag.
As move order, Seek & Destroy can work as long as AI units have a bait nearby. Otherwise, AI units can quickly become idle during their hunt, so it’s not really recommended for a proper capture with following defense. AI units are also easily distracted and rather focus on the destruction of each spotted enemy what can waste a lot of time, especially on large maps if AI units are lured to undesired directions.
Flags/supplies are captured even in opposite direction if within movement range. They move on to new flags/supplies as long as a single enemy is within radius.
Seek & Destroy.jpg
Seek & Destroy.jpg (610.56 KiB) Viewed 2702 times
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: AI Move Orders for Ground Units

Post by Horst »

That’s all about giving move orders for AI ground units as far as I have tested it.
This has shown that even the regular Move to Hex task has its flaws and can be replaced by better alternatives.
bru888
Order of Battle Moderator
Order of Battle Moderator
Posts: 6181
Joined: Sun Jan 10, 2016 5:39 pm
Location: United States

Re: AI Move Orders for Ground Units

Post by bru888 »

Great job, Horst. Thanks very much for this. [Bookmarked for study.]
- Bru
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: AI Move Orders for Ground Units

Post by Horst »

The 7.1.8 update got me surprised a bit but according to a quick test today, I haven't noticed a difference with Seek & Destroy, which was supposedly changed somehow in 7.1.8. I had no time to post all this earlier until now, and I'm not in the mood to retest everything else too if there are more differences with other task types.
By the way, the attachment bug still lurks around in this forum, so I kept the number of screenshots to a limit.
GabeKnight
Lieutenant-General - Karl-Gerat 040
Lieutenant-General - Karl-Gerat 040
Posts: 3700
Joined: Mon Nov 27, 2017 10:24 pm

Re: AI Move Orders for Ground Units

Post by GabeKnight »

This thread answered some questions that I was just too lazy to test myself. :D 8)

Many thanks, Horst, most appreciated and insta-bookmarked.
Horst wrote: Wed May 29, 2019 5:08 pm [...] I haven't noticed a difference with Seek & Destroy, which was supposedly changed somehow in 7.1.8. I had no time to post all this earlier until now, and I'm not in the mood to retest everything else too if there are more differences with other task types.
This specific bug refered to naval S&D pathfinding (as discussed behind closed doors in the beta forum :P )
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: AI Move Orders for Ground Units

Post by Horst »

’Move to Hex’ versus ‘Defend Hex’
Here is a comparison between both behaviors where only the red JP human team gets the map revealed. I had to shrink the gif-animations under 1M to make the forum accept them.

Move to Hex
The AI won't bother about the flags left and right and goes straight to the designated hex. This is risky when leaving supply points behind.
Surprisingly, the AI decides that flags are suddenly more interesting than the target-hex and does move away to cash them in.
Too bad some flags are left behind in the end.
MoveToHex.gif
MoveToHex.gif (750.03 KiB) Viewed 2570 times
Defend Hex 0 with defensive position
The AI picks a more favorable route to the target-hex along a line of flags.
As getting a bloody nose is undesired, grabbing more flags seems on a higher priority here too.
It's somewhat similar compared to Move to Hex, but in the end all flags are captured.
The clear advantage is that you can define multiple target locations for a single AI group with a single move order thanks to the defensive positions that don’t have to be near the original target-hex. Multiple AI units in the same group will more likely quickly entrench there if reached and won’t dance restlessly around the single target hex.
DefendHex0.gif
DefendHex0.gif (978.11 KiB) Viewed 2570 times
What I still don't get it why the AI often does these irregular short-moves with transports. No human player can do that yet. It’s fine if the transport is somewhat armoured versus air and artillery strikes maybe, but if it's a vulnerable horse-transport, this is potentially risky what I have sometimes observed during regular scenarios.
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: AI Move Orders for Ground Units

Post by Horst »

Some more short info about the behaviors:

Retreat-Move
Only units on Seek & Destroy seem to be capable to do distant, manual retreat maneuvers to safety. Units on Local Defense or Defend Hex rather stick to the current places depending on a defined radius but can still do other maneuvers.

Return-Move
Local Defense and Defend Hex enables AI units to return to their original or defended locations.
It all depends on enemy and allied units around, but these behaviors can sooner or later move units back where they started the scenario or defend a hex. This is something what you won’t see on Static Defense which units are stuck on the current hex if pushed around due auto-retreat.

Supply-Move
All orders but Move to Hex are capable to desperately try capturing flags/supply if cut from supply.
As long as no unoccupied supply hex is in move-range, AI units on MtH seem to stop dead on the spot what is strange. Defend Hex rather pushes them further to fight over the target-hex.

Capture-Move
The AI is always blatantly aware of unoccupied supply/flag hexes and will try to capture these within range.
Sight-blocking terrain is ignored if you set these distances/radii higher than 1 hex. This is in contrast to a Local Defense 2+ order which still respects LOS blocks.
There is unfortunately also a fog-of-war bug that reveals hexes differently for human and AI players around sight blocks.
Local Defense 0+ only allows easy captures within move-radius.
Seek & Destroy 0/X and Defend Hex 0/X either move-radius or X if higher.

Attack-Move
Local Defense 0 does no attack-moves.
Local Defense 1+ attacks only on sight and move-radius.
Seek & Destroy 0 only attacks on sight. Sight means not only own but also allied spotting.
Seek & Destroy X either on sight or further if X is further. This is clearly a cheat spying into the fog-of-war.
Defend Hex X: same as S&D X although the priority to defend the hex seems higher than going for enemies.

Swap-Positions
All move-orders seem to be capable of switching unit positions.
PoorOldSpike
Colonel - Ju 88A
Colonel - Ju 88A
Posts: 1589
Joined: Sun Aug 08, 2010 6:06 pm
Location: Plymouth, England

Re: AI Move Orders for Ground Units

Post by PoorOldSpike »

Nice posts mate, they'll help us understand what's going on in the AI's little brain..:)
conboy
Lieutenant Colonel - Fw 190A
Lieutenant Colonel - Fw 190A
Posts: 1159
Joined: Sun Apr 09, 2017 4:18 pm
Location: Lower Alabama

Re: AI Move Orders for Ground Units

Post by conboy »

Dayam, Horst! You're a daggom library!
Thanks for all the hard work and courtesy of letting us know.
conboy
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: AI Move Orders for Ground Units

Post by Horst »

Made a test what Aggression setting is best to overcome a superior fully-entrenched 5-star enemy of the same type with two 0-star units.

Only by Move to Hex the AI seems to be able to fall back to reinforce and recover efficiency.
On Search & Destroy, it rather sits on the spot to keep flanking the enemy.

The test below is with the more interesting Move to Hex which is also capable to remove mines with engineering units.
The situation starts with both AI units on 1 strength to see how they reinforce and move to attack.
The only way to overcome the 5-star player-unit is to fully reinforce to 10 strength and start flanking attacks.
I only keep repairing my unit with elite-repair function in my turn without attacking.

On Aggression 50, the AI will first reinforce to 10 strength both units, although already moving to flank with strength 8. Afterwards, It's only a matter of few turns until my unit is defeated.
On Aggression 60, it can already happen that the AI starts to attack with one unit at strength 8 which is not enough to defeat my unit that only leads to several turns of repairing and falling back until the AI finally manages (randomly) to get its units both to 10 to successfully defeat the defender.
On Aggression 70+, things get even easier for the defending unit, as the AI attacks too early and rarely repairs enough to overcome the stronger defender. It also bounces often with low efficiency back and forth without recovering efficiency. In the end, many turns and RPs are wasted.

Q: What have we learned?
A: Attacking with lesser aggression can lead more likely to victory!


Btw, according to another test, AI units seem to stop sucide attacks below Aggression 90.
AI-Aggression.jpg
AI-Aggression.jpg (495.3 KiB) Viewed 796 times
AI-Aggression 50.jpg
AI-Aggression 50.jpg (493.52 KiB) Viewed 796 times
AI-Aggression 60.jpg
AI-Aggression 60.jpg (489.13 KiB) Viewed 796 times
Erik2
Order of Battle Moderator
Order of Battle Moderator
Posts: 9478
Joined: Thu Jul 14, 2011 12:59 pm
Location: Norway

Re: AI Move Orders for Ground Units

Post by Erik2 »

Very interesting. Seems like I need to dial back my 75 aggro levels to the default 50...
LNDavoust
Staff Sergeant - StuG IIIF
Staff Sergeant - StuG IIIF
Posts: 258
Joined: Fri Apr 13, 2018 12:24 am

Re: AI Move Orders for Ground Units

Post by LNDavoust »

I didn't know this thread, and it's gold :idea: . Thank you so much, Horst!
StuccoFresco
Sergeant Major - Armoured Train
Sergeant Major - Armoured Train
Posts: 590
Joined: Sun Feb 10, 2019 11:10 am

Re: AI Move Orders for Ground Units

Post by StuccoFresco »

I've never set aggression over 50.

I can confirm Move to Hex makes units capable of clearing minefields do so, I tested it in a couple campaigns.
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: AI Move Orders for Ground Units

Post by Horst »

It has always wondered me when the AI switches modes, so it was about time for testing.
Let's start for now with AA-units.
Even if my test plane has zero attack values, the AI switched from AT to AA mode when the plane came into 10 hexes reach (pic #1 & #2).
If the plane landed and no other planes were around, the AI switched to AT mode again.
Keep this in mind If you don't want your tanks get shredded to have an air-buddy around. :wink:
It doesn't matter if there adjacent enemy ground units, the AA will stick to this hostile-plane-within-10-hex-range behavior.

This switching works with following AI task behaviors:
Idle: no
Static Defense: yes
Exit Map: no
Move to Hex: sadly no (pic #3)
Defend Hex: yes, what can also be used as move-order. The AI switched even while moving.
Seek & Destroy: no
Local Defense: yes

If you create an AI attack group, make sure you give included AA-units the proper mode at start.
Could also be useful if it sticks to a certain mode depending on the expected hostile unit types.
AA1.jpg
AA1.jpg (500.5 KiB) Viewed 712 times
AA2.jpg
AA2.jpg (486.78 KiB) Viewed 712 times
AA3.jpg
AA3.jpg (512.77 KiB) Viewed 712 times
Last edited by Horst on Sun Dec 18, 2022 3:22 pm, edited 1 time in total.
GabeKnight
Lieutenant-General - Karl-Gerat 040
Lieutenant-General - Karl-Gerat 040
Posts: 3700
Joined: Mon Nov 27, 2017 10:24 pm

Re: AI Move Orders for Ground Units

Post by GabeKnight »

And what if the AI AA/AT unit does protect other ground units (e.g. infantry) and there is an enemy tank(s) present? Did you test that, too?

Does the AI prioritize air or ground defense then? That's what I'm kinda unsure of.
(But I think it's "air" alright.)

And thanks for the tests, Horst!
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: AI Move Orders for Ground Units

Post by Horst »

I was just going to add this info above.
Yeah, sadly strictly sticking to the hostile-plane-within-10-hex rule, as it seems.
AA4.jpg
AA4.jpg (447.14 KiB) Viewed 688 times
AA5.jpg
AA5.jpg (472.95 KiB) Viewed 688 times
AA6.jpg
AA6.jpg (422.93 KiB) Viewed 685 times
Post Reply

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