Atmospheric flight
Posted: Sun Jan 27, 2019 1:34 pm
I am just a player, and I am by no means a physicist or a mathematician, so please excuse my mistakes and correct them. I didn't see much planning on atmospheric flight, so I thought I could write down some stuff.
Atmospheric flight in Pioneer doesn't really feel atmospheric (I played with lots of flight sims), but I thought we could at least do simple effects.
For example, I think this is how KSP applies lift; it takes the drag applied to the lifting parts and multiplies it with the lift/drag constant and then multiplies it with the part's own lift coefficient or sth. Drag is already calculated with atmospheric pressure and speed, so it is pretty nice and reliable.
I think we can do a similar thing in Pioneer, since we already apply atmospheric drag to ships:
<Lift> = <Global lift/drag constant> x <ship's own lift multiplier> x <current drag> x <AoA multiplier>
We can add a "lift coefficient" property to every ship's JSON file, and those that does not produce lift will just read 0. The bigger the lifting-body area is (maybe blender can help with calculating areas?), the bigger the constant will be, but since ships do not share the same wing/lifting body design, it doesn't have to be really proportional between spacecrafts.
If the AoA (Angle of Attack (the angle between ship's nose and the direction of travel)) is 0, the AoA multiplier will be 1. If there is deviation, it will get lower (maybe until the AoA is about 90 degrees), until it clamps to the lowest value of 0. (No lift - Stall!)
There is another very important mechanic to be implemented: passive aerodynamic stabilization. Atmospheric-flight-capable spaceships must be designed with some sort of passive stabilization, so, even if no controls are touched, the ship should face the direction of travel by itself. We can apply a counter-force that pushes the nose towards the velocity vector.
<Rotational counter-force> = <Deviation in AoA> x <drag> x <passive stabilization constant or sth>
When controls are released (with autopilot not engaged), the ship's flight computer could apply automatic RCS to keep the nose at where the player left it, or it could just leave it be; I am not sure which one would be best. In most cases, the RCS thrusters should be way more powerful than atmospheric forces anyway.
Maybe, atmospheric shielding could reduce (or prevent) lift and passive stabilization.
This whole thing will probably make flying more difficult, and it will also take a lot of testing to find the right constants.
I don't know where (EDIT: Probably in DynamicBody.cpp) and how to code all of this right now, but I thought we could discuss.
Oh... And it will probably screw up the AI and autopilot. We will probably have to make the autopilot less aggressive.
I think Deneb, Wave, Venturestar, AC33 Dropstar, Lodos are the ships we can apply considerable lift, and they will probably have more powerful passive stabilization.
Atmospheric flight in Pioneer doesn't really feel atmospheric (I played with lots of flight sims), but I thought we could at least do simple effects.
For example, I think this is how KSP applies lift; it takes the drag applied to the lifting parts and multiplies it with the lift/drag constant and then multiplies it with the part's own lift coefficient or sth. Drag is already calculated with atmospheric pressure and speed, so it is pretty nice and reliable.
I think we can do a similar thing in Pioneer, since we already apply atmospheric drag to ships:
<Lift> = <Global lift/drag constant> x <ship's own lift multiplier> x <current drag> x <AoA multiplier>
We can add a "lift coefficient" property to every ship's JSON file, and those that does not produce lift will just read 0. The bigger the lifting-body area is (maybe blender can help with calculating areas?), the bigger the constant will be, but since ships do not share the same wing/lifting body design, it doesn't have to be really proportional between spacecrafts.
If the AoA (Angle of Attack (the angle between ship's nose and the direction of travel)) is 0, the AoA multiplier will be 1. If there is deviation, it will get lower (maybe until the AoA is about 90 degrees), until it clamps to the lowest value of 0. (No lift - Stall!)
There is another very important mechanic to be implemented: passive aerodynamic stabilization. Atmospheric-flight-capable spaceships must be designed with some sort of passive stabilization, so, even if no controls are touched, the ship should face the direction of travel by itself. We can apply a counter-force that pushes the nose towards the velocity vector.
<Rotational counter-force> = <Deviation in AoA> x <drag> x <passive stabilization constant or sth>
When controls are released (with autopilot not engaged), the ship's flight computer could apply automatic RCS to keep the nose at where the player left it, or it could just leave it be; I am not sure which one would be best. In most cases, the RCS thrusters should be way more powerful than atmospheric forces anyway.
Maybe, atmospheric shielding could reduce (or prevent) lift and passive stabilization.
This whole thing will probably make flying more difficult, and it will also take a lot of testing to find the right constants.
I don't know where (EDIT: Probably in DynamicBody.cpp) and how to code all of this right now, but I thought we could discuss.
Oh... And it will probably screw up the AI and autopilot. We will probably have to make the autopilot less aggressive.
I think Deneb, Wave, Venturestar, AC33 Dropstar, Lodos are the ships we can apply considerable lift, and they will probably have more powerful passive stabilization.