Jump to content
Ram399

AI Deflection Gunnery

Recommended Posts

I want to start by saying that I'm not trying to add to the plethora of threads we already have on "AI bad why?????!!"
The AI is always going to be a work in progress and I'm grateful for the recent AI improvements which have been phenomenal. 
Their dogfighting ability has improved to the point that certain aircraft in the hands of the AI actually scare me (Spitfires, anything but Spitfires).

Recently I almost lost a 1v2 fight in my Kuban career against AI Spitfires in my Bf-109 G4, and I was covered in bullet holes with a severed rudder cable unironically sweating by the time I managed to land hits on them.  Funnily enough, had it not been for the intervention of my AI wingman (100+ kill Hauptmann Weizsacker ftw) I very likely would have died, which is great- the new AI is awesome.

I have, however, noticed what appears to be a slight issue which I'd like to get a bit of feedback on to see if anyone else can either corroborate or perhaps offer some sort of solution.

In short, though the AI is now far better at maneuvering, it seems like AI fighters cannot hit each other to save their lives. 
(With the exception of the aforementioned Spitfires who absolutely raked me because I tried to zoom climb away and the Spits responded by going into prop-hangs making me a still target and turning my Messer into Swiss Cheese.)

In most dogfighting cases however, where the AI now responds to threats by turning or diving away, it seems as if the pursuing aircraft is consistently unable to compensate for this with their gunnery.
As such they seem to regularly move into kill positions, only to continuously undershoot their targets- often times by only a couple feet.
While this is understandable for targets which can easily out-turn their pursuers, and will respond to a tail by regularly pulling hard into their attacker (Yaks and Spits mainly), it doesn't seem to take even a particularly hard turn to completely spoof the AI's targeting.

