Flight Sim test

Hey. This was a test I made a while ago to try to work out how to program a flight simulator. There are plenty of bugs, but it isn’t too bad. It was made back in Blender 2.48a, so the python code is mostly deprecated, meaning it won’t work in 2.5, but it should still work in 2.49, though it may leave you hate mail on your console.

Controls are:

arrows- pitch/roll
comma/period - rudder left/right
b - wheel brake (on ground)
s - speed brake (in air)
f - flaps up/down (add lift during take off and landing)
g - gear up/down (adds drag)

mouse up/down - throttle
left click + drag - pan camera

1 key - HUD view
3 key - external view
4 key - fly-by view

There are multiple bugs, including the fact that the velocity vector isn’t always accurate, and the aerodynamics are off. N key was a test with night vision, which just looks horrible. If you’ve seen my most recent fps game (link’s in sig) you’ll see that I’ve found a MUCH better way of making night vision.

Air pressure changes with altitude and determines both lift and engine thrust. flaps and gear add drag when extended. Theres a shockwave when you brake the sound barrier. Altitude ladder and compass were never added. Cockpit view (supposed to be 2 key) was never added.

I’m never going to use this again, so feel free to use however you want.

Here’s the .blend: http://www.box.net/shared/vb4mq0cras

Even with the bugs, it’s still awesome!

Very nice.
Three suggestions:

Hi

Pretty nice setup for the flying.

The HUD is well done.

The effectiveness of flight surfaces changes with speed and air pressure. So if your really slow or you’re really high up, you can’t turn as sharp as if you flying low and at high speed. I actually think it rolls too fast for a simulation.

Thanks. The HUD came out pretty nice, but like I said, the velocity vector is almost always off its mark.

I actually think it rolls too fast for a simulation.

I thought fighter planes were capable of 5+ g turns? This is like a 0.5 g turn. It is interesting - on your flight sim I am saying the controls are too soft and on Xjazz’s I am saying they are too tight. Now we just need a happy medium.

If you pull up at high speed (700+ knots) it puts an enormous amount of force on the plane. It may seem to be turning slowly, but the downward (relative to the plane) force would be around 8 or 9 g’s. You could make it turn sharper, but then it would leave the “simulation” genre, as those forces would leave the pilot unconscious and eventually rip the plane apart if it was in real life.

Hi

I made a small script, which is showing how the velocity is effecting to the turn-radius and -rate at same amount of G-force.


from math import *

def rr(v,d=2):
    return round(v,d)

global G
G = 9.81 # gravity
r = 0.0 # radius in meters
w = 0.0 # turnrate in degrees per sec.

# Flight condition
v1 = 360.0 #  m/s velocity. ~700 knots. 
v2 = 193.0 # m/s velocity. ~375 knots.
n = 9.0 # g-loading

def T_T(v, n):
    # Turn Radius
    try:
        r = v**2 / (G * sqrt(n**2 - 1))
    except ValueError:
        r = 0
    # Turn Rate
    try:
        w = (G * sqrt(n**2 - 1)) / v
    except ValueError:
        w = 0
    return [rr(r),rr(w)]

v1r = T_T(v1, n)
v2r = T_T(v2, n)

print 'Velocity, Turn Radius(meter) and Turn-Rate:'
print v1, v1r[0], degrees(v1r[1])
print v2, v2r[0], degrees(v2r[1])

Energy Maneuverability Diagram in general


from
http://www.simhq.com/_air/air_011a.html

The Falcon4 RP4.1 F16 Energy Maneuverability Diagram on sea level


from
http://www.simhq.com/_air/air_012a.html

The F16 actual maximum roll-rate is a secret, but it’s estimated to be something like 300dps. Of course the velocity, load and altitude are effecting heavily to the figure.

Very nice!

The F16 actual maximum roll-rate is a secret, but it’s estimated to be something like 300dps.

This is my point; the roll rate here seems to be around forty or fifty degrees/second.

It only rolls that slow when you’re flying at low speed or high altitude. Fly fast and low and you can roll a full 360 degrees in just over a second. Anyway, change it if you don’t like it; I don’t care.

It only rolls that slow when you’re flying at low speed or high altitude.

Fair enough. But how about mouse or joystick control?

I said in the first post, I’m done with this project. I haven’t worked on it for over a year. I just thought I’d release it incase someone else finds it useful. I have my hands full with Hellbent, my current game project. If you want to put in different controls, go for it.