• There seems to be an uptick in Political comments in recent months. Those of us who are long time members of the site know that Political and Religious content has been banned for years. Nothing has changed. Please leave all political and religious comments out of the forums.

    If you recently joined the forums you were not presented with this restriction in the terms of service. This was due to a conversion error when we went from vBulletin to Xenforo. We have updated our terms of service to reflect these corrections.

    Please note any post refering to a politician will be considered political even if it is intended to be humor. Our experience is these topics have a way of dividing the forums and causing deep resentment among members. It is a poison to the community. We appreciate compliance with the rules.

    The Staff of SOH

  • Server side Maintenance is done. We still have an update to the forum software to run but that one will have to wait for a better time.

AI Enhancement Testing - Need Everyone's Help!

gecko

Charter Member
I've been thinking some about how dogfights with the AI play out and how they often don't reflect real dogfights. Most of the time, all the aircraft fight to the death until one side has been annihilated and the victors move on. In real life pilots often commented on how quickly they found themselves one minute in a fierce battle and the next in an empty sky. And quite obviously, most fights did not end in the complete destruction of either side, with the majority of the aircraft involved usually returning home.


In CFS3 I think this comes down to the distance at which the AI will turn to engage an enemy. Right now it appears to be just under two miles. This may or may not be realistic, but it does seem to contribute to the unrealistic scenario mentioned above. We can alter this using the pilotconstants.xml, located in the main directory. If you are interested in helping test some changes, here's what you need to do:


First, research - read first hand combat reports and note any mention of the distance at which enemy aircraft were spotted, also note how they disengaged whether finding a suddenly empty sky, escaping a pursuing enemy, or being outrun by a fleeing enemy. In the latter two cases, note the distance at which pursuit was abandoned. Post your findings here. The idea is to get an accurate picture of what realistic engagement distances were.