In the two attached screenshots for example, this already damaged AI LaGG managed to get an AI FW-190 to waste its entire ammo belt from close range in a shallow left bank without the German landing even a single MG round (though all of the rounds passed in very close proximity to the LaGG's tail).

 

 

Spoiler

1523264053_FW-190Deflection2.thumb.jpg.51302134c4788010cb20946c62929727.jpg

 

Spoiler

865604336_FW-190Deflection.thumb.jpg.0d9fb74a89e909438213163e41b25bd5.jpg

 



I'm the furthest thing from an AI programmer, but I can understand the difficulty which must surround trying to code AI aiming points that shift in real time in response to target speed and orientation.
None the less, I feel that even a marginal improvement here would make the already challenging AI a genuine threat not only to eachother but the player as well.

As a slightly related sidenote, I know that the AI's convergence range is tied to the player, and as such have been experimenting with various ranges to see if they alter AI accuracy.
For AI Bf-109s and Yaks which are similarly armed with the 2 higher velocity MGs supplemented by the single lower velocity cannon, I've noticed that on the occasions they manage to hit their target, it is often only the MG rounds which make contact and not the heavier hitting cannons, this results in only light damage (with the occasional kill should they get lucky and hit the Oil/Coolant).

In my Kuban career whenever I have to fly aircovers over Novorossiysk, and am often accompanied by several supplemental AI "Swift" flights, this inability to land killing hits becomes incredibly apparent.

Often times flights of 3 Yaks will be launched from the nearby Gelendzhik airfields, and I will shoot down the first 2 only to let the final Yak contend with my AI Bf-109 friends who often number anywhere from 15 to 20.

Consistently, the AI Yak will dodge attack run after attack run from every direction with only slight maneuvers, taking only light damage from MG-17 fire.
These fights will often go on for 5 minutes or more, starting at altitude and generally descending to sea level (often resulting in a number of AI Bf-109 collisions with either the ground or eachother)
Generally the action ends when the Yak either gets rammed by a presumably frustrated Bf-109, or finally submits to the death by 1,000 paper cuts that is the MG17 fire coming at it from all angles.
I've had some success setting the convergence range upwards to around ~470 or so, but the improvement is marginal at best.
Has anyone done a similar experiment and been able to find a sweet spot for the AI's cannon targeting?

As a final pic related, here are the AI Spits absolutely thrashing me with Hispano fire.
 

Spoiler

1879301936_Chuckles-IminDanger.thumb.jpg.a3ef3bc9f2a5f5964faf50a5d84a40cc.jpg

Spoiler

Run.thumb.jpg.7d2966c9c8dd0fe7cea5ba58dd17d58e.jpg

 

  • Upvote 3

Share this post


Link to post
Share on other sites

It seems that the AI can't see you at its lower 6 (where the fuselage blocks its view) or at its lower 8 to 10 (mileages may vary depending on actual wing configuration; the P-39 has its blind zone more backward, the Spit more forward).

Provided the nose blocks the AI's view the same way, it's easily possible that in a shallow bank deflection situation the AI undershoots because otherwise the target would disappear under the nose.

Edited by sniperton

Share this post


Link to post
Share on other sites

In the case of AI Flak, the firer is not moving and the gunner clearly takes into account the movement of the target and recently, wind, but they do not seem to take into account turning motion.  In other words, they are extrapolating the target's motion in a straight line at each firing decision point, leading to missing a turning target behind. 

 

There may be another factor:  in the case of a side gunner (eg He111) firing at a stationary ground target, the gunner always misses, as he fails to account for the forwards motion of his own plane. The ballistics calculations include it, but the gunner does not. At least this was the case last time I checked.

 

With forwards firing guns, the relative motion of firer and shooter should not be an issue, but the effect could be that the firing AI will underestimate the initial velocity of his rounds, relative to the air.  This will increase the air resistance, slowing the rounds down more than if the two planes were in the same relative position but stationary. Hence he will tend to miss behind a turning target.  Just a hypothesis: not sure how to check this accurately in the game.

 

FWIW I do not find the shooting accuracy of the AI to be implausible overall: deflection shooting is hard, especially if you are firing at targets you cannot even see, and the actual results of real air combat bear this out. 

 

 

 

  

  • Upvote 1

Share this post


Link to post
Share on other sites
31 minutes ago, unreasonable said:

With forwards firing guns, the relative motion of firer and shooter should not be an issue, but the effect could be that the firing AI will underestimate the initial velocity of his rounds, relative to the air.  This will increase the air resistance, slowing the rounds down more than if the two planes were in the same relative position but stationary. Hence he will tend to miss behind a turning target.  Just a hypothesis: not sure how to check this accurately in the game.

This should and would affect high-angle deflection shooting as well, something the AI used to be very good at when he still could see through the canopy. Just my two cents :salute:

On the other hand, I've always felt there's a discrepancy between the AI's high-angle and low-angle skills (superhuman vs rookie).

Edited by sniperton

Share this post


Link to post
Share on other sites
3 hours ago, sniperton said:

It seems that the AI can't see you at its lower 6 (where the fuselage blocks its view) or at its lower 8 to 10 (mileages may vary depending on actual wing configuration; the P-39 has its blind zone more backward, the Spit more forward).

Provided the nose blocks the AI's view the same way, it's easily possible that in a shallow bank deflection situation the AI undershoots because otherwise the target would disappear under the nose.

This would make sense..   I suppose the ai wouldn’t be able to take guessing/calculated Blind snap shots as us players would...


what is the default convergence setting of the ai anyhow? Plane dependant I would assume?

Share this post


Link to post
Share on other sites

Most pilots not hitting a maneuvering target is historically accurate. 

 

In WWII only the US Navy had a descent deflection shooting training. 

 

Most fighter pilots never scored a kill and those that did usually managed to sneak up on an unaware opponent. 

 

Pilots like Beurling or Marsailles that scored many kills during manoeuvre combat were a rare exception. 

 

Making AI unrealistically competent would be as immersion breaking for me as the other way around. 

  • Upvote 2

Share this post


Link to post
Share on other sites
1 hour ago, Eisenfaustus said:

Most pilots not hitting a maneuvering target is historically accurate. 

 

In WWII only the US Navy had a descent deflection shooting training. 

 

Most fighter pilots never scored a kill and those that did usually managed to sneak up on an unaware opponent. 

 

Pilots like Beurling or Marsailles that scored many kills during manoeuvre combat were a rare exception. 

 

Making AI unrealistically competent would be as immersion breaking for me as the other way around. 

and while you can set the AI to "noob" difficulty, they become idiotic that way.

But that's the problem I guess. Making AI "intelligent" is impossible, so you have to make them more perfect in a "machine-way" for the sake of high difficulty settings. How? making their aiming perfect. 

That's just my opinion, of course.

Share this post


Link to post
Share on other sites
7 hours ago, Eisenfaustus said:

Making AI unrealistically competent would be as immersion breaking for me as the other way around.


Of course not every AI pilot would suddenly become the lovechild of William Tell and Hans Joachim Marseille lol, and I'd be entirely fine with the "rookie" AI level continuing on just as they are.

But for the upper level "ace" pilot AIs, their gunnery definitely needs some work.
In my career I currently have two AI pilots with over 100 air kills, and I would hope them at least somewhat capable of leading their targets by now.
While I've noticed they actually seem to fire in bursts rather than holding the trigger down, and they use energy tactics surprisingly well, they still suffer from the same accuracy problems as the rookies do.

11 hours ago, [APAF]spartan85 said:

what is the default convergence setting of the ai anyhow? Plane dependant I would assume?


For the Bf-109 it defaults to 400 meters, not sure about other aircraft though.

Share this post


Link to post
Share on other sites
58 minutes ago, Ram399 said:


Of course not every AI pilot would suddenly become the lovechild of William Tell and Hans Joachim Marseille lol, and I'd be entirely fine with the "rookie" AI level continuing on just as they are.

 

I know some people are becoming increasingly confused about sex and gender, but I still maintain that William Tell and Hans Joachim Marseille could not have a love child. ;) 

 

