Very simply put, aircraft don't obey their steering limits during a lot of behaviors. This results in inconsistent flight behaviors and responses, and can very easily lead to borked flight patterns.
Let's look at an aircraft with a custom setup:
Code: Select all
TurnRate=1800;
WingDrag=0.14; //drag caused by wings
WingAngle=0.16; //angle between front and the wing plane
Drag=0.01; //how fast the aircraft loses speed (see also below)
FrontToSpeed=0.2; //fudge factor for lining up speed and front of plane
SpeedToFront=0.14; //fudge factor for lining up speed and front of plane
MyGravity=0.2; //planes are slower than real airplanes so lower gravity to compensate
MaxBank=0.2; //max roll
MaxPitch=0.2; //max pitch this plane tries to keep
TurnRadius=200; //hint to the ai about how large turn radius this plane needs
MaxAileron=0.015; //turn speed around roll axis
MaxElevator=0.08; //turn speed around pitch axis
MaxRudder=0.02; //turn speed around yaw axis
1. During "normal flight", the aircraft obeys all the specifics as to flight parameters.
2. During "combat flight", the aircraft suddenly uses custom parameters tied to the value of TurnRate.
This is 99% of what's wrong with aircraft, and getting them to behave in a predictable fashion. The code I've written, above, results in an aircraft with a turn-radius of approximately 200 Spring units. However, whenever it detects an enemy, TurnRate overrides these behaviors, causing the aircraft to suddenly perform ridiculously tight loops and microscopic spins.
Spring devs... please, for the love of Dog, this needs to get fixed. Now that I know what's happening... it's easily repaired. Just have the code check for custom flight parameters- if any of the values aren't the defaults, then the aircraft should use the custom parameters at all times, not refer to TurnRate and suddenly use a bunch of defaults multiplied, no doubt, by TurnRate.
The only times TurnRate should matter are in the following situations, I think:
1. Since there are no variables that allow modders to define HoverAttack properties, TurnRate should define the maximum spin-rate around the Y axis of the model during HoverAttack, in radians/second.
2. It should be used to determine attack parameters if the Unit doesn't have any of the specific parameters defined in the FBI.
That's what's ultimately borked about aircraft- the steering code is taking control and wresting it away from the designers when it feels it's appropriate, with results that aren't very good. Making this change should be very simple, and backwards-compatible with existing mods, but allow for future mods with much more reliable aircraft behaviors.
The last thing that's wrong with aircraft is a specific issue and a special case. Aircraft aren't "looking ahead" far enough to avoid collisions with the ground or other aircraft. This isn't a huge problem for high-flying aircraft, but for anything that is meant to hug the terrain, it can cause a lot of problems. I do not know how aircraft "see" their world, but it's pretty obvious after playing around with the code for awhile that they don't anticipate collisions correctly, and frequently understeer when approaching objects at speed, only to obviously (and somewhat comically) "see" the oncoming object and then oversteer while trying to avoid it. I assume that aircraft "see" the terrain heightmap and try to plot paths that avoids impact, but they do not seem to look far enough ahead, even at low velocities.