Nice F-4. Does it fly?
Yes..... and no.
This is why I am having to write the wind tunnel. It flies perfectly .... up until about 200 feet. Then things start to go wrong.
I have looked at the code a hundred times and I can't see anything wrong, so I am having to get forensic. With such a complex flight dynamics model, it's currently about 400,000 lines of code, a simple mistake can be a nightmare to find.
By having a wind tunnel, I can test the aerodynamics without any of the other systems.
It also means that when the FDM is finished, modders can work out bugs in aircraft really quickly.
For example look at the lift code from the F4.
/// <summary>
/// Calculates generated lift
/// </summary>
/// <returns>Lift</returns>
public override double Lift()
{
double lift = 0;
double q_w = aux.Getqbar() * WingArea;
/// Get the lift due to alpha
double t = MathUtils.TableLookup1D(aux.Getalpha(), lda_row, lda_data);
lift += t;
/// Lift due to elevator deflection
lift += 0.25 * q_w * fcs.GetDePos(2);
/// Delta lift due to flaps
lift += 0.4 * q_w * fcs.GetDfPos(2);
/// Lift due to boundary layer control
lift += 0.15 * q_w * aux.AircraftVariables["Boundary layer control"];
/// Delta lift due to speedbrake
lift += -0.05 * q_w * fcs.GetDsbPos(2);
return lift;
}
It's pretty standard code. You could use most of that in any aircraft and just tweak the constants. The only none standard system is the boundary layer control. To take care of situations like that, I have added a modder controlled variable pool. You can create your own variables and store them in the pool. Anything in the pool can be monitored by the wind tunnel and will be recorded on a save game.
The code is in C#, which actually means you can use the wind tunnel to work out your constants, then port the code to Java and drop it in IL2