Joking aside, I suspect the fundamental problem is that the AI cannot yet track and predict a curving target path. He may hit you while you are turning, provided that the inbuilt variation in aiming point relative to predicted target point, plus the natural spread of his guns, makes his pattern at the target's range wide enough. But the more accurate he is, the less likely he is to hit if his prediction is off.

 

If the AI seems to be good at high deflection shots, even at considerable ranges, that is probably just a selection effect: if you fly fairly straight while an AI shoots at you, you are much more likely to be hit, and one is much more likely to be flying fairly straight if there is no bandit on your six.  

 

Edited by unreasonable
  • Haha 1

Share this post


Link to post
Share on other sites
8 hours ago, unreasonable said:

AI cannot yet track and predict a curving target path. He may hit you while you are turning, provided that the inbuilt variation in aiming point relative to predicted target point, plus the natural spread of his guns, makes his pattern at the target's range wide enough. But the more accurate he is, the less likely he is to hit if his prediction is off.

 

If the AI seems to be good at high deflection shots, even at considerable ranges, that is probably just a selection effect: if you fly fairly straight while an AI shoots at you, you are much more likely to be hit, and one is much more likely to be flying fairly straight if there is no bandit on your six. 

Sounds reasonable, unreasonable.

 

The likely reason behind is that the AI operates in decision cycles and doesn't have memory.

 

The AI takes into account your current speed and vector, calculates your path as a straight line, adjusts his aim accordingly, and (under)shoots.

In the next cycle, several hundred milliseconds later, he repeats the procedure, but again based on your current speed and vector.

 

This way, a curved path is broken down for the AI as a polygon consisting of straight line segments, each being tangential to your actual (curved) flight path.

This "flight polygon", as abstracted by the AI, is drawn around the imaginary circle of your flight path, therefore the AI is always aiming a bit outside and behind.

 

To correct this, the difference from the previous path prediction should be calculated and extrapolated for the current segment, or something like this.

 

Just speculation :salute:

  • Upvote 1

Share this post


Link to post
Share on other sites
15 hours ago, sniperton said:

To correct this, the difference from the previous path prediction should be calculated and extrapolated for the current segment, or something like this.


Though my knowledge of programming extends effectively no further than the basic python scripts I did back in high school, and there's an assumedly 200% chance that this solution would hit far more than one roadblock along the way in implementation, do you think that there would be a way for a given AI pilot to effectively keep track of the rounds they fire without murdering the sim speed?

