Jump to content

Editing Aircraft Flight Models


SilentEagle

Recommended Posts

I wanted to get a discussion going about the modding possibilities opened up with FC2.0, specifically regarding the flight model of aircraft in Flaming Cliffs. Through my own investigation, along with that of several others, the new flight model files (SFM only) and characteristics have been realized. However, the exact identification of coefficients in the files is quite confusing, so I thought some public discussion could shed some light on the matter.

 

WARNING: These modifications are mainly for single player, teams who use specific aircraft flight models, and modders who wish to create new aircraft for this game. Do not use modified flight models on public servers without permission from the server host! While some may check the integrity of this file, the ones that do not may kick or ban users who abuse this modding capability. Please be responsible and keep the game fun and fair for others.

 

GENERAL:

The two files being examined here are the SFM_Engine.lua and the SFM_aerod.lua file that are contained in the FC2\Scripts\Aircrafts\_Common folder.

 

The basic structure of the files is not hard to understand. You have a list of aircraft that can be modified corresponding to their unique plane ID number. Adding entries to these files for other aircraft is possible by adding to this list and adding the parameters in the same fashion as those below.

 

Some conclusions can be made by studying some basic equations of motion and forces that ED has posted on their site here: http://lockon.co.uk/?end_pos=10&scr=list&page=4#345

 

However, not all coefficients are made available, and not all match up with the name given on their site.

 

For some reason, the only aircraft included in these files are the F-15, A-10, Su-27, and the Yak-40. Other aircraft cannot be simply modified, as that would require all coefficients to be present in the files. This data is not available and must be hard-coded in the game, so modifications made to other flyables or AI aircraft must be created from scratch unless ED provides those values.

 

It is my understanding that the values of the coefficients in this file are for a specific altitude (maybe sea level) or are just arbitrary, but are modified by hard-coded equations governing flight dynamics at all other conditions and flight levels.

 

SFM ENGINE:

This file contains the thrust values for the engines of each aircraft based on the mach number in which the aircraft is flying. These values appear to be in kN units and are the sum of thrust for both engines combined.

 

typeng=# (0 - Non-afterburning engine, 1 - Afterburning engine)

dcx_eng =# (unsure of this parameter)

hMaxEng =# (unsure of this parameter)

dpdh_f =# (unsure of this parameter)

dpdh_m =# (unsure of this parameter)

