Jump to content

The Lamentable State of AI Gunners


Recommended Posts

Posted

 

The He 111 here has "ace" AI. And yet, because of how aim is computed with defensive guns, they're almost completely useless from angles that aren't dead ahead or dead astern. Even with flaps down and two gunners shooting at me, they struggle to land hits at 100m range; I need to approach and literally hit them with my wing before their aim becomes accurate enough to hit me with most of their shots.

 

Of course, depending on the angle of approach they're also capable of scoring consistent hits at 800m+.

  • Sad 1
Posted

I find this interesting as in my experience online I've had gunners smoke my engine from extreme ranges. Not sure if it was AI or an actual human shooting at me but I was surprised for sure. It seems for some reason that Russian guns/gunners are more effective for some reason in my experience.

Posted (edited)

Just background for those who are not aware - all defensive guns go through the same error calc. The main factors that feed into this calc are G loading, skill, difference in velocity vector between gunner and target and a small randomness and an initial shot loading which reduces as the AI gunner fires successive shots at the same target. I believe on top of that 3-dimensional error is added weapon dispersion error due to inherent design of the weapon and heat. Burst length is a random value chosen from a fixed range and this range is not influenced by skill or weapon characteristics. Also, a random time between shots is chosen from a range without regard to skill or weapon requirements. I believe this tends to lead to weapons overheating fairly quickly and therefore large errors plus potentially pauses in firing. 

 

I base this conclusion on the belief that stock AI gunners appear to fire a random length burst of between 1 and 1.5 secs with only a random length wait of between 1 and 2 secs between bursts. For say an M2 with an 850-rpm fire rate you fire about 14 rounds a sec. Looking at real world M2 TM 9-25 and assuming that the game correctly models temperature gain due to firing and resulting dispersion I see the below. So, while it does say combat firing is unrestricted and it is talking about stoppages and cook offs not dispersion due to heat, with the AI firing between 14 and 21 rounds every 1 to 2 secs you can see that it is quite likely the AI will exceed the recommended burst values and wait times quickly for the M2 leading to dispersion increases due to heat. My theory is to make things work better you would likely need to have an AI gunner definition for each weapon type or perhaps move the AI Gunner burst length and wait time out of the gunner bot config to the weapon definition. In an ideal world skill would likely be a factor in burst management as well as morale (ie desperation might make a gunner fire very long bursts).

 

I have done some tentative work around grouping weapons by heating to have different burst lengths for a future version of the AI Gunnery mod. I already attempt to address this a little by changing burst length by available ammo supply as there is a stock game feature where gunners can fire out to 3x normal range if they have more than 150 rounds available. The AI Gunnery mod removes this 3x range feature in its later releases and instead gunners will fire out to their weapon's range and use better (but still not correct for each weapon) burst length based on available ammo. So, I have a WW1 brief, short, med and long and Fe2B gunner definition and a WW2 brief, short, med and long gunner definition where brief, short etc corresponds to a burst length based on ammo. Fe2B has its own def, so the gunner actually becomes useful (in my opinion).

 

From a mod viewpoint if I ever get around to a temp-based version of AI Gunnery I have to go the route of a specific AI gunner definition for each defensive weapon type as that is all that is available to me. Unfortunately, ammo supply is also a factor so instead of maybe 13 bot definitions (there are about 12-13 different defensive weapons) I might end up with something like 50 odd. This is one reason why I haven't worried about it so far.

 

image.png.9183945f871dc1b7864155f2acdcda4d.png

image.png.8cd0b9b6bdb4dbf21abe2735357850b5.png

image.png.799a341ac0613a79f31ecbf71ff1564f.png

 

The biggest base error generator is a large difference in velocity vector so works the same across all situations. Possibly Russian weapons are less prone to overheating, I can't remember off the top of my head.

 

Weapon arcs also play a large part in how well a bomber can defend itself. Aircraft without proper turrets and overlapping fields of fire are not good at defending against fighters. Currently in IL2GB bombers don't really hold defensive formations so this also impacts how well a group of bombers survives.

 

Additionally, there are skill-based values that influence how fast an AI gunner will acquire/reacquire a target and how far out the gunner will look for/fire on targets and the minimum range. Higher skill is generally better - some minimums are the same for all skills as are some values like how often the AI Gunner will search for a target. Plus, some other parameters like the max time a gunner will wait to fire after aiming. I believe these types of values are mainly to make the AI appear more organic.

 

Charon and I have had this conversation previously and I obviously agree that the AI for gunners has problems - I've spent a lot of time and effort creating and maintaining the AI Gunnery mod to attempt to improve things. It really does need the dev team though to have spare budget to rework it as essentially, like all mods, there is a large element of guesswork and deduction involved in what I do whereas the dev can see the code and know for sure how parameters impact things.

 

It is possible to have a dedicated server use the AI gunnery mod and as a server-side mod my belief is this would be inherited by clients even if they do not have the AI Gunnery mod loaded. It does take more work to get the dedicated server to do this (in fact you have to use another mod, see thread below and my post from July 16, 2024. Unfortunately, the thread seems to have been unpinned, which is a shame as it's useful for people setting up a dserver for the first time). Offline and locally hosted games are very easy to arrange to have AI Gunnery used. Possibly the point that with dserver the mod is a server-side mod if used may assist the online servers to use AI Gunnery, IE I believe the server version of the mod will override any changes a client tries to make in this space. Similarly for the AAA mod which I have conclusively proved to be a server-side mod and client-side versions of the AAA mod are completely ignored. The tests I used to prove this are what led to my post in the thread linked below. Generally, where dserver is concerned - it seems for clients only cosmetic mods (like terrain retextures etc) are used. All the stuff like AI Gunnery or the AAA mod which affect gameplay must be loaded on the dserver install to have any effect based on tests I have done. Obviously, the tests have not been exhaustive though so I cannot guarantee that there is no chance for someone to cause problems via a client-side mod. I don't believe they can from what I've seen so far is all I can say.

 

 

Edited by Stonehouse
  • Like 2
1PL-Husar-1Esk
Posted

Do  wounds or been on fire affect AI gunner shooting efficiency?

Posted (edited)
15 minutes ago, 1PL-Husar-1Esk said:

Do  wounds or been on fire affect AI gunner shooting efficiency?

 

Not that I am aware of. Nothing in the turret AI gunner bot definition file appears to be part of a concept like that where wounds add additional error factors, there may be something else buried in the code base but that is unavailable to us. There are hit points defined in the character bot (eg below) but I believe these are like an on/off switch in that hits points remain and the gunner functions, no hit points remain triggers the dead 3d character which despawns after a set time (note that the despawn time is only 15 secs after death in stock not 120 as below, for simplicity I used a file from the AI gunnery mod). First value eg LifeRate is the direct projectile or explosive hit points available, 2nd value eg LifeRateFrag is the hit points available for fragmentation damage. I assume consuming either will cause the characters death. There are also specific values for head damage. Again I assume consuming life or head points = death.

 

You'd need to ask your question to the dev team for confirmation.

 

image.thumb.png.b66e844656b8dd536b828583f981edec.png

Edited by Stonehouse
better example pic
  • Thanks 2

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