Keeping the AI's existing aiming point intact- and for reasons of both simplicity and realism applying this tracking only to tracer rounds, the AI could adjust its aiming point based off of whether or not the rounds are making contact rather than some extrapolation of target data.


While this is obviously an extremely simplified scenario, the tracer rounds fired from an AI aircraft at a target could effectively run a series if/then statements upon reaching the target's range, whereupon they would determine if the rounds were either long, short, or on target, causing the AI to adjust accordingly and effectively zero in on the target.

Here's a laughable attempt at trying to explain what I mean in computer logic in an ideal world which is definitely not realistic. 
I don't even know what language IL2 is written in so expect my syntax to be even further off than the AI's aim. (Like a whole dimension off of any language for that matter)

For Tracer Round:
[
If distance traveled = target range
     [
     If Target hit: aircraft maintain attitude

     else
           [
          If undershot: aircraft pitch up

         else

          If overshot: aircraft pitch down
           ]
     else
           [
          If left: aircraft yaw right

          else

          If right: aircraft yaw left]
           ]       
      ]
else
      [
     If distance traveled < target range: check distance traveled

     else

 

     If distance traveled > target range: do nothing
      ]

]

Again, please don't take this series of if/then statements literally as some sort of magic solution in my eyes, I haven't coded anything in years and am definitely not a game developer.  I could maybe get a computer to say hello world if given like a day to bash my head against a keyboard, but this is just a history major's scatterbrained attempt at speculating a potential solution.

If anyone wants to tell me one of the probably hundred or so reasons this wouldn't work please do so lol.

Share this post


Link to post
Share on other sites

Hm - the closer the airplanes are, the better would this current speed and heading thing work. 

I guess at 100m a burst aimed that way would still mark its target. 

So how about editing the distance an ai pilot opens fire at?

ace 100

vet 200

average 300

rookie 400

 

seems also historically plausible. 

Share this post


Link to post
Share on other sites

@EisenfaustusUnfortunately, that would punish higher-level AIs in any non-deflection situation.

 

@Ram399

I guess the problem is not with the AI code, but with the underlying geometry model.

Read the image from right to left:

 

 

image.jpeg.7f5a1ae1845fc39775f6e9ad9c3fca98.jpeg

The blue circle line represents your actual flight path.

The green dots represent the moments of time when the code is run again and again in intervals of a few hundred milliseconds.

In these calculation cycles, taking a few milliseconds each, the AI estimates that based on your current speed and vector you’re travelling along the dotted red line towards a point in space represented here by an orange dot.

This would be a fair estimate if you were travelling in a straight line, but you’re not.

In the next cycles the AI makes the necessary corrections, but again and again based on your current speed and vector, and consequently misses again and again (as long as you maintain a curved path).

 

 

I repeat that all this is just hypothesis, but if basically correct, the solution could be quite simple.

To the upper left the light blue arc represents the vector change of the target since the last estimate.

To the lower left you can see that roughly 1/3 of this vector change should be added as a correction factor to the AI's estimate.

 

 

 

 

Share this post


Link to post
Share on other sites
4 hours ago, sniperton said:

@EisenfaustusUnfortunately, that would punish higher-level AIs in any non-deflection situation.

 

Why? Closing in is always a good idea - and most historic aces told in interviews that that was the secret for their succes - getting so close you cant miss...

 

I say it would benefit ace ai even more in a no-deflection situation as there they will do tremendous damage in one burst instead of wasting their whole ammo on a single target

Share this post


Link to post
Share on other sites
43 minutes ago, Eisenfaustus said:

 

Why? Closing in is always a good idea - and most historic aces told in interviews that that was the secret for their succes - getting so close you cant miss...

 

I say it would benefit ace ai even more in a no-deflection situation as there they will do tremendous damage in one burst instead of wasting their whole ammo on a single target

 

IIRC the range at which AI opens fire is already dependent on it's experience level, but making AI shoot only at very short range would not work in a variety of situations.  I do not think it is practical.

 

If you are in a high deflection shot, with a flight path at right angles to the target,  closing to 100m is a recipe for a collision: it is less than a second of flight time at 500kph.  (It might be OK if you are flying a Fokker Dr1 in FC!) 

 

