In the same class, for the following method variable "f" is the AI skill. Note how it's used to increment variable envLighting by 150 for each step in AI skill, on this line:
envLighting += f * 150F;
I interpret envLighting as a measure of how well a plane can be seen, sort of a surrogate for contrast.
Note also how Main.cur().dotRangeFoe.dot() is used separately for calculating envLighting under the conditions of Sun and Moon lighting. This suggests a role is played by the dot range parameter?
private static boolean checkAmbientPos(Point3d point3d, Point3d point3d1, Aircraft aircraft, Actor actor, float f, boolean flag)
{
envLighting = com.maddox.il2.ai.World.Sun().lightAtAlt((float)point3d1.z);
float f1 = (float)(point3d.z * -1.2960000276507344E-005D);
tmpVGr2.set(tmpVGr1);
tmpVGr2.normalize();
if(tmpVGr2.z >= (double)f1)
envLighting += 0.05F;
if(com.maddox.il2.ai.World.Sun().ToSun.z > 0.0F)
{
envLighting *= 0.7F * (float)Main.cur().dotRangeFoe.dot();
return (double)envLighting > tmpVGr1.length();
}
boolean flag1 = false;
Aircraft aircraft1 = null;
if(actor instanceof Aircraft)
aircraft1 = (Aircraft)actor;
if(aircraft1 != null && (aircraft1.FM.CT.bAntiColLights || aircraft1.FM.AS.bLandingLightOn || aircraft1.FM.AS.bNavLightsOn || aircraft1.FM.AS.astateTankStates[0] > 4 || aircraft1.FM.AS.astateTankStates[1] > 4 || aircraft1.FM.AS.astateTankStates[2] > 4 || aircraft1.FM.AS.astateTankStates[3] > 4 || isShooting(aircraft1) || aircraft1.FM.AS.astateEngineStates[0] > 3 || aircraft1.FM.AS.astateEngineStates[1] > 3 || aircraft1.FM.AS.astateEngineStates[2] > 3 || aircraft1.FM.AS.astateEngineStates[3] > 3 || aircraft1.tmSearchlighted != 0L && Time.current() - aircraft1.tmSearchlighted < 1000L))
{
envLighting = 6000F;
flag1 = true;
}
if(!flag1)
{
Vmoon.set(com.maddox.il2.ai.World.Sun().ToMoon);
Vlight.set(com.maddox.il2.ai.World.Sun().ToLight);
double d = v_1.dot(Vmoon);
double d1 = v_1.dot(Vlight);
d = Math.abs(d);
d1 = Math.abs(d1);
envLighting *= 2500F;
if(d > 0.96599999999999997D || d1 > 0.96599999999999997D)
envLighting = 0.5F * (float)Main.cur().dotRangeFoe.dot();
}
envLighting += f * 150F;
if(flag)
{
if(Mission.isSingle() && aircraft != null && aircraft1 != null && (aircraft1.FM instanceof Maneuver) && (aircraft.FM instanceof Maneuver))
{
AirGroup airgroup = ((Maneuver)aircraft1.FM).Group;
AirGroup airgroup1 = ((Maneuver)aircraft.FM).Group;
if(airgroup1 != null && airgroup != null && !AirGroupList.groupInList(airgroup1.enemies[0], airgroup))
envLighting *= 0.5F;
}
return (double)World.Rnd().nextFloat(0.0F, envLighting) > tmpVGr1.length();
} else
{
return (double)envLighting > tmpVGr1.length();
}
}
This portion below is interesting, as it suggests to this Java monkey that if both aircraft are maneuvering, the envLighting value is halved, which impacts the visibility distance threshold.
if(flag)
{
if(Mission.isSingle() && aircraft != null && aircraft1 != null && (aircraft1.FM instanceof Maneuver) && (aircraft.FM instanceof Maneuver))
{
AirGroup airgroup = ((Maneuver)aircraft1.FM).Group;
AirGroup airgroup1 = ((Maneuver)aircraft.FM).Group;
if(airgroup1 != null && airgroup != null && !AirGroupList.groupInList(airgroup1.enemies[0], airgroup))
envLighting *= 0.5F;
}
return (double)World.Rnd().nextFloat(0.0F, envLighting) > tmpVGr1.length();
} else
{
return (double)envLighting > tmpVGr1.length();
}