realistic flight physics function library, anyone interested?

4.15 compatible version is up.

NOTE: link to example project 2 on the marketplace page is still for 4.14 version for now, here’s 4.15 version: sim_template_130_415.zip - Google Drive (with some small improvements)

Hello!

I’m trying to understand World scale and its effects on physics.

In your previous jet fighter example, you set the world scale at 0.1 . If I increase the Engine Full Power, I can reach high speed (above Mach 2). However once I set the world scale at 1.0 in EFM, the physics goes wrong around Mach 1.5 .

My problem is for modeling it seems easier to have 1 unit = 1cm.

Do I need to make everything smaller(/10) to have a fast aircraft? Is there a way around it?

You can go mach 2 in 1:1 scale just fine. It’s just that in fighter example all values were set to work best at 1:10. So, just changing world scale to 1:1 and increasing engine power will make it go at effectively mach 20, in sea level air density no less. This results in forces order of magnitude greater than during space shuttle reentry, in a plane designed for maneuverability. You’d need a lot more than 60fps to keep that stable :slight_smile:
If you go mach 2 with a properly sized plane, it will work no problem.

In your “sim_template_120_413”, the world scale is indeed set to 1.0 , but if I increase the engine full power to 60000000.0, the physics go crazy around M1.13 .

So is it because of the shape of your airplane? I thought it didn’t matter? I mean I though it could be any shape and the variables of your plugin would control the attitude?

Maybe something wrong on my side…!?

That is correct, actual shape doesn’t matter. What matters in this case is stability, damping, and control sensitivity settings. If you want your plane to remain controllable at very high speed, those numbers need to be a lot lower, or things start happening faster than the framerate of your simulation can handle.
Now, you can always just increase substep so it can handle faster changes, but i’d recommend turning down those settings anyway, because that’s the realistic option (try flying a fighter jet slowly in any other simulator, you’ll notice that the controls have a lot of “give”, due to low stability and damping those planes have in reality).

EDIT: if you want to bend the reality a little, there’s “linear stabilty”, “linear damping”, and “linear control sensitivity” options, those will make those forces scale linearly with speed (rather than speed squared). This will make your plane behave more evenly at high and low speed, but it’s not realistic.

Thank you for the explanation. After playing with theses variables I managed to get the attitude I needed! :slight_smile:

Just a small preview of the next update.

It’s fixing what I consider EasyFM’s biggest weakness - its inability to model asymmetric lift.
This will be turned off by default however. Partially because it takes more computing power (i’m recalculating lift on multiple points along aircraft’s wing span),
and partially because the results, while realistic, can get rather unpleasant:

Don’t try this in VR :slight_smile:

2.30 is now out. Sorry it took so long, had trouble with compiler.

Anyway, lift asymmetry simulation is in.
All you have to do is to turn it on, adjust the wing span to roughly match that of your plane (or make it shorter to make effect less pronounced, or longer to exaggerate it)
and number of points at which the lift is calculated (Default should be fine for most situations, more is (slightly) more accurate but eats up more CPU)
The only additional thing you really need to set is “Lift asymmetry portion”, this controls blending between classic model and asymmetric one (maybe controlled by “realism” slider in your game? :cool: ).

And finally under debug you have a parameter “Debug Force Scale” that allows you to visualize how it works:

In addition to that, the physics substepping option is now gone, but the functionality remains. The plugin will now read physics settings of your project and use that. No action required on your side, it will just work.

EDIT: example project 2 / “sim_template” has been updated to use this, same link as before: https://drive.google.com/open?id=0B20tIRBAcOlscHltYVgxZHhyNzQ

EDIT2: if you use asymmetry, also consider reducing, or completely turning off roll damping, since this should give you enough “natural” roll damping by itself.

hello,

first off great job with this, i think i’ve spoken to you before on youtube about 1 or 2 years ago and i’m quite happy that you decided to release this as a plugin.

i do have a bit of feedback for you though and i am curious of your thoughts on these subjects.
disclaimer: i do understand that you are not aiming for 100% flight sim realism but i do think a few aspects would most certainly increase the viability of this plugin to more projects with a few more extra features/attention to detail.