engtab1 = { (this is the table of coefficients that use mach number to determine the values of thrust. All values are interpolated for speeds between those listed in the table. Further additions of data between these values is possible, for example: M=0.1)

 

M - Mach number.

Pmax - Maximum military thrust available at corresponding mach no.

Pfor - Maximum afterburning thrust available at corresponding mach no.

 

I am unsure if the previous two values are added together when the aircraft is in afterburner, or if the game only uses the Pfor value.

 

If you try to add too much thrust and exceed the maximum mach no. in the table for that aircraft, the game will either crash or your plane will shut off it's engines and become useless. Higher mach numbers are possible by changing the upper limit mach, for example: M=3.9 to M=5.0

 

SFM AEROD:

This file is quite complex when compared to the engine file. It contains most (probably not all) coefficients for characterizing the flight model of each aircraft.

 

kjx =# (unsure of this parameter)

kjz =# (unsure of this parameter)

Czbe =# (unsure of this parameter)

cx_gear =# (Drag coefficient of the gear in the direction of flight)

cx_flap =# (Drag coefficient of the flaps in the direction of flight)

cy_flap =# (Lift or normal force coefficient of the flaps in the normal direction to that of flight)

cx_brk =# (Drag coefficient of the air brakes in the direction of flight)

aertab1 = { (this is the table of coefficients that use mach number to determine the aerodynamic values. All values are interpolated for speeds between those listed in the table. Further additions of data between these values is possible, for example: M=0.1)

 

M - Mach number.

Cx0 - Drag coefficient of the aircraft in the direction of flight. (skin friction, pressure drag, etc.)

Cya - Normal force coefficient of the wing and body of the aircraft in the normal direction to that of flight. Inversely proportional to the available G-loading at any Mach value. (lower the Cya value, higher G available)

B - Directly proportional with the amount of speed lost in high-G turns. (lower the B value, the better the aircraft manages speed in turns)

B4 - Has something to do with lift, but unsure.

Omxmax - Has something to do with roll rate. Directly proportional to the roll rate of the aircraft at the corresponding Mach number.

Aldop - Unsure, but my guess is something to do with angle of attack.

Cymax - Maximum normal force coefficient that can be generated using the governing equations.

 

CONFUSING TESTING RESULTS:

- By reducing B4, I seemed to have more lift.

- Cya doesn't seem to be just lift. If you make the value high, you will not be able to pull back on the stick and change your aircraft's flight path because there is too much normal force on your jet. Decreasing this value allows your nose to move much more freely. It seems like this value is the degree to which your angle of attack affects lift or normal force.


Edited by SilentEagle
  • Like 2
Link to comment
Share on other sites

Just to add some clarification :

 

It seems possible to add characteristics for other aircrafts in the two aforementionned files. But of course, there is no base value accessible to modify, so they must all be guessed - or tested

Adding entries to these files for other aircraft is possible by adding to this list and adding the parameters in the same fashion as those below... Other aircraft cannot be simply modified, as that would require all coefficients to be present in the files. This data is not available and must be hard-coded in the game, so modifications made to other flyables or AI aircraft must be created from scratch unless ED provides those values.

Yep.

i7 7700K | 32GB RAM | GTX 1080Ti | Rift CV1 | TM Warthog | Win 10

 

"There will always be people with a false sense of entitlement.

You can want it, you can ask for it, but you don't automatically deserve it. "

Link to comment
Share on other sites

Just to add some clarification :

 

It seems possible to add characteristics for other aircrafts in the two aforementionned files. But of course, there is no base value accessible to modify, so they must all be guessed - or tested

 

Yes, exactly! That's what I was trying to say about adding aircraft to the list. I have attempted to do this, but there are too many missing base values to try and guess them for the aircraft you want to change.

 

Also, the weight of the aircraft does not appear to be listed in any file. You can change the weight in the plane's lua file, but it is only a cosmetic effect, as the actual aircraft weight does not change.

Link to comment
Share on other sites

Well I tried copying the F-15's performance data exactly for the Harrier via copy and paste. Added in the WorldID entry and renamed the data to AV_8B. But it didn't make a difference.

 

I also gave the Harrier the F15's aerodynamic data. Guess I got something wrong in the code because it made no difference. Have you successfully managed to alter the flight models then?

 

Perhaps for the Harrier because I didn't change the engine type value it rejected the changes?

Eagles may soar, but weasels don't get sucked into jet engines.

Link to comment
Share on other sites

You might try that, because my modified AV_8B is using typeng = 0.

 

Another interesting note about the harrier is that no matter how much lift you give it (or the flaps) at slow speed, the aircraft still falls out of the sky at exactly 60 knots in a very weird manner.

 

To counter this, I fly my harrier performance with at least 20 m/s of headwind.

 

Also, good luck landing the harrier in a vertical or short manner. It has to be a very perfect landing and you cannot set it down NEARLY as hard as the real guys do it.

Link to comment
Share on other sites

like this?

 

 

 

You might try that, because my modified AV_8B is using typeng = 0.

 

Another interesting note about the harrier is that no matter how much lift you give it (or the flaps) at slow speed, the aircraft still falls out of the sky at exactly 60 knots in a very weird manner.

 

To counter this, I fly my harrier performance with at least 20 m/s of headwind.

 

Also, good luck landing the harrier in a vertical or short manner. It has to be a very perfect landing and you cannot set it down NEARLY as hard as the real guys do it.

" any failure you meet, is never a defeat; merely a set up for a greater come back, "  W Forbes

"Success is not final, failure is not fatal, it is the courage to continue that counts,"  Winston Churchill

" He who never changes his mind, never changes anything," 

MSI z690MPG DDR4 || i914900k|| ddr4-64gb PC3200 || MSI RTX 4070Ti|Game1300w|Win10x64| |turtle beach elite pro 5.1|| ViRpiL,T50cm2|| MFG Crosswinds|| VT50CM-plus rotor Throttle || G10 RGB EVGA Keyboard/MouseLogitech || PiMax Crystal VR || 32 Samsung||

Link to comment
Share on other sites

Yeah, but that is not a vertical landing, it is a carrier-landing simulation (F-35C). But good video :)

 

By the way, about the Harrier, I think little-dog has told me the same thing (he managed to modify the FM, but it would always stall at 60 knots)... Don't know if there is a value somwhere to avoid that. I had also noticed that weight in lua doesn't do anything.

 

Keep on sharing findings :thumbup:

Link to comment
Share on other sites

I didn't check yet anything about FM but just a quick thought .

 

Taking AFM of the Su25's and porting them with specifics parameters to for example a Su30 or a MiG29.. now is to find where is the AFM.

 

It definitely to a much better result than just SFM + their scripts ..

Fly it like you stole it..

Link to comment
Share on other sites

Stalls are scripted. Perhaps the minimum stall speed is in this script, since the Simple Flight Model probably doesn't account for VTOL/STOL and 60 kts is a very low speed for regular flight (unless ultralights are to be simulated :) ).

 

Also don't forget that the Harrier cannot do VTOL with full fuel or heavy weapon load, you you need to test an nearly empty aircraft.

Link to comment
Share on other sites

SE, I see the cat's out of the bag now... ;)

[sigpic]http://www.virtualthunderbirds.com/Signatures/sig_LD.jpg[/sigpic]

Virtual Thunderbirds, LLC | Sponsored by Thrustmaster

 

Corsair 750D Case | Corsair RM850i PSU | ASUS ROG MAXIMUS X CODE | 32GB Corsair DDR4 3200 |

Intel i7-8086K | Corsair Hydro H100i v2 Cooler | EVGA GTX 1080 Ti FTW | Oculus Rift |

X-Fi Titanium Fatal1ty | Samsung SSD 970 EVO 1TB NVMe | Samsung SSD 850 EVO 1TB | WD Caviar Black 2 x 1TB |

TM HOTAS Warthog | TM Pendular Rudder | TM MFD Cougar Pack | 40" LG 1080p LED | Win10 |

Link to comment
Share on other sites

New findings (not completely conclusive, however):

 

-Cya is inversely proportionally related to the available G-loading at any Mach value. (lower the Cya value, higher G available)

-B is directly proportional with the amount of speed lost in high-G turns. (lower the B value, the better the aircraft manages speed in turns)

 

I still do not know exactly what these values are, however.

Link to comment
Share on other sites

Interesting stuff, So in flaming cliffs 2 is it possible to create a completely new plane with its own flight model without over riding existing plane slots? Or are will still stuck with losing a plane when we add a new one. :cry:

Mods I use: KA-50 JTAC - Better Fire and Smoke - Unchain Rudder from trim KA50 - Sim FFB for G940 - Beczl Rocket Pods Updated!

Processor: Intel Q6600 @ 3.00GHz

GPU: GeForce MSI RTX 2060 6GB

RAM: Crucial 8GB DDR2

HDD: 1TBGB Crucial SSD

OS: Windows 10, 64-bit

Peripherals: Logitech G940 Hotas, TrackiR 5, Voice Activated commands , Sharkoon 5.1 headset. ,Touch Control for iPad, JoyToKey

Link to comment
Share on other sites

These ID's are easy to make. Just write 32 random Hex-Chars. The chance, that your random ID already exists is really low. And if the Game brings up an error, just change a Char.

 

That's way i added a new Country.

 

 

But back to topic.

I want to edit the MiG-29K. There should be the F-15C Cockpit+FM. As 3D-Model I will use a custom made.

 

Is it possible?

Link to comment
Share on other sites

  • 3 months later...

I'm speculating here, since there is no official documentation, so these are my guesses so far:

 

The Simple Flight Model (SFM) flight characteristics are controlled by:

Scripts\Aircraft\Common\sfm_aerod.lua : airframe aerodynamics

 

Scripts\Aircraft\Common\sfm_engine.lua : engine thrust and fuel consumption

 

Scripts\Database\planes\<aircraft.lua> : aircraft dimensions, fuel, weight, sensors

 

In Scripts\Aircraft\Common\sfm_aerod.lua

'x' values appear to be drag.

'y' values appear to be lift.

'z' values are ? possibly roll ?

 

 

kjx appears to be the dimensionless (clean) airframe drag coefficient (at 0 AoA one would guess). Could also be wing area in square meters (as that is a major factor in drag calculations) but seems too small for the value given for the Su-27

 

kjz ?

 

Czbe : is a negative value, so possibly is the downward facing Coefficient of lift of the elevator

 

cx_gear : the dimensionless drag coefficient when the gear is fully deployed (down/out)

 

cx_flap : the dimensionless drag coefficient when the flaps are fully extended

 

cy_flap : the dimensionless lift coefficient when the flaps are fully extended

 

cx_brk : the dimensionless drag coefficient when the airbrake is fully extended.

 

aertabl1 : speed-dependent quantities.

M : Mach number

Cx0 : Zero-lift drag coefficient (see this wikipedia page for more info)

Cya: Lift coeficient (possibly at 0 AoA)

B : ?

B4 : ?

Omxmax : ?

Aldop : Possibly max-AoA for linear lift increase (AoA at stall point)

Cymax : maximum lift coefficient (lift coefficient never exceeds this)

 

In Scripts\Aircraft\Common\sfm_engine.lua

typeeng : 0 for non-afterburning (eg. turbofan), 1 for afterburning engine

dcx_eng : (total guess) dimensionless drag coefficient of a stopped engine

hMaxEng : ? possibly max thrust per unit fuel

dpdh_f : fuel consumption rate in kilos per hour when at max afterburner

dpdh_m : fuel consumption rate in kilos per hours when at mil power (100%)

 

engtabl1 : speed-dependent thrust (measured in Newtons)

M : Mach Number

Pmax : Thrust in Newtons at mil power (100% fan)

Pfor : Thrust in Newtons at max power (full afterburner). Same as mil power for non-afterburning engines.

 

So that's my best guesses until I find an equation that links B, B4 and the rest (which I guess is possibly some quartic-power effect)

 

The Simple Flight Model is so simple (perhaps it should be the 'Primitive Flight Model') that most of the known equations on (wiki/wiki uni) have far more variables. The hard part is guessing what to leave out to match these variables.

 

c0ff or ED team member: care to clarify my mistakes/guestimates?


Edited by Moa
Link to comment
Share on other sites

What I got from the ED team is that the values in the SFM lua's merely alter variables slightly. Major changes in those files will generally not result in what you wanted. You can not tweak it in the way the data presents in LUA. You have to have your own tool for instant calculations of performance. If you plan to tweak fundamental data and then estimate the performance - 100% it will fail. The coupling with the recorded data and thrust/aerodynamics constants is very complicated and if you plan to tune something in turn rate or otherwise by changing thrust or drag, for example, you can not do it without total wreckage in excessive power (acceleration).

 

;)

