AI Aircraft Test

Moderators: Order of Battle Moderators, The Artistocrats

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

AI Aircraft Test

Post by Horst »

This is not a complete AI aircraft test yet, but already worth mentioning ahead:

While modifying the Leyte scenario of the US Pacific campaign, I’ve noticed how horribly slow the first AI turn processing became. I let the scenario start with 6 AI aircraft in the air who shared the same Air Seek & Destroy behaviour group.
Investigating this further on a test-map, I’ve discovered that the more planes you put into the same Air S&D group, the slower the AI thinking times gets.
Test-AI-Aircraft.7z
(12.93 KiB) Downloaded 46 times
As comparison: putting 6 aircraft into a separated S&D task group (999 radius) made all planes basically behave the same like putting them all into a single AI group. The AI processing time was a huge difference though:
6 planes in 6 AI groups: 15s per turn
6 planes in 3 AI groups: 15-20s per turn
6 planes in 2 AI groups: 15-30s per turn
6 planes in 1 AI group: 1-2 mins per turn

When I exchanged the behaviour to Air Defend Hex of only 2 distance around a flag, it became even worse: it took once almost 6 minutes to process a turn for these planes in a single AI group while still only 15s in 6 groups. Crazy…

Surprisingly, Air Patrol as AI behaviour was always quick like 15s on my rig even if all 6 planes were in one patrol group. Even when I set the targets to only land-transports, the fighters in the group sometimes engaged enemy fighters if nearby. This behaviour seems better than I thought but I have to test all the behaviours more thoroughly.

As a recommendation ahead: as far as I have tested it, up to 3 planes, like a separate carrier group, is still very fine to process for the AI, but really put a stop there afterwards!
As the free-roaming behaviour of aircraft is typically set to Seek & Destroy, try to keep the AI planes in a group to a limit or form different airbase groups with up to three planes.

If you want to take a look at my test-scenario, then you have to exchange AI behaviors for each US plane. The enemy (player) planes are only as bait/threat for the AI but are often ignored as long as you keep the target priority to land-transports that are 50 hexes away.
You’ll notice that the further the AI planes fly into the middle of the map, the slower the AI processing gets. This is related to scanning each valid hex around them. If you got a fast rig then you can place the transports further away to notice the difference.
Also keep in mind this is a rather empty map. The AI processing time can get much slower if a lot of units are on a map.
Zekedia222
Staff Sergeant - StuG IIIF
Staff Sergeant - StuG IIIF
Posts: 297
Joined: Mon Dec 17, 2018 9:30 pm
Location: Somewhere between Chattanooga and Anchorage

Re: AI Aircraft Test

Post by Zekedia222 »

Nice to know for WIP naval mod "Cruel Seas". Thanks!
Klinger, you're dumber than you look, and THAT boggles the MIND.
- Charles Emerson Winchester III
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 Aircraft Test

Post by Horst »

Can the AI detect enemy units in the fog?

Air Seek & Destroy, radius 999
On scenario start, my recon plane is 10 hexes away from an allied AI spotter.
The AI fighter immediately flies to my position on the first turn. However, on the second turn, it returns to base.
If my recon plane ever flew in sight range of an allied AI spotter, the AI fighter chased endlessly my recon plane, no matter how far I went, as long as the AI plane had enough fuel remaining.
During this chase-method, the AI fighter follows in a 2-hex distance. The unit’s sight range doesn’t seem to matter as long as it isn’t 1. If you don’t move out of sight again with your plane, then the AI most likely attacks. As long as the sight range is at least 2, the AI fighter will endlessly chase in the 2-hex distance until it gets a chance to attack.
What happens if there are two targets for the chasing AI fighter?
If another target is in any spotting range and movement range of the AI fighter, the fighter will go for this target. If the other target is out of movement range, it will continue chasing the first target in a 2-hex distance.
Any difference if the target is a land/naval target?
No, it’s the same chasing method like against air targets.
Does this chase-method also exist for AI land targets?
Not as far as I have quickly tested it. An AI land unit rather guarded a flag instead of following a target into the fog of war.

Air Seek & Destroy, radius 14
I picked the movement range as radius for the AI fighter. If I get into sight of allied AI spotters, the AI fighter takes off from the hangar, but now it depends of the planes own S&D radius. If the enemy target is within fighter radius, the AI fighter will attack if in any sight or chase if in the fog. Otherwise, the plane will return to base.

Air Defend Hex, distance 999
The same behaviour like Seek & Destroy.

Air Defend Hex, distance 3
If my recon plane gets into sight range of the nearby allied AI spotter that sits on the defended hex, the AI fighter takes off and starts its chase. If you fly out of sight again, the AI abandons its chase, as long as you are out of the defense radius. It’s basically the same like Seek & Destroy but with switched radius location.

