Flight Simulation
by Christian Boutin · in Torque Game Engine · 09/15/2004 (10:51 am) · 19 replies
Hello!
I've been toying with the Torque engine demo for the past few days (thanks to many helpful hints from the nice people on the board I've modeled and imported my first 3ds model into the engine without much problems). I'm impressed with the engine's ease of use and philosophy (script when you can, code when you must). I've hit a wall though when trying to implement my newly-designed plane model into the game. This sparked a few preoccupations and questions about the engine. I'm wondering if Torque is meant for me, here's the way I see it and questions I have regarding the engine.
- LOD implementation for terrain and huge maps : Looks good so far but would it support very-high altitudes? I've tweaked it in the demo and I reached something I found acceptable, but since the demo is pretty much empty of objects, maybe the settings I used would really choke the engine once I have 12 planes, 4 missiles and 35 bullets in the air at the same time. Has this already been done (high altitude/huge maps)?
- New physics model : Parameters associated with moving objects seem to related only to either bipeds, wheeled vehicles and hovercraft-like flyers. What I want is a fighter jet which reacts according to the four forces (weight/draft/lift/thrust) and obeys modern-day aviation physics (I'm not talking ultra-realistic LO-MAC or MS Flight Simulator style physics, more like Ace Combat 4 or the PC version of Crimson Skies physics). Unless I'm mistaken there's been no game build with the torque engine so far that model actual planes. I see Tribes 2-like flyers but those aren't meant for the kind of game I'm thinking. Has this already been done? If not, then is it possible to add a four-forces compliant fighter jet WITHOUT lifting the hood and going inside the code? (in other words create an object type and telling Torque not to handle physics but use formulas I would put in a script for it)
- Flexible camera systems : I think I've already seen examples of that, but just to reassure me. Is it possible to implement cameras that are not "locked" behind a character but one that reacts with delays? This always create a more natural third-person experience especially for plane-type vehicles.
Thing is, I work professionally as a C/C++ programmer and have been coding for the past 12 or so years. I know how to program but I'd rather do as little programming and as much scripting as possible because I'd rather face a different set of problems when I work on my game in the evening than when I work at my job during the day. I've been trying for a couple of years to get this game off the ground, even bought a couple of "engines" in the past but they all required too much coding on my part (coding my own terrain LOD system, terrain shadow-baking which I've done but sucked badly, coding my own collision detection etc.). I know I can't do both my day job and a game in the evening if I have to deal with all of those. I want a solution that will let me concentrate on making the game fun, and not one that will force me to re-invent the wheel at every step along the way. So far Torque looks like the way to go.
Any answer or examples that would set my mind at ease before I make my purchase would be greatly appreciated!
Thanks alot!
Christian
http://christianboutin.com
I've been toying with the Torque engine demo for the past few days (thanks to many helpful hints from the nice people on the board I've modeled and imported my first 3ds model into the engine without much problems). I'm impressed with the engine's ease of use and philosophy (script when you can, code when you must). I've hit a wall though when trying to implement my newly-designed plane model into the game. This sparked a few preoccupations and questions about the engine. I'm wondering if Torque is meant for me, here's the way I see it and questions I have regarding the engine.
- LOD implementation for terrain and huge maps : Looks good so far but would it support very-high altitudes? I've tweaked it in the demo and I reached something I found acceptable, but since the demo is pretty much empty of objects, maybe the settings I used would really choke the engine once I have 12 planes, 4 missiles and 35 bullets in the air at the same time. Has this already been done (high altitude/huge maps)?
- New physics model : Parameters associated with moving objects seem to related only to either bipeds, wheeled vehicles and hovercraft-like flyers. What I want is a fighter jet which reacts according to the four forces (weight/draft/lift/thrust) and obeys modern-day aviation physics (I'm not talking ultra-realistic LO-MAC or MS Flight Simulator style physics, more like Ace Combat 4 or the PC version of Crimson Skies physics). Unless I'm mistaken there's been no game build with the torque engine so far that model actual planes. I see Tribes 2-like flyers but those aren't meant for the kind of game I'm thinking. Has this already been done? If not, then is it possible to add a four-forces compliant fighter jet WITHOUT lifting the hood and going inside the code? (in other words create an object type and telling Torque not to handle physics but use formulas I would put in a script for it)
- Flexible camera systems : I think I've already seen examples of that, but just to reassure me. Is it possible to implement cameras that are not "locked" behind a character but one that reacts with delays? This always create a more natural third-person experience especially for plane-type vehicles.
Thing is, I work professionally as a C/C++ programmer and have been coding for the past 12 or so years. I know how to program but I'd rather do as little programming and as much scripting as possible because I'd rather face a different set of problems when I work on my game in the evening than when I work at my job during the day. I've been trying for a couple of years to get this game off the ground, even bought a couple of "engines" in the past but they all required too much coding on my part (coding my own terrain LOD system, terrain shadow-baking which I've done but sucked badly, coding my own collision detection etc.). I know I can't do both my day job and a game in the evening if I have to deal with all of those. I want a solution that will let me concentrate on making the game fun, and not one that will force me to re-invent the wheel at every step along the way. So far Torque looks like the way to go.
Any answer or examples that would set my mind at ease before I make my purchase would be greatly appreciated!
Thanks alot!
Christian
http://christianboutin.com
About the author
Recent Threads
#2
10/17/2004 (9:46 am)
Just bumping this with regards to the LOD question, as it's something I'm also interested in. I know there's been some improvements made to the terrain system in the TSE (that pic of St Helens with a 10km draw distance, for example) but how does that scale? I know you can get terrain stitching, but are you still limited by draw distance?
#3
Scale everything so that it seems that you are in a high altitude.
# of objects flying on the same time won't really be a problem, the engine is designed for that.
Vehicle physics is still quite a mystery. Very few people around here really understand this stuff. So if you are trying to modificate it, please share your acomplisments.
10/17/2004 (6:42 pm)
There are some threads that deal with FlightSim stuff. I never tried TSE cause I have a Mac and I'm waiting for it's release but what I have read summarizes in one word : Scale.Scale everything so that it seems that you are in a high altitude.
# of objects flying on the same time won't really be a problem, the engine is designed for that.
Vehicle physics is still quite a mystery. Very few people around here really understand this stuff. So if you are trying to modificate it, please share your acomplisments.
#4
Vehicle physics in TGE... well, suck. They're left over from T2 style vehicles, and are definately not designed for realistic flight model, and you will not be able to significatnly mod it out with just script, you'll have to code your own physics into the flyer class I'm afraid.
Camera system is definatly quite flexable.
10/17/2004 (7:21 pm)
TGE is definately NOT desigend for high altitudes/huge maps... Just set the visible distance to 2000, fly up nice and high, and look down, you'll get 2-3 FPS. TSE with that Mt. St. Helen is the first time I've seen terrain of that size in the game... and even there, I havn't had a chance to play with it, so I'm not sure of it's capabilities, but it might solve that problem for you.Vehicle physics in TGE... well, suck. They're left over from T2 style vehicles, and are definately not designed for realistic flight model, and you will not be able to significatnly mod it out with just script, you'll have to code your own physics into the flyer class I'm afraid.
Camera system is definatly quite flexable.
#5
As far as physics are concerned, now that I bought the engine I'll be able to create a new flyer and have it behave however I want. I thought the code would be more intimidating than that but at first glance it doesn't look that hard. Then again I didn't dig that deep in it.
I still intend to try and make a flight simulator. If that don't work I'll think of something more low-altitude like helicopters or such.
Would TSE really give me a farther LOS and bigger terrain? Upgrading to TSE could also be an option.
10/18/2004 (3:38 pm)
Well, the way I see it so far it depends on exactly what you want. If you want something that very far visibility a la LOMAC then no I don't think Torque can accomodate that. But games like Ace Combat 4 don't have maps that are huge, and have a visibility range that's also limited. I cranked up the visibility to 1800, fog at 1500 and I didn't notice much frame drop. At one point you lose sight of the ground altogether, but I guess I'll be able to cheat by adding a layer of clouds at a certain height.As far as physics are concerned, now that I bought the engine I'll be able to create a new flyer and have it behave however I want. I thought the code would be more intimidating than that but at first glance it doesn't look that hard. Then again I didn't dig that deep in it.
I still intend to try and make a flight simulator. If that don't work I'll think of something more low-altitude like helicopters or such.
Would TSE really give me a farther LOS and bigger terrain? Upgrading to TSE could also be an option.
#6
10/18/2004 (4:49 pm)
Check out FlightGear. It has a really nice flight model and is open source. Maybe you could combine its flight model with TGE...
#7
If you're willing to give up fine terrain detail, you can just scale the terrain up (ie, set a high squaresize) and suddenly have much more efficient big view distances. The hard part is when you want both fine and big detail in the same scene.
Be careful of mixing licenses! But Dave's idea might be good.
10/18/2004 (5:17 pm)
TGE and co are derived from a flight sim background (unlike Unreal/Doom/Quake/FarCry which have FPS roots)... so there's a lot of room to do stuff.If you're willing to give up fine terrain detail, you can just scale the terrain up (ie, set a high squaresize) and suddenly have much more efficient big view distances. The hard part is when you want both fine and big detail in the same scene.
Be careful of mixing licenses! But Dave's idea might be good.
#8
Now there is a good question : What happens when you mix licenses ? Say you get an open source Flight Physics pack, if you integrate it with torque, how can you distribute it ? Could you just give the part that's opensource and leave the engine closed ? Or if you use an opensource routine you must disclose the whole stuff ?
10/19/2004 (5:22 am)
@Ben,Now there is a good question : What happens when you mix licenses ? Say you get an open source Flight Physics pack, if you integrate it with torque, how can you distribute it ? Could you just give the part that's opensource and leave the engine closed ? Or if you use an opensource routine you must disclose the whole stuff ?
#9
Iit is interesting to see the responses of various people on this thread. There is a lot of authority projected in many of the answers. Vehicle physics suck, can't display a big enough terrain area, cameras are a pain, etc. Ironically, when we sit around and think of which games we should consider creating here at GG Studios, flight sims always bubble to the top because we feel they would be one of the easiest types of games to make with the Torque.
I realize that does not answer your questions, but at least it should give you some confidence. Tim says he would just start with the flyer class (in C++), then start messing with the flight model. It is pretty easy to get a very simple flight model in. The open source ones are probably way too complicated. We used to make flight simulations, and personally, I have always liked the simpler models the best. Customers used to have huge fights over the realism in certain flight models even though most of them had never actually flown a plane! Making a purposefully simple simulator cuts that argument off before it even starts.
10/19/2004 (12:14 pm)
Depends on the Open Source license. GPL is NOT compatible with Torque because you cannot release the source code to the TGE.Iit is interesting to see the responses of various people on this thread. There is a lot of authority projected in many of the answers. Vehicle physics suck, can't display a big enough terrain area, cameras are a pain, etc. Ironically, when we sit around and think of which games we should consider creating here at GG Studios, flight sims always bubble to the top because we feel they would be one of the easiest types of games to make with the Torque.
I realize that does not answer your questions, but at least it should give you some confidence. Tim says he would just start with the flyer class (in C++), then start messing with the flight model. It is pretty easy to get a very simple flight model in. The open source ones are probably way too complicated. We used to make flight simulations, and personally, I have always liked the simpler models the best. Customers used to have huge fights over the realism in certain flight models even though most of them had never actually flown a plane! Making a purposefully simple simulator cuts that argument off before it even starts.
#10
Actually I finally did buy Torque a couple of weeks ago (my original post is quite old). Before I did I ran the necessary tests about altitude and line of sight. My basis for comparison was Ace Combat 4. Quite frankly AC4 has a very short line of sight compared to modern flight sims like LO-MAC and the maps are also very small (again, compared to LO-MAC or Flanker 2). But AC4 still managed to deliver to kind of flight experience I want to mimic. Simple yet not too arcadey. I agree that simpler is better and I'm not looking for a hard-core flight model. I just want the basic forces to be handled and most of all, if you push left on the stick I don't want the plane to turn left like a car, I want it to roll left like a plane. So far with what I've seen of the source code I can't see why I couldn't do it, so I'll keep you posted when I get something off the ground (literally).
Cheers!
Christian
10/19/2004 (5:45 pm)
Thanks all for your response.Actually I finally did buy Torque a couple of weeks ago (my original post is quite old). Before I did I ran the necessary tests about altitude and line of sight. My basis for comparison was Ace Combat 4. Quite frankly AC4 has a very short line of sight compared to modern flight sims like LO-MAC and the maps are also very small (again, compared to LO-MAC or Flanker 2). But AC4 still managed to deliver to kind of flight experience I want to mimic. Simple yet not too arcadey. I agree that simpler is better and I'm not looking for a hard-core flight model. I just want the basic forces to be handled and most of all, if you push left on the stick I don't want the plane to turn left like a car, I want it to roll left like a plane. So far with what I've seen of the source code I can't see why I couldn't do it, so I'll keep you posted when I get something off the ground (literally).
Cheers!
Christian
#11
10/19/2004 (6:12 pm)
Please let us know if you have any success. I still think there is a market for certain types of flight sims.
#12
Speaking of flight sims, I've sent you guys some screenshots of mine ( "Crowmania") to that publishing email. Have you guys had any time to check it ?
10/20/2004 (2:10 am)
@Jeff,Speaking of flight sims, I've sent you guys some screenshots of mine ( "Crowmania") to that publishing email. Have you guys had any time to check it ?
#13
10/31/2004 (8:13 am)
Regarding licenses... FlightGear is GPL but it has three flight models that are licensed seperately. I just checked them all out and, unfortunately, they are all GPL'd as well. People really should use the LGPL for libraries but many people do not fully understand the licensing process. If you can find something that is LGPL'd it can be incorporated in your project and you would only be responsible to release the code from the LGPL'd piece and not your entire project.
#14
http://christianboutin.com/exequor/playable20041212135655.exe
I'm not aiming for an ultra-realistic flight model, something more arcadey. I've based it loosely on the Ace Combat 5 game that I've been playing (to death) these past weeks. Let me know what you think. I've had some troubles with the hud's rotation when you roll, it seems to get stuck at 45-50 degrees. I'll need to investigate more. Also press ALT-F4 to quit, there's no other way. Let me know how you think the physic model is holding up. And all who are willing to help are welcome ;-)
Cheers!
Christian
12/12/2004 (9:35 am)
I finally managed to come up with a first draft of my flight model. You can check it out here :http://christianboutin.com/exequor/playable20041212135655.exe
I'm not aiming for an ultra-realistic flight model, something more arcadey. I've based it loosely on the Ace Combat 5 game that I've been playing (to death) these past weeks. Let me know what you think. I've had some troubles with the hud's rotation when you roll, it seems to get stuck at 45-50 degrees. I'll need to investigate more. Also press ALT-F4 to quit, there's no other way. Let me know how you think the physic model is holding up. And all who are willing to help are welcome ;-)
Cheers!
Christian
#15
Nice job! I noticed that altitude was not shown in the hud. Is this number that you've found to be displayable during flight. I saw the airspeed but never made it to 125, even after doing a hammerhead in which my airspeed climbed at a better rate than my 90 degree dive. I did however make it to 117.
Although I'm not interested in making a flight sim, your work interests me because I'm exploring a lander type game where vertical speed, attitude and altitude are extremely important.
Which script did you modify to display this information in the HUD, and any example code or script that you used to gather that information would go along way of putting me where I want to be for a proof of concept. For learning purposes I want to tie this information to a box and drop it and monitor the numbers. Do you think vertical thrusters are do-able? I know I saw something like that in flyingvehicle.cc.
In that file I also found this:
F32 h = getHeight(); Would this produce altitude in a displayable number?
And what if I wanted to change the gravity on the planet is that a global that can be set?
Thanks again , and good job.
Radhat
12/18/2004 (7:25 pm)
Christian,Nice job! I noticed that altitude was not shown in the hud. Is this number that you've found to be displayable during flight. I saw the airspeed but never made it to 125, even after doing a hammerhead in which my airspeed climbed at a better rate than my 90 degree dive. I did however make it to 117.
Although I'm not interested in making a flight sim, your work interests me because I'm exploring a lander type game where vertical speed, attitude and altitude are extremely important.
Which script did you modify to display this information in the HUD, and any example code or script that you used to gather that information would go along way of putting me where I want to be for a proof of concept. For learning purposes I want to tie this information to a box and drop it and monitor the numbers. Do you think vertical thrusters are do-able? I know I saw something like that in flyingvehicle.cc.
In that file I also found this:
F32 h = getHeight(); Would this produce altitude in a displayable number?
And what if I wanted to change the gravity on the planet is that a global that can be set?
Thanks again , and good job.
Radhat
#16
snip..
I use a message callback to start it off but you could do that anyway you wish. The main thing is getControlObjectAltitude();
I am sure you talented programmer types could adapt it to a special gauge gui object :)
12/18/2004 (8:36 pm)
Well if you want altitude you can do what I have been doing.snip..
new GuiControl(vAltBox) {
profile = "GuiDefaultProfile";
horizSizing = "relative";
vertSizing = "center";
position = "569 10";
extent = "60 20";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiTextCtrl(vAltText) {
profile = "HudClusterTextLeft";
horizSizing = "relative";
vertSizing = "relative";
position = "0 0";
extent = "21 20";
minExtent = "21 20";
visible = "1";
text = "0";
maxLength = "4";
helpTag = "0";
};
new GuiTextCtrl(AltLabel) {
profile = "HudClusterTextRight";
horizSizing = "relative";
vertSizing = "relative";
position = "12 0";
extent = "45 20";
minExtent = "25 20";
visible = "1";
text = "Meters";
maxLength = "3";
helpTag = "0";
};
};
function GuiTextCtrl::updateAlt(%this)
{
if(isEventPending(%this.altCheck))
cancel(%this.altCheck);
%alt = getControlObjectAltitude();
%this.setValue(%alt);
%this.altCheck = %this.schedule(500, "updateAlt");
}
function GuiTextCtrl::killAltCheck(%this)
{
if(isEventPending(%this.altCheck))
{
cancel(%this.altCheck);
%this.altCheck = "";
}
}I use a message callback to start it off but you could do that anyway you wish. The main thing is getControlObjectAltitude();
I am sure you talented programmer types could adapt it to a special gauge gui object :)
#17
01/05/2005 (12:48 pm)
Christian, that is really nice work. I just today started working on the flight dynamics for a prop plane, so it's nice to see how you've got it all working out. I'm cusrious, did you do the flight dynamics code in scripts or c code?
#18
01/06/2005 (6:11 am)
The flight physics and dynamics were done in C++ code. I've tried to get similar physics with scripts alone and my humble opinion is that it can't be done. The "flyers" that the engine supports are Tribes-like hovercrafts and those are not appropriate for flight sim physics.
Torque Owner Stefan Lundmark
The camera system can be anything you like, really - but I think you will need to dig into the C++ for that. We tried what you described in the air, but we were not many.. maybe 8-12 people flying around. There were vegetation on teh ground and a few interiors scattered, worked great both clientside and serverside.
In my opinion the hard thing here is the physics engine. If you want to change it alot, that will be hard - from what I've heard. At least if you're planning a bigger modification.