If you are attacking bombers with defensive gunners you may need to suppress their gunners at greater range: close that much before firing and you will almost certainly be hit.  Attacking bombers head on (not sure if the AI can actually do this yet as it requires either great luck in initial positioning or forwards planning) the rapid closure plus defensive fire meant that fighters routinely opened fire from well over 1,000m

 

In non deflection scenarios it also greatly increases the risk of losing your own plane to debris strikes. 

Share this post


Link to post
Share on other sites
51 minutes ago, Eisenfaustus said:

Why? Closing in is always a good idea

Because it gives you more time and opportunity to dodge the attack.

If you can be sure that a rookie won't be able to hit you from 400 m, and at the same time you are assured that an ace, who would be, won't fire from that distance, it would give you a very good chance to evade the attack at the very last moment -- an attack that probably would have killed you from 400 m.

Share this post


Link to post
Share on other sites
1 hour ago, sniperton said:

Because it gives you more time and opportunity to dodge the attack.

If you can be sure that a rookie won't be able to hit you from 400 m, and at the same time you are assured that an ace, who would be, won't fire from that distance, it would give you a very good chance to evade the attack at the very last moment -- an attack that probably would have killed you from 400 m.

At 400m attacks seldom did anything other than warn a victim of the attackers presence...

Very very few - even of the top aces - were able to sucessfully kill a flying airplane at 400m...

 

1 hour ago, unreasonable said:

If you are attacking bombers with defensive gunners you may need to suppress their gunners at greater range: close that much before firing and you will almost certainly be hit.  Attacking bombers head on (not sure if the AI can actually do this yet as it requires either great luck in initial positioning or forwards planning) the rapid closure plus defensive fire meant that fighters routinely opened fire from well over 1,000m

Attacking bombers from 1km away was completely useless - and how do you suppress a tailgunner? He has nowhere to, nowhere to hide - his only chance of survival is to shoot back...

You might spoil his aim a little - but the defensive fire will suppress the fighter. He might dodge and abort the attack, loose his nerve and stall the plane or do something stupid like wasting ammo at 1km and having run out of it when in relevent distance (for a huge four engined bomber something like 300m)

 

Attacking Bombers with effective gunner sfrom behind is dangerous and thus was evaded when possible...

1 hour ago, unreasonable said:

If you are in a high deflection shot, with a flight path at right angles to the target,  closing to 100m is a recipe for a collision: it is less than a second of flight time at 500kph.  (It might be OK if you are flying a Fokker Dr1 in FC!) 

right angle is not a decent attack position - at anything more than 30° ai's main concern should be maneuvering to a better position instead of leading ther target :)

Share this post


Link to post
Share on other sites
6 hours ago, unreasonable said:

not sure if the AI can actually do this yet as it requires either great luck in initial positioning or forwards planning

I've been able to get the AI to do this by acting as flight leader and positioning my flight in the path of the bombers, but they only hit the bombers very rarely- and after the initial run they continue on with standard attacks straight onto the bombers 6, generally getting torn up by gunners in the process.

As far as engagement ranges for bombers go historically, these guncam videos are a great resource- just be advised some of them are a bit graphic.
 


 

  • Upvote 2

Share this post


Link to post
Share on other sites
8 hours ago, Eisenfaustus said:

At 400m attacks seldom did anything other than warn a victim of the attackers presence...

Very very few - even of the top aces - were able to sucessfully kill a flying airplane at 400m...

 

Attacking bombers from 1km away was completely useless - and how do you suppress a tailgunner? He has nowhere to, nowhere to hide - his only chance of survival is to shoot back...

You might spoil his aim a little - but the defensive fire will suppress the fighter. He might dodge and abort the attack, loose his nerve and stall the plane or do something stupid like wasting ammo at 1km and having run out of it when in relevent distance (for a huge four engined bomber something like 300m)

 

Attacking Bombers with effective gunner sfrom behind is dangerous and thus was evaded when possible...

right angle is not a decent attack position - at anything more than 30° ai's main concern should be maneuvering to a better position instead of leading ther target :)

 