-blueprint tooltips: applying tooltips to all of the exposed C++ or BP variables would help go a long way to understand what they represent and also to help with memory retention. i did watch your youtube tutorials and did find them very helpful but i do think that tooltips would help others who like to read and learns things, like myself, than watching youtube videos about it.

-asymmetrical lift Left/Right effectiveness: so in the case of battle damage where half my left wing is missing the balance of lift should shift to 0.5/1.0. right now looking over your code, mainly to learn new coding techniques that i haven’t learned or thought of yet to make things easier for my coding projects, i noticed that your lift doesn’t take that into account and continues to work as if nothing happened to the aircraft unless i saw it and didn’t notice it.

-asymmetrical thrust: basically for multi engine aircraft in a normal instance would be 1.0/1.0 but from either battle damage or multi throttle joysticks, being able to control the effectiveness of Left/Right or even individual engines themselves, and shift that balance would be a nice feature.

again great job at this!! :smiley:

Sorry it took me so long to reply, haven’t received a notification for some reason. Anyway

-Yeah, slowly working my way through adding tooltips, some will be in next update.

-Lift asymmetry doesn’t yet simulate damage, i’ll look into it and see if it’s possible to add it in next update.

-For asymmetric thrust, you could simply turn off the built in propulsion, and attach a couple of physics thrusters.

Next update will come out after UE 4.16

The update is out now.

  • UE4.16 compatible
  • Mac and Linux support
  • lift asymmetry now allows you to set separate lift multipliers for left and right wing (for damage modeling, as suggested by soccerboyftw)
  • added some tooltips (still work in progress, didn’t expect 4.16 to release this soon, more to come…)
  • additional latency - allows you to push the actor ahead of position updates in multiplayer. This has been added for a customer who needed millisecond accurate synchronization for formation flying on LAN. But if you input current ping (in seconds) into this parameter it can also act as regular latency compensation (i don’t recommend doing this unless the rest of your game also have compensation, it’ll do more harm than good. But if you really want the option is there).

Oops, it appears that UE4.16 broke clickspots in sim template.
Timing of input events changed and as a result your position is one frame behind when firing mouse click event, causing clickspots to become inaccurate. Not sure if bug or intentional change.

Here’s a quick workaround: sim_template_130_416.zip - Google Drive

Please install the hotfix I just released. This fixes a critical bug that prevents projects using EasyFM from packaging.

VR version of Sim Template is ready!

Get it here:

To tune radios simply look at the button and click bumper on the gamepad. The rest of the controls are the same as in non-VR version. Unfortunately VOR course knob cannot yet be rotated in VR, still trying to find an intuitive way to do that without having to use Touch/Wands.

And here’s a packaged project for those who don’t have EasyFM and just want a free flight sim :slight_smile:

And yes, in multiplayer you can have VR and non-VR players in the same aircraft.

Hey just wanted to say this is fantastic (and better than the other Aero marketplace plugin). I’m a modder from Warthunder. Hopefully I’ll be using your plugin for a game demo I might be creating.

Also, I’m curious about the Helicopter flight model you’ve started on youtube. Will you eventually be creating a helicopter FM plugin?

The helicopter FM is currently on hold. I don’t have enough time to work on it now, and it turned out even more complex than i initially expected. Rigid rotor model i used isn’t accurate for articulated or semi-rigid rotors (like most real helicopters). I might finish and release it at some point, but keep in mind it won’t be 100% accurate for above mentioned reason.

Update for UE4.17 is now out, sorry it took so long.

@**moookiexl - How do you set the center of gravity for your model? I tried moving the origin inside of my 3D package and then re-imported, but the plane is still tail heavy. Typically the engine would be in the front and that would shift the center of gravity.

Awesome plugin, I am loving it.**

It needs to be changed with “Center of Mass Offset” in object properties, changing it in the mesh doesn’t work properly. It might be a bug in UE4 or in PhysX.

Perfect … thank you, I eventually found it. Can’t believe I missed that setting entirely.