Game Development Community

Fixed wing aircraft physics

by adder_noir · in General Discussion · 07/06/2007 (12:41 pm) · 23 replies

Hi,

I would like to ask those who have used this engine how good the physics are with regard to modelling large fixed wing aircraft? Are the physics for the engine able to cope with such vehicles?

I've heard some limiting things about Torque physics and was wondering if using some clever scripting would help 'simulate' physics for large aircraft. I've written alot of scripts for Operation Flashpoint and often thought of a script to mimic realistic flight, perhaps this could be done with the Torque engine?

Given that I ultimately have an MMOG game idea in the pipeline would Torquescript be fast enough to implement this?

Thanks in advance for any help/insight offered :o)
Page «Previous 1 2
#1
07/12/2007 (11:46 am)
The flying vehicle physics is a little off from real life. You can take off at any speed, you cannot fall without pointing straight down, and landings are wierd because you need to go a little bit nose first, so you cannot raise the nose before landing as you will see in many videos of fixed-wing landings. There is a WheeledFlyingVehicle code modification by some member here, run a search for it and you will find it. This will give you landing gear and takeoff/landing speeds.

You can do this all in mostly, not completely TorqueScript. You'll need the engine C++ for the WheeledFlyingVehicle resource.
#2
07/13/2007 (5:00 am)
Hi thanks for the reply. I noticed that when I found the link there are alot of folks reporting problems with it. It seems it is still very much in development. I think I'll have alot of work to do getting it right if I want to simulate realistic flying.

I was thinking of using a basic formula to calculate lift from the chosen vehicle's wingspan and have a constant running check on its speed to see how much lift it has and whether it's enough to counteract its weight. I'd also need a solution to alter lift when the aircraft banked and for that I'd probably have to ask a fluid mechanics expert for a rough approximation (which I might be able to do).

Issues such as inertia and the like will make things difficult I suspect too! Ideally for that I could use an algorithm which used the setvelocity command to keep an aircraft in part moving in it's original direction after making a turn. A resultant force in the original direction could be evaluated with the new direction force subtracted from it and then obviously a bit of integration would produce it's position and speed.

I hope that makes sense and I'm not talking bull!

I'll check back in later on when I've had some more thoughts on it.
#3
07/13/2007 (5:26 am)
Makes a lot of sense, actually. I think Microsoft Flight Simulator calculates lift based on wingspan like you're thinking. Good luck with it, would LOVE to see a flight simulator in Torque (TSE especially. It's all so pretty!).
#4
07/13/2007 (6:34 am)
Thanks for the reply. I believe they do indeed do that. I need to finish Edward Maurina's amazing book first before undertaking anything new. Hopefully if I can do enough work for it to capture someone's attention who is good at physics then they might be able to tweak some of the more basic work I'll do and make it better.

I really need a realistic-ish flight sim for my game idea. Will be a bear to do though so if you know anyone who might want to help ask them to drop me a line thanks.

I've had several thoughts about other areas such as relating force of lift to angle of attack, i.e. how much lift is generated when the plane is not pitched in the same direction as it's forward speed and such like. I suspect solving this problem would lead to a solution for simulating flaps being put down and all kinds.

As I said it doesn't have to be great, just an approximation.
#5
07/13/2007 (8:18 am)
While complex in theory, the concepts of generated lift, induced lift, angle of attack curves, and power curves are actually not all that difficult to describe via equations, but it's not a trivial thing to do accurately in a networked manner, so just keep in mind it will take some research.

For example, it's not simply a matter of angle of attack vs wing surface area, as different wings (camber, presence of flaps/slats/other surface modifying characteristics, etc) have different generated lift and stall characteristics based on several design factors.
#6
07/13/2007 (1:22 pm)
Hi thanks for the reply. Can you or anyone else recommend a good way to learn basic flight theory such as the parts you describe in the first part of your post? I'm going to have a look on amazon for a decent reference.

As for the complex parts I'm only after an approximation. I just want something better than that which comes wrapped with the engine. I assume the potential complexity of the calculations would make potential large errors with regard to the server and client(s) relationship. Is that what you meant about the networking issue?

Thanks again!

*Edit*

Found a good one on Amazon called The Fundmentals of Aerodynamics. Looks like one for the wish list.
#7
07/13/2007 (2:00 pm)
Quote:
I assume the potential complexity of the calculations would make potential large errors with regard to the server and client(s) relationship.

Yes, very much so. Good approximation algorithms (not trying to be 100% accurate) will go a long way, and of course very stringent and accurate interpolation algorithms as well.

That's probably a very good book, but you may want to see if there are any local flight schools (check your local regional airport, or airstrip) that can give basic understanding of "Aerodynamics from a Pilot's perspective", which given my experience (2,000 flying hours as a military pilot) would be a great place to start.
#8
07/14/2007 (4:53 am)
Hi,