No-one disputes that results from close attacks were much more likely to be successful, but the reality is that the majority of attacks started at long range. Opening fire at very short range is only practical when you can sneak up on an unaware target or he is helpless for some other reason.  If it were possible to program AI so that it could discriminate tactically and vary opening range accordingly, your very short range ace AI proposal might be useful. As a blanket suggestion it is impractical and ahistoric.  

 

US analysis of German gun cameras (BLR report 727) shows that the average distance at which fighters opened fire at Spitfires in 1942 was 500m.   For all target attacks the median battle distance was 260m (that is the average of opening fire and breaking off).   In 1943-44 the median battle distance for all targets (by then mostly bombers) was 980m, so German fighters were usually opening fire at long range.

 

Long range attacks were not useless: see in this table that even at 1200-1600m range 13% of passes in this case started fires.  Note that some hits (especially AP) are not observable at long range on the films.  While your single shot hit probability is very low, German fighters by the late war - especially Fw190s - carried a lot of guns and a large ammo load. They were not looking to conserve ammo to make some absurd "ace in a flight" MP video.    

 

126208911_BRLsnip1.thumb.JPG.73e040fac462dbcca399440139bdc041.JPG340996164_BRLsnip2.thumb.JPG.21e4f448818c2d825dff8b85dd8f5125.JPG

 

You suppress an enemy gunner by killing him, and the longer you fire at the target the better chance you have of doing so, especially since the fighters often had poor tracking accuracy and needed tracers and time to make adjustments to get on target. 

 

Attacking bombers from the rear hemisphere was the most common attack pattern, about twice as frequent as from the front, also about twice as successful. See report for details.

 

Close to a right angle is sometimes the optimum attack angle: against IL-2s for instance, as it exposes the cockpit area, including fuel tanks. 

 

   

 

 

3 hours ago, Ram399 said:

I've been able to get the AI to do this by acting as flight leader and positioning my flight in the path of the bombers, but they only hit the bombers very rarely- and after the initial run they continue on with standard attacks straight onto the bombers 6, generally getting torn up by gunners in the process.

As far as engagement ranges for bombers go historically, these guncam videos are a great resource- just be advised some of them are a bit graphic.

 

I have had the same problem.   The films show a variety of ranges and angles, but one must also bear in mind that they have been selected for "entertainment" purposes: I think the report gives a clear analysis of the overall picture.

 

Downloadable here:  https://www.deutscheluftwaffe.com/archiv/Dokumente/ABC/a/Alliierte/US Air Combat Records WW II.pdf

Edited by unreasonable
  • Thanks 1
  • Upvote 2

Share this post


Link to post
Share on other sites
5 hours ago, unreasonable said:

I think the report gives a clear analysis of the overall picture.


Wow thats a great source, I might have to read through the entire thing lol

I do see what you mean by the tail attack being common and effective, as the opening abstract of the report lays out:
96643383_Invulnerablehm.jpg.65febe9ad3167aaaa73f5bfcd6b756a7.jpg

I'm not sure if I'd describe the FW-190 as invulnerable, but an above 50% chance of scoring a kill on a heavy 4-motor from the back is impressive, clearly the USAAF didn't have access to AI Pe-2 gunners.

Share this post


Link to post
Share on other sites
7 hours ago, unreasonable said:

You suppress an enemy gunner by killing him

You don't neccessarily have to kill him. Imagine you sitting or lying behind your gun and suddenly bullets impact the fuselage near you, maybe mine shells exploding, that might be enough to make you panic. Even if you go on shooting, you most likely are not John Rambo and keep shooting well aimed. But yes shooting on high distance was quite common, as it gives the pilot a good feeling, when nearing the enemy.

And two things often are forgotten, when it is about how deadly it is to attack a bomber from its six. On long distances you need to guess the distance quite well, otherwise you will shoot over or under your target, because you are not shooting with laser beams. Your bullets are on a curved trajectory. And second, on these distances you have a lot of spread in your bullets. It is not like in the game, that an enemy shoots at you and you have dozens of holes in your aircraft, as a lot of the fired bullets simply pass your aircraft because of the spread.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...