i7 7700K | 32GB RAM | GTX 1080Ti | Rift CV1 | TM Warthog | Win 10

 

"There will always be people with a false sense of entitlement.

You can want it, you can ask for it, but you don't automatically deserve it. "

Link to comment
Share on other sites

Thanks Blaze. That's a bit disappointing really. Creating a tool is straightforward but there is not much point if the effect on flight characteristics is obscured. There are excellent free tools out there for doing flight dynamics, eg.

 

The NASA engine simulator

http://www.grc.nasa.gov/WWW/K-12/airplane/ngnsim.html

 

JSBSim (among others)

http://jsbsim.sourceforge.net/

 

Open-source (Java and Fortran) F-16 flight dynamics model from Caltech

http://www.cds.caltech.edu/~murray/projects/afosr95-vehicles/models/f16/

 

Larcsim (used by NASA and previously in FlightGear)

http://portal.acm.org/citation.cfm?id=887912&dl=GUIDE&coll=GUIDE&CFID=97604837&CFTOKEN=28918154

 

So, the modelling bit is easy using these tools - the problem is you're saying they have little effect on the performance of the aircraft (presumably hard-coded values have greater influence).

Link to comment
Share on other sites

But without being able to access the fundamental data in the encrypted files, just merely editing the values in the lua's to what you gather from your collected data will be completely useless and just make things worse. Unfortunate...

i7 7700K | 32GB RAM | GTX 1080Ti | Rift CV1 | TM Warthog | Win 10

 

"There will always be people with a false sense of entitlement.

You can want it, you can ask for it, but you don't automatically deserve it. "

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...