Thanks for the reply. I don't really have enough cash to approach any local flight schools, plus I doubt any of them round here would bother to help a noob. Surprised to see how much flight experience you've got there, out of curiousity what did you fly?

Thanks for cementing the calculation complexity issue into my head I'll have to make damn sure the size of things don't get silly.

I was thinking of using a simple ratio to alter drag and the likes when the plane banks and maybe have an exponentially based function present to determine how much drag increases when the plane is facing a different direction to which it is travelling during the initial stages of a hard turn.

Basically I'm already trying to think of ways to simplify things, if anyone could help that would be great. Thanks again.
#9
07/14/2007 (7:08 am)
I flew HC/MC-130's, and then was an instructor pilot flying T-37's.

The main issue you will have is having a model that is simplistic enough to be feasible, but complex enough to make your objects "feel" like real airplanes--and that's not an easy task :)
#10
07/14/2007 (8:27 am)
You might want to check out JSBsim, an open source flight dynamics model. It uses the LGPL license, so it could be used with Torque. You would probably want to strip it down a bit to make it more network friendly, but it has most of what you are looking for in C++ code.
#11
07/14/2007 (9:01 am)
Great idea, I just downloaded it (JSBSim). I think it will take along time ot understand even with the documentation it comes with. Thanks for the headsup.

@Stephen
Wow if memory serves they're big planes right? The Hercules isn't it?

As for the realism I'm afraid I'll have to err on the computer/network friendly side of things as it must take preference over realism.

Any more ideas or comments welcome!
#12
07/14/2007 (10:10 am)
Yes, the HC/MC-130P/N is a special ops version of the venerable but still amazing C-130 Hercules. We had a large set of missions that the "vanilla" C-130's did not, and focused primarily on Night Vision Goggle Low Level for SOF support.
#13
07/14/2007 (10:36 am)
@adder I've studied JSBsim a bit, maybe we could combine forces to integrate a lite version into TGE. I've added the wheeled flying vehicle resource and the update for that, but TGE needs a bit more to get a realistic feel.

Btw Stephen, were you stationed at Hurlburt?

[edit spelling]
#14
07/14/2007 (10:46 am)
Quote:
Btw Stephen, were you stationed at Hurlburt?

Eglin actually...the 9th SoS was detached due to ramp space.
#15
07/14/2007 (10:55 am)
Cool, my dad was stationed there, I still live in Valparaiso. I enjoy watching and hearing the planes as they land and takeoff.
#16
07/14/2007 (1:05 pm)
@Willbkool

Sounds like a plan mate. A lite version for TGE would be brilliant. Drop me an e-mail at chris330330@hotmail.com to let me know what you've discovered about it so far.

Please bear with me I am quite new-ish to such complexity (graduated years ago and as such I'm quite rusty). Done plenty of scripting work for Operation Flashpoint mind in recent years so not too bad with the code.

I can put alot of time into it right now though because I'm off work, so that's a big plus.

Thanks for everyone's input into the thread!
#17
07/15/2007 (11:09 am)
I've had a look through the building guide for JSBSim and there's alot of stuff we could lose. Things such as propellor feather angle and such like. All we're really interested in is a reasonable approximation for lift, drag, weight and thrust. Moment of inertia needs to be in there aswell me thinks for the larger aircraft especially. That's already a big cut-down on what the sim takes. Getting it out though will need a good thorough understanding of how the engine works and I've yet to glimpse the C++ code.

I've downloaded all relelvant manuals but I suspect alot of picking through work will be needed. I'm ready to start when you are as I've got enough time. In fact I'll begin tonight. We've just finished clearing out the loft space in the garage so haven't got any more jobs on today!

I'll start by reading through the creation manual. I'll check back in when I have something useful to add :o)
#18
07/17/2007 (10:30 am)
I've been reading through the aircraft config manual which comes with JSB. There's loads of stuff we could lose. Things like engine pitch and strut damping coefficients and the like. I haven't heard anything though from you Will if you're still interested could you drop me a line please?

I wonder just how many calculations could be reliably performed in a networked situation? How small would it have to be?
#19
07/31/2007 (6:28 am)
Hi Adder... i'm attempting a TGEA flightsim too ---> http://www.dogsquad.co.uk/dif/index.htm
I'm new to Torque, but i have quite a few flight snippets that i've been using in another game engine.
I'm not a expert coder, by any means, but i wanted you to know that you're not alone, and if i
can help share the pain, or you need somebody to bang heads with occasionally, give me a shout.

regards.
#20
07/31/2007 (6:35 am)
That's a very nice site Ken. Thanks for your input. I have found a complete simulator in Ian Millington's book if you want me to send it over just let me know and I'll e-mail it to you. Even comes with an OpenGL demo of it working. Not perfect but damn good I'd say. It needs code from the physics engine he builds in the book though. I'm not sure how big in total it is but I'd guess one is looking at around 1000 lines of code for the complete thing?

Drop me a line if you want me to mail it over :o)
Page «Previous 1 2