Air Patrol:
The AI aircraft flies from patrol point to patrol point until any enemy targets are spotted, either by the aircraft alone or allied spotters. There is no radius defined here, but only targets within movement range are attacked. As long as enough fuel remaining, the AI plane can continue attacking targets in movement and allied sight range, away from the patrol points.
If enemy targets vanish into the fog of war again, the AI plane immediately returns to its patrol.

Conclusion:
There is quite some cheating with the Air Seek & Destroy and Air Defend Hex involved. Once a valid target is spotted, AI aircraft can chase any valid target in the fog as long as it has enough fuel remaining.
The Air Patrol behaviour looks more authentic with flight routes if no target is present. Aircrafts are hardly idle wasting turns in hangars and possibly become vulnerable targets there. It also has the advantage of putting as many planes of any type, including recon planes, into the same AI task group without slowing down the processing time. The chance is also high the planes in the same patrol group stick more together for protection.
The only disadvantage is that AI planes aren’t always there where the most action is, depending how the patrol points are set and how large the map is. For naval battles with hardly land and primary flags, it’s rather better to keep sticking to Seek & Destroy for combat planes.
If you don’t mind the work setting Air Patrol points, I recommend to keep them in distance to the aircraft movement range(s), otherwise it can waste some time reaching each point in a single turn.
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 Aircraft Test

Post by Horst »

AI aircraft return to base for repair

As occasionally observed while playing, AI aircraft have the pitiful behaviour to land on airfields with enemy land units nearby. Boom!
This happens due following reason:
If you don’t use the Set Base feature on any air-related behaviour type, each AI aircraft picks the next base as its home wherever it started the scenario. If the plane actually started in a circle of six adjacent airfields, it’s always the one in 8 o’clock position.
If you use the Set Base feature, the AI plane will always try to land on this defined base.
If the base is a carrier which is out of reach or even gone or the original airfield captured, the AI should look for the next possible opportunity to land. That could lead to accidents again.

To keep especially land-based AI aircraft as long as possible alive, it’s recommended to set the airfield as base which is furthest away (and also well defended) from the opposing team. If this base falls, then it’s usually over for the AI anyway.
If you don’t shy away from creating triggers then complex detections around each airfield could shift the AI aircraft tasks to another one with differently set base. This could possibly lead to planes running out of fuel though.
terminator
Field Marshal - Elefant
Field Marshal - Elefant
Posts: 5847
Joined: Mon Aug 15, 2011 12:48 pm
Location: the land of freedom

Re: AI Aircraft Test

Post by terminator »

Horst wrote: Sun Jun 16, 2019 4:01 pm AI aircraft return to base for repair

As occasionally observed while playing, AI aircraft have the pitiful behaviour to land on airfields with enemy land units nearby. Boom!
This happens due following reason:
If you don’t use the Set Base feature on any air-related behaviour type, each AI aircraft picks the next base as its home wherever it started the scenario. If the plane actually started in a circle of six adjacent airfields, it’s always the one in 8 o’clock position.
If you use the Set Base feature, the AI plane will always try to land on this defined base.
If the base is a carrier which is out of reach or even gone or the original airfield captured, the AI should look for the next possible opportunity to land. That could lead to accidents again.

To keep especially land-based AI aircraft as long as possible alive, it’s recommended to set the airfield as base which is furthest away (and also well defended) from the opposing team. If this base falls, then it’s usually over for the AI anyway.
If you don’t shy away from creating triggers then complex detections around each airfield could shift the AI aircraft tasks to another one with differently set base. This could possibly lead to planes running out of fuel though.
I had the impression that the function "Set Base" was inactive and useless.
I had done tests some time ago and the planes always chose the nearest base to repair themselves and not the one designated by this function "Set Base".
I will re-test on occasion.
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 Aircraft Test

Post by Horst »

Exit Hex for Aircraft
AI planes should seek out the closest exit on the map for reason of out of fuel or damage or a possible Return to Base behavior. It unfortunately happens that planes pick the same exit or maybe block each others flight path sometimes, so it’s advised to put a couple next to each other that the AI can more easily find a way out and the player can’t block all hexes with only few planes.
Exits rather only seem to be picked on a retreat if too damaged, while for a refuel, defined exits aren’t picked and planes rather land on airfields to refuel if available.

Set Base
With Air Patrol and Seek & Destroy, I’ve observed that each plane used its own defined airfield as base.
As the AI has some retreat-method with all kind of unit types, each plane seems to retreat back to its defined base but not necessarily land. Depending how much fuel is remaining, it looks like by all the weird flying back and forth, the AI will land on the closest airfield/carrier to refuel/repair if the original base can’t be reached anymore.
Defining bases can be useful, but it’s not guaranteed or too harshly restricted to be used then.
Post Reply

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