Second, fly with the labels turned on and note the distance shown on the label at which you can pick out the actual aircraft the label is indicating. Try it with several different types of aircraft and post an average. (Hint: turn your resolution up as high as it will go. It will allow you see more clearly and usually doesn't effect performance)


Third, make changes to the pilotconstants.xml in notepad. My theory is that the AI sees corresponds to what the player can see with labels turned on. Bogeys (white) are ignored and enemies (red) are engaged. The distances at which these labels appear and change are controlled in this section of the pilotconstants.xml:


<!-- Vision range, class, and rangemods per class -->
<!-- NOTES:


1. The ranges and rangemods are listed in REVERSE order from that
in the spec and the PB variables list. The order they should be
listed in this file is from near to far.

2. There should be a VisionRangeMods_ClassX entry for each VisionClass
except the first one. They should be numbered starting with 1.
For example, for 5 vision classes, you should have 4 rangemods named
as follows:
VisionRangeMods_Class1
VisionRangeMods_Class2
VisionRangeMods_Class3
VisionRangeMods_Class4
Each one should have exactly as many values as there are VisionRanges.
Class 0 is skipped because the "Blind" class is a special case.

The way this data is used is flexible enough to allow the designers
to define more finely grained ranges and classes so that the benefits
of adding skill points to vision are more gradual, if such is ever
desirable.

Close = Name Label
Normal = Type Label
Far = Bogie Label
Extreme = No label


-->
<entry name="VisionRanges" type="int=string"
value="0=None,400=Close,1500=Normal,3000=Far,6000=Extreme" />
<entry name="VisionClasses" type="int=string"
value="0=Blind,1=Below Average,26=Average,51=Above Average,76=Superior" />
<entry name="VisionRangeMods_Class1" type="int" value="0,-100,-400,-800,-1500" />
<entry name="VisionRangeMods_Class2" type="int" value="0,0,0,0,0" />
<entry name="VisionRangeMods_Class3" type="int" value="0,525,875,1125,1000" />
<entry name="VisionRangeMods_Class4" type="int" value="0,1050,1750,2250,2000" />
<!-- -->


I don't exactly know what does what, but the bolded items are the relevant values. Play around with them and see what results you get from the AI and note how your dogfights progress. As we figure it out, we can try to fine tune it to better reflect the research we collect. As this is a somewhat imprecise process, the more testers we have collecting information, the better. If all goes well, perhaps we can do another version that would better reflect combat at night.


Also, there may be other tweaks buried in this file. I'm currious about the G-Tolerances section, perhaps we can get the AI to manuever more violently by tweaking values in there.


All are welcome to join in, the more the better.


Daniel
 
Gecko,

I think it also has to do with how you write the mission and the spawn files.

I have an escort mission flying P-40s escortying B-25s.I use spawn files for the Japanese planes to intercept bombers,They usuaaly make a few passes but then fly away after my fighters engage and shoot a few down.My guess is because of the last waypoint in my spawn.I set it to about 4 or more miles and land anywhere.I'm not certain that is the answer but it happens quite often in my missions.


Talon
 
Interesting, I've never seen that happen. Perhaps spawned aircraft behave differently?
 
hi gecko,
its a great idea to get people testing the tweaks to the pilotconstants.xml.
IIRC the AI pilots in campaigns have their baseline starting vision allocated in the range that is specified in the pilotattributes.xml. whether that applies to random spawned pilots in non-campaign missions, I don't know.

The pilotconstants.xml also dictates the rate at which AI wingmen improve their skill levels. As skill improves through shooting down aircraft in a campaign, your AI wingmen gain skill, which I assume is distributed across vision, health and gtolerance. The rate at which skill and therefore vision health and gtolerance improve is determined by formulae set out in the pilotconstants.xml.

I get a bit confused trying to get my head around the interaction betwen pilotconstants and pilotattributes. However I have found that the parameters in the pilotconstants.xml determine the rate at which various attributes are gained by you and your wingmen during a campaign. Just how enemy AI get their skill points and other attributes like vision is unclear - I just assume they get a random allocation based upon the same factors that you can observe in the *.cmpstat files showing your AIwingmen.

I have read somewhere, further to Talon's post, that the different mission directives determine AI behaviour - they engage enemy at a greater distance for some directives.

At a guess I'd say that "intercept" is the directive in which they engage enemy at the furthest distance, and "sweep" and "recon" somewhat less so?

But I've also speculated, like you post gecko, that the vsion of the AI enemy determines when the white "bogey" turns into a blue or red square on the TAC - and that is the distance at which the fighters turn in and start to engage the enemy.

Interesting thread :jump:
 
Great post Daniel! At first glance it appears that the file pilotconstants.xml is geared to the campaign, we know that cfs3 comes alive in this mode and that the ai behave differently to what they do in qc.

The OFF creators have tweaked the ai and (not seen it myself) claim to have improved their performance. I guess they're still working with the cfs3 files. Might be something to gleen from that?

From all I've read over the years, the massive, endless swirling dogfights that folks clamour for in flight sims is the stuff of myth. Most pilots never saw who shot them down and most pilots never hit anything either. One thing I'd like to see and never have is the ai turning tail and making a run for home rather than engaging. I think BoB2 covers this pretty well. The ai will also disengage when fuel is low too.

Will certainly try tweaking those values.
 
Much of it does seem directed at the campaign mode, but a quick test with massive changes in the above mentioned values resulted in an AI that was blind as a bat and wouldn't act like you were there until quite close. So I think we can make something of it for all game modes.
 
Excellent idea!

For me, this is one of the most excellent ideas I've read this year.

Do we have an award at SOH for this kind of initiatives? If not, lets make one.

I'm so busy with real life that I can't find the time to play of develop. But you almost made me do it.

Good luck!

RemcoC
 
Some ranges according to the CFS3 labels:

White labels appear at about 3.25mi
They turn red at about 2mi
The pilot's name starts to be displayed at about .9mi

Not sure how this correlates with the numbers in the file. Plugging the numbers I gathered into a units conversion calculator didn't show any matches or anything close to the numbers in the file. But somehow they are tied together.
 
These things work better when you read the directions! The file has some great notes at the top on how to interpret the values, now that I've actually read them, here's what I found out:

The bolded numbers below are the ones that control the label ranges. Those in red are modifications of those ranges based on an individual pilot's "vision points." I have zeroed these out to eliminate that variable from the testing so that all pilots will use the bold numbers for their ranges without any changes regardless of how many vision points they have.

<entry name="VisionRanges" type="int=string"
value="0=None,400=Close,1500=Normal,3000=Far,6000=Extreme" />
<entry name="VisionClasses" type="int=string"
value="0=Blind,1=Below Average,26=Average,51=Above Average,76=Superior" />
<entry name="VisionRangeMods_Class1" type="int" value="0,0,0,0,0" />
<entry name="VisionRangeMods_Class2" type="int" value="0,0,0,0,0" />
<entry name="VisionRangeMods_Class3" type="int" value="0,0,0,0,0" />
<entry name="VisionRangeMods_Class4" type="int" value="0,0,0,0,0" />

I've also been doing some research, but finding the kind of information I need is proving more difficult than I thought. Any help here would be most appreciated.
 
Right now, you'r achieving things that Microsoft couldn't achieve for us back when CFS3 came out.............................................I hope that one day what has been done here and in any other CFS3 related website, shows that even though it was a bad sim, when people came together we turned it into a new sim, one that people could never think of happening.
 
crikey.....i never play campaign and if indeed the whole ai behavior is different then I've missed out on some depth here I guess......love to see you madmen sort this out!!! great post!!!
 
I don't play the campaign either, this mod will effect AI behavior in every game mode.
 
After round 1, I think I have a start. Feel free to test these lines in your pilotconstants.xml (make a backup first!) If you do use them, please comment on it here about your results. Note: This mod does not improve AI tactics, skill, or aggressiveness. It only shortens the distance at which they will see and engage enemy aircraft with the goal of having more aircraft on both sides eventually disengaging and surviving the fight.

<entry name="VisionRanges" type="int=string"
value="0=None,400=Close,2100=Normal,2500=Far,3200=Extreme" />
<entry name="VisionClasses" type="int=string"
value="0=Blind,1=Below Average,26=Average,51=Above Average,76=Superior" />
<entry name="VisionRangeMods_Class1" type="int" value="0,0,0,0,0" />
<entry name="VisionRangeMods_Class2" type="int" value="0,0,0,0,0" />
<entry name="VisionRangeMods_Class3" type="int" value="0,0,0,0,0" />
<entry name="VisionRangeMods_Class4" type="int" value="0,0,0,0,0" />
 
I have never tried to modified this file but in the past, some did it and noted changes in AI behaviour.


Note that the distance at which an AI aircraft will engage player formation will vary from one mission to another. If you setup intercept, the AI will turn to the player direction from a greater distance than sweep or CAP. This also means that it will be more agressive, trying to keep contact more longer before turning back.


For me, the worst thing about AI is that it will always dogfight. This means that an AI Corsair has no chance against a Zero and a 109 can't do anything against a Spitfire.
 
i will wish , to based on what led has stated i will change skill levels ..... make my side skiiled 3 and the other side 1 plus this change .... for a mission based on air dog fighting and bombers


will report
 
Just reading the pilotconstants.xml. It says
"The way this data is used is flexible enough to allow the designers to define more finely grained ranges and classes so that the benefits
of adding skill points to vision are more gradual, if such is ever desirable."

Close = Name Label = 400
Normal = Type Label = 1500
Far = Bogie Label = 3000
Extreme = No label = 6000

So in stock file, the bogey label shows up between 3000 and 6000 metres (<entry name="VisionRanges" type="int=string"
value="0=None,400=Close,1500=Normal,3000=Far,6000= Extreme" />

In the stock pilotconstants.xml :

<entry name="VisionRangeMods_Class1" type="int" value="0,-100,-400,-800,-1500"/>
<entry name="VisionRangeMods_Class2" type="int" value="0,0,0,0,0"/>
<entry name="VisionRangeMods_Class3" type="int" value="0,525,875,1125,1000"/>
<entry name="VisionRangeMods_Class4" type="int" value="0,1050,1750,2250,2000"/>

Vision classes (VisionClasses" type="int=string" value="0=Blind,1=Below Average,26=Average,51=Above Average,76=Superior")
1 skill point gives you Below Average vision class
26 skill points gives you Average vision class (where the rangemods are 0,0,0,0, and so the default visionrange applies)
51 skill points gives you Above Average vision class where the visionrange is modified by the factors 0,525,875,1125,1000. This means that an AI pilot with over 51 skill points allocated to vision will see the type label out to 3000+1125m which equals 4125m.
A highly skilled AI pilot (more than 76 skill points allocated to vision) will see the type label quite far away (between 3250m and 5250m). this is worked out by taking 1500 + visionrange mod class 4 of 1750 =3250

Cross referencing with the pilotattributes.xml file - this is my range of vision attributes for AI pilots:
<Attribute Name="vision" Default="40" Min="35" Max="66"/>
That means for my AI pilots, the most points allocated to vision will be 66. Hence the best they can have is Above average visionclass (51-76 skill points).
Perhaps I should be more generous :icon_lol:
 
Just reading the pilotconstants.xml.
51 skill points gives you Above Average vision class where the visionrange is modified by the factors 0,525,875,1125,1000. This means that an AI pilot with over 51 skill points allocated to vision will see the type label out to 3000+1125m which equals 4125m.

Hi Daiwilletti,

Now the question is:
One: If we limit the range for AI-pilots, will they start a dogfight less often? If so, we could alter the AI-behaviour.
(Perhaps this is one of the tweek they did in the WW1 add-on of CFS3)

Second question: Is this a general setting that affects all AI-planes, or can we vary between them? (Which would be the preferred option)

If these are stupid questions I apologise - I'am not an expert like some of the other guys around here.

RemcoC
 
I found some useful info on pilot vision here:

http://answers.google.com/answers/threadview?id=267988


http://blogs.discovermagazine.com/badastronomy/2009/01/15/how-far-away-is-the-horizon/

The second link is particularily interesting as it talls about distance to the horizon at altitude.


I think overall if the ai pilots saw you only at shorter ranges it would be better overall. You'd have more chance of surviving in a bomber mission for example.

Without readng all of the posts again, is the ai vision different at night?
 
Back
Top