Hi Taras!
Glad to see you here!

Yes, I make an overall rework aimed at making compatible the use of helicopters in the same slot for both the player and the AI.
Actually is avaliable only in BAT, not in single mods, but I will make a "Chopper Mod" to extend it to all.
Personally I find the result obtained satisfactory, even if not totally perfect for what concern Human side.
But ATM it is the maximum you can get if you want to use the same slot Player / AI, with all the facilities and positive consequences on the level of playability.
Anyway, here you can find an explanation of what I do in FM and Java side.
FLIGHT MODEL VALUES:From AH-64.fmd (Not yet released)
[Mass]
Empty 5165.0
TakeOff 10450.0
Oil 10.0
Fuel 1110.00
Here put RL values, fuel is in kilograms
Wingspan 14.6
Here put rotor dimeter
[Squares]
Wing 168
Here put rotor surface
CDiveBrake 1
AirbrakeCxS 0.15
Let airbrake works and give a value of 0.15
Vmin 3
Vmax 300.0
VmaxAllowed 365.0
VMax in level flight and critical speed
[Polares]
lineCyCoeff 0.09
AOAMinCx_Shift 1.0
Cy0_0 0.15
AOACritH_0 20.0
AOACritL_0 -16.0
CyCritH_0 1.5
CyCritL_0 -0.7
CxMin_0 0.028
parabCxCoeff_0 7.2E-4
These works very well
From GeneralElectric.emd (AH64FM)
Type Radial
Select piston type
[T-700-GE701C(L)]
HorsePowers 1890.0
BoostFactor 1.0
TowFactor 1.0
Direction Left
EngineI 10.0
EngineAcceleration 3.0
[T-700-GE701C(R)]
HorsePowers 1890.0
BoostFactor 1.0
TowFactor 1.0
Direction Right
EngineI 10.0
EngineAcceleration 3.0
For twin engine Helys, make 2 versions of same engine, 1 rotating left and 1 right)
PropDiameter 4.0
This diameter allows high maximum speeds, but reduces acceleration readiness (to be resolved with the VerticalThrust code in java), smaller diameters are good for slower helicopters.
Smaller diameter in a Hely with powerful engine cause overspeed of engine with overheat and KO.
CODE#1: Vertical ThrustThis is the main code of new chopper mod
Here code from AH-64 (plane not released yet)
public void computeVerticalThrust()
{
boolean isControlledByAI = true;
if (this.FM.isPlayers() && (this.FM instanceof RealFlightModel))
{
isControlledByAI = !((RealFlightModel) this.FM).RealMode;
}
float x = this.FM.EI.engines[0].getThrustOutput();
float ias = Pitot.Indicator((float) (((Tuple3d) ((FlightModelMain)FM).Loc).z), FM.getSpeed()) * 3.6F;
float y = cvt(ias, 0.0F, 170F, 1F, 0.1F);
float z = cvt(this.FM.getAltitude(), 0.0F, 6000F, 1F, 0.5F);
float Thrust1 = 0.0F;
if(this.FM.EI.engines[0].getStage() > 5 && this.FM.EI.engines[1].getStage() > 5 && this.FM.EI.getPowerOutput() > 0.2F && isControlledByAI && ias < 15F) // AI
{
Thrust1= 2.2F*x;
}else if(this.FM.EI.engines[0].getStage() > 5 && this.FM.EI.engines[1].getStage() > 5 && this.FM.EI.getPowerOutput() > 0.2F && isControlledByAI && ias > 15F) //for AI
{
Thrust1= 1.25F*x;
}else if(this.FM.EI.engines[0].getStage() > 5 && this.FM.EI.engines[1].getStage() > 5 && !isControlledByAI) //for Human
{
Thrust1= 1.7F*x;
}
this.FM.producedAF.z += Thrust1 * (10F * FM.M.referenceWeight + 10F * FM.M.fuel) * (1F * y) * (1F * z); // (10F * FM.M.referenceWeight + 10F * FM.M.fuel +)
}
In the new Hely scheme the position of the propeller in the .fmd file is like in normal aircraft (and as in the old Hely AI).
Then, it is necessary to give them a vertical thrust to take off like a true helicopter.
float x = this.FM.EI.engines[0].getThrustOutput();
This code means that the vertical thrust is proportional to the amount of throttle you intend to give.
float y = cvt(ias, 0.0F, 170F, 1F, 0.1F);
This means that at ias=0 (indicated air speed =0) the vertical Thrust ratio will be 1, at 170 will be 0.1).
float z = cvt(this.FM.getAltitude(), 0.0F, 6000F, 1F, 0.5F);
This means that at sea level you have 100% of vertical thrust, at 6000m only 50%, with a similar code an Hely without extarnal stores can takeoff till 4000/4500m.
if(this.FM.EI.engines[0].getStage() > 5 && this.FM.EI.engines[1].getStage() > 5 && this.FM.EI.getPowerOutput() > 0.2F && isControlledByAI && ias < 15F) // AI
{
Thrust1= 2.2F*x;
}else if(this.FM.EI.engines[0].getStage() > 5 && this.FM.EI.engines[1].getStage() > 5 && this.FM.EI.getPowerOutput() > 0.2F && isControlledByAI && ias > 15F) //for AI
{
Thrust1= 1.25F*x;
This is the AI code part, it means that below 15km/h the vertical thrust value is 2.2 times the throttle input, so at 100% thrust the chopper have a value of 2.20, and when passed 15km/h this ratio decrease to 1.25, to prevent the helicopter from overturning due to excessive pushing upwards. This code works only with throttle over 20% to prevent problems when Landing.
}else if(this.FM.EI.engines[0].getStage() > 5 && this.FM.EI.engines[1].getStage() > 5 && !isControlledByAI) //for Human
{
Thrust1= 1.7F*x;
}
This is the Human part, value is always at 1.7 because player can manage the throttle to prevent overturning.
this.FM.producedAF.z += Thrust1 * (10F * FM.M.referenceWeight + 10F * FM.M.fuel) * (1F * y) * (1F * z);
This is the final part of the code, the function indicates that the reference value at the throttle (Thrust1) is multiplied by the empty weight (10F * FM.M.referenceWeight) added to the weight of the fuel (+ 10F * FM.M.fuel) and then multiplied first by the aforementioned variable relating to speed (1F * y) and finally multiplied by the altitude variable (1F * z).
CODE#2: Orizzontal thrustpublic void computeOrizzontalThrust()
{
boolean isControlledByAI = true;
if (this.FM.isPlayers() && (this.FM instanceof RealFlightModel))
{
isControlledByAI = !((RealFlightModel) this.FM).RealMode;
}
float x = this.FM.EI.engines[0].getThrustOutput();
float y = cvt(this.FM.getSpeedKMH(), 0F, 200F, 1F, 0.0F);
float Thrust2 = 0.0F;
if(this.FM.EI.engines[0].getStage() > 5 && !isControlledByAI) //Human only
{
Thrust2= 0.3F*x;
}else if(this.FM.EI.engines[0].getStage() > 5 && this.FM.getSpeedKMH() > 2F && isControlledByAI) // only AI
{
Thrust2= 0.25F*x;
}
this.FM.producedAF.x -= Thrust2 * (10F * FM.M.mass) * (1F * y);
}
This code generates a negative thrust that reduces with increasing speed, it is necessary at takeoff, otherwise the helicopter would accelerate too quickly and unrealistically along the longitudinal axis.
float x = this.FM.EI.engines[0].getThrustOutput();
also this code works with the throttle
float y = cvt(this.FM.getSpeedKMH(), 0F, 200F, 1F, 0.0F);
At speed=0, the negative thrust is 100%, at 200 is 0.
if(this.FM.EI.engines[0].getStage() > 5 && !isControlledByAI) //Human only
{
Thrust2= 0.3F*x;
}else if(this.FM.EI.engines[0].getStage() > 5 && this.FM.getSpeedKMH() > 2F && isControlledByAI) // only AI
{
Thrust2= 0.25F*x;
}
also here, different values betweem AI and Human
this.FM.producedAF.x -= Thrust2 * (10F * FM.M.mass) * (1F * y);
The negative thrust is equal to the coefficient given by the throttle multiplied by the total mass (empty weight + fuel + loads) multiplied by the variable speed
CODE#3: OrizzontalThrust2public void computeOrizzontalThrust2()
{
float x = this.FM.EI.engines[0].getThrustOutput();
float Thrust3 = 0.0F;
if(this.FM.EI.engines[0].getStage() > 5 && this.FM.EI.getPowerOutput() > 0.0F && this.FM.getSpeedKMH() < 0.0F)
{
Thrust3= 0.35F*x;
}
this.FM.producedAF.x += Thrust3 * (10F * FM.M.mass);
}
This code generates a positive thrust when the speed tends to decreases below zero. It is a security code that helps human to avoid overturn....
CODE#4: Hoveringpublic void computeHovering()
{
float x = this.FM.EI.engines[0].getThrustOutput();
float ias = Pitot.Indicator((float) (((Tuple3d) ((FlightModelMain)FM).Loc).z), FM.getSpeed()) * 3.6F;
float y = cvt(ias, 0F, 100F, 1F, 0.0F);
float Thrust4 = 0.0F;
if(this.FM.EI.engines[0].getStage() > 5 && ias < 50F && this.FM.getSpeedKMH() > 10F && this.FM.CT.StabilizerControl) //Human only
{
Thrust4= 0.45F*x;
}
this.FM.producedAF.x -= Thrust4 * (10F * FM.M.mass) * (1F * y);
}
Enabling level stabilizer below 50 km/h IAS, speed decrease till 10 km/h (it depends by hely, in some case could be 6, another could be 12), let the Helicopter in hovering.
Is very useful to land on a spot or for use gun turrets or aim guided missiles.