PDA

View Full Version : AI behaviour



pburnage
December 27th, 2009, 22:17
Hi guys!

It's been a long long time...
I think I might have understood something about AI behaviour. It might have been posted already, but I could not find anything about it yet.

Ever since we started building planes and missions with Gregg (Pen32Win), we have been very keen on giving the AI a decent flight model that would behave properly in missions, under any circumstances. We could not figure out how to have a realistic flight model for the flyable aircraft that could be handled by CFS2 for the AI, so I came up with a separate airfile for the AI (and also a separate model so as to have different textures and better frame rate, and a different dp...) that took a long long time to tune,thanks to Gregg's efforts and patience.

I was at my parents place for Christmas and set up a Saitek AutoPilot module and rudder pedals for my father on his FSX rig. The AP module has a pitch trim wheel, and it really is a joy to use. So far, when I needed trimming on CFS2, I had always used the keyboard, and never found it very convenient. As I came back home yesterday, I fired up CFS2 (happens so rarely these days....) and tried to set up a rotary control on my joystick to control pitch trim. I then realized how different the sensitivity of pitch trim control was from one aircraft to another.

I woke up this night and suddenly the heavens opened, a divine light shone on me and a voice from above spoke onto me:"the AI are on autopilot, thus they are not controlled by any virtual joystick input, but by adjustment of trim, be it elevator, ailerons or rudder. If trims settings in the airfile are not properly set according to the other aerodynamics parameters, then the AP loop cannot control the AI correctly and diverges. This results in porpoising, AI unable to align a target, etc. etc." Then another voice spoke to me "will you stop moving like this in bed and go back to sleep?". I could not. I had to check. So I got up and switched the computer on.

I tried with the AF_Hawker Typhoon. As it was, the AI flew straight (thanks to Gregg), but I could not tune the elevator trim precisely enough on the flyable. So I added the following lines in the cfg file:

elevator_trim_effectiveness = 0.3
aileron_trim_effectiveness = 1.0
rudder_trim_effectiveness = 1.0

With these settings, I could tune the elevator trim, but now the AI would go up and down in slow motion. I looked for elevator trim entries in the airfile. In the primary aerodynamics section 1101, there is a pitch moment trim range value. This value divided by 1024 is the amount of elevator trim applied each time the elevator trim is incremented (I read this somewhere ages ago but never realized how important it could be). Then again, changing this value would affect the AI behaviour.

So this theory seems to hold. AI are on autopilot and are thus controlled through trim adjustments. I wish I had time to experiment more than this, but I know I won't, so I thought I'd better pass it to the community. Some of you may have the time to check and experiment this, and find some ways to set trim control values according to other aerodynamic parameters. I hope it helps increase our knowledge of this sim and improve it.
Cheers.

Jagdflieger
December 27th, 2009, 22:25
Holy smokes! Great to see you down in the basement again.

AI behavior has always been tricky, even in FS 9. I too have generally had AI specific flight models in order to make them behave and bomb as directed. Some of the Faithful have managed to work out realistic flight models for both AI and player in the same file, but that's beyond me.

At any rate, your epiphany should open some new doors to flight model tuning.

Thanks!

bobhegf
December 28th, 2009, 02:00
I pulled out my old manual and chapter nine gives you the player a real good discription of how the AI think and work.I always fly 1% aircraft but fight stock AI.I lowered my guns to strong so I have to get in close to get a kill.

tonybones2112
December 29th, 2009, 18:38
Holy smokes! Great to see you down in the basement again.

AI behavior has always been tricky, even in FS 9. I too have generally had AI specific flight models in order to make them behave and bomb as directed. Some of the Faithful have managed to work out realistic flight models for both AI and player in the same file, but that's beyond me.

At any rate, your epiphany should open some new doors to flight model tuning.

Thanks!

I have some new .dps and maybe try some of the overhauls for the stock planes, but I'm tired of Bettys flying along on one wing or setting an engine on fire and watching it blaze away and then go out. Self sealing tanks were not installed into the Bettys until the model 34, by then it late war and too late.

Who did the original damage profiles, Mahatma Ghandi?

Grumpy Bones

bobhegf
December 29th, 2009, 22:01
I have the same problem with them. I sure hope you can figure out how to fix it. Also there is the same problem with the zero.

tonybones2112
December 30th, 2009, 00:52
I have the same problem with them. I sure hope you can figure out how to fix it. Also there is the same problem with the zero.

Bob, one of the things will help is having the i% version of an aircraft you fly and examine the .dp file for the effectiveness of the weapon. I picked up on one of the guys explaining the stock Zero 7.7 mm gun is set at 11 while the Browning .30 is set at 8 in Allied stock aircraft. The stock .50 is 14 while 1% sets theirs at the accurate 18.4. I modified the stock P-38 over to the 1%. I have a nightfighter skin for my stock P-38 that I fly a lot, the Bettys ain't so tough but seeing them fly on with one wing is sort of discouraging. Look in that gunstation string in your .dp file that has the "1d1*," entry, the number right after that is how much punch your weapon has.

Here is Akemi's entry for his Ki-46 Dinah III KAI with the 37mm gun:

gunstation.1=0,31,2,1,610,2,0.1,400,5,100,1d1*105, 0,0.81,-2.8,-70,0,0,0,0,0,0,16.79

Note his entry for this gun as 105, here is the same plane, the Alpha Ki-46 Dinah III KAI:

gunstation.1=0,46,2,0.38,575,2,0.04,900,4,40,1d1*8 0,0,1.17,-2.0948,-60,0,0,0,0,0,0,16.79

Akemi's planes are deadly, he really did his homework on his ballistics and weaponry. The only reason I fly the AS Ki-46 is not Akemi's plane, but my joystick drifts just a little on his Ki-46. It don;t do it on another computer and joystick. I can trim the Alpha perfect.

Bob, when I look up and sight in on a Stirling or B-29 from below, a bomb could go off next to me and I would not know it. I just don;t like port/starboard drift and trim it dead stone still. All respect to the guys at Alpha but same plane, same gun(according to Francillion) different values, so I set the Alpha at 105.

I suppose the folks who redid the stock planes for aircraft have set the damage profiles more accurately for the Zeros and Bettys than the folks at MicroPacifists. For two months I have had an orgy of downloading, I'm going to refine my downloads and pay closer attention now to the stock AC. Two of my favorites are stock planes with different textures(P-38 in nightfighter colors, the 52 Zeke as an armed, operational trainer with orange undersurfaces).

Good flying to you and...

Banzai!

Bonesimoto

sc7500
December 30th, 2009, 08:50
...I'm tired of Bettys flying along on one wing or setting an engine on fire and watching it blaze away and then go out. Self sealing tanks were not installed...

I worked that particular annoyance out a while back after a cue from B24Guy - try these two entries in place of whatcha got, and see if the desired result is a Good Thing:
----------------------------------------------
[EFFECTS.x]
; System = Engine
effect.0=10,LIBRARY,fx_smkpuff_m,
effect.1=40,LIBRARY,fx_fuelleak_m,
effect.2=50,LIBRARY,fx_engfire_m,
effect.3=60,LIBRARY,fx_engfire_l,
effect.4=95,LIBRARY,fx_airexpl_l,
effect.5=99,BOMB,,
effect.6=100,BREAK,7, <-- [more than one engine = ,8, ,9, etc]
-------------------------------------------------------------
; System = Fuel Tank
effect.0=10,LIBRARY,fx_fuelleak_s,
effect.1=60,LIBRARY,fx_gastank_m,
effect.2=95,LIBRARY,fx_airexpl_l,
effect.3=100,BOMB,,
effect.4=30,LIBRARY,fx_fuelleak_m,
effect.5=60,LIBRARY,fx_gastank_l,
effect.6=95,LIBRARY,fx_airexpl_m,
effect.7=99,BOMB,,
effect.8=100,LIBRARY,fx_volcano,,

----------------------------------------------

And, if you want a REALLY big boom...

[EFFECTS.x]
; System = Call it what you will...
effect.0=20,LIBRARY,fx_fuelleak_s,
effect.1=60,LIBRARY,fx_gastank_m,
effect.2=95,LIBRARY,fx_airexpl_l,
effect.3=100,BOMB,,
effect.4=30,LIBRARY,fx_fuelleak_m,
effect.5=60,LIBRARY,fx_gastank_l,
effect.6=90,LIBRARY,fx_airexpl_m,
effect.7=99,BOMB,,
effect.8=100,LIBRARY,fx_volcano,,
effect.9=20,LIBRARY,fx_fuelleak_s,
effect.10=50,LIBRARY,fx_gastank_m,
effect.11=85,LIBRARY,fx_airexpl_m,
effect.12=95,BOMB,,
effect.13=99,LIBRARY,fx_gastank_l,
effect.14=100,LIBRARY,fx_volcano,,


Stand Back
SC
:kilroy:

Nole
December 30th, 2009, 09:19
In TR's tute on Flight Tuning AIs/Wingmen ( http://www.simviation.com/simviation/?type=item&ID=301&page=6 ), I learned that problems with AI delivering weapons is almost always related to the Pitch MOI being set too high in either the AIR or CFG file or both. I have found this to be true. Usually, reducing this number to 25% of the original eliminates the issue altogether. More importantly, I've also discovered that by reducing all of the MOI numbers by half until the issue with AI weapons delivery is resolved yields AIR and CFG files that are usable by both the player and AI/wingmen. This eliminates the need for dedicated AI versions of player aircraft.