Getting started with FlightGear
For most of us, the best way to install FlightGear is to use the version included in our distribution of choice. In Ubuntu Edgy, that's 0.9.10-2, and that's what I have used while writing this article. You can also grab a tarball, or check out the latest from CVS, and build it from scratch, but beware, it may require a serious effort to build.
Before you bother installing FlightGear, however, make sure your system meets the minimum hardware requirements. The bottom line is that you need 3D acceleration. For Linux users, the best bet seems to be an Nvidia card with 3D enabled. I've heard tales of woe on the IRC channel from those trying to run FlightGear on Linux with ATI cards.
| A brief history of FlightGear |
|---|
Curtis Olsen provided this account of FlightGear's beginnings:
Olsen added that he's been "a Unix/Linux fanatic since the day I first saw 'multitasking' on a Unix box in college." "I've done my personal development of FlightGear in Linux since day one, but *very* early in the process we had Windows ports, and Mac ports, and SGI ports, and Sun ports, etc." Today, more than a dozen developers have commit privileges. Olsen told me that "We've had literally hundreds of people contribute code, graphics, 3D models, hardware, and all sorts of other stuff over the years. I used to make a sincere attempt to track and log these contributions, but it just became overwhelming and I gave up." Even though the project has grown, Olsen says that he still contributes code to the project:
|
Once installed, you'll have a FlightGear root directory somewhere on your system. In Ubuntu, it's at /usr/share/games/FlightGear, but this may vary depending on the distribution. You'll need to know where it's located if you want to do things like tweak the joystick or keyboard bindings, add aircraft, or add scenery. I'll refer to those directories starting with FlightGear, and leave it to you to figure out where FlightGear lives on your system.
You don't have to be an experienced pilot in order to enjoy FlightGear, but it certainly helps if you understand the basics, including aircraft nomenclature. At a minimum, you'll want to know the difference between an aileron, elevator, rudder, flap, and stabilizer. You might also want to peruse this PDF containing a flight school tutorial to help you with the basics.
The FlightGear.org Website has links to other user documentation as well: a FAQ, a manual, cheat sheet, and a wiki.
In addition to those resources, FlightGear users also have a mailing list and a #flightgear channel on irc.flightgear.org for real time assistance. As seems the norm for open source projects in active development, the formal documentation sometimes lags behind the current version of the software, making those last two sources of information even more valuable.
Setting up your joystick
Although you can control FlightGear completely with keyboard and mouse, a joystick is best. I purchased a Saitek Cyborg Graphite USB joystick not long after beginning to use FlightGear and I've never regretted spending the money. FlightGear has stock configurations for a number of joysticks from different vendors located in the FlightGear/Input/Joysticks directory. To see if your joystick comes with a pre-built configuration, look in the specific vendor offerings to see if there is a match for the model you have.
Your own particular brand and model joystick may or may not be included as one of the pre-built joystick control files that come with FlightGear. If it is, simply hack the joysticks.xml file in the FlightGear root directory to point at the pre-built file. By default, joysticks.xml contains a line like this:
<js n="0" include="Input/Joysticks/Local/joystick_0.xml"/>
Simply replace the included path to point at your specific joystick vendor and model, like this:
<js n="0" include="Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml"/>
If you don't find a configuration file for your joystick, or if the one you find is not to your liking, FlightGear provides a couple of tools to allow you to build your on configuration. For example, enter js_demo at the command line and you'll see something like the following:
Joystick test program. ~~~~~~~~~~~~~~~~~~~~~~ Joystick 0: "Cyborg Graphite" Joystick 1 not detected Joystick 2 not detected Joystick 3 not detected Joystick 4 not detected Joystick 5 not detected Joystick 6 not detected Joystick 7 not detected +--------------------JS.0----------------------+ | Btns Ax:0 Ax:1 Ax:2 Ax:3 Ax:4 | +----------------------------------------------+ | 0000 -0.0 -0.1 +0.0 +0.0 +0.0 . . . |
Note that the columns for five axis are numbered from zero to four. As I lean the joystick handle left and right, I can see the value listed under Axis 0 changing. When I bend it forward and back, the same thing happens under Axis 1. The throttle lever on the base of my Cyborg functions as Axis 2, and the cap on top of the joystick as Axis 4. The point being, now I know how each is seen by FlightGear, so I can assign them -- from zero to four -- the way I want them in the configuration file.
But how are the buttons identified? Press a button and a value appears in the Btns column displays a binary number equivalent to 1, 2, 4, or 8. Number those four values in sequence from zero to three and you have the button's number for FlightGear. When I squeeze the trigger, for example, the value in the Btns column changes to 0001, so I know that the trigger is button zero. If the value in the Btns column changed to 0010, the equivalent to 2, FlightGear sees the button as button 1.
If all you need to do is hack a pre-existing configuration, you now have all the information you need to do so, simply by changing the axis or button values to match your desires. But if you need to build a joystick file completely from scratch, you'll need to run fgjs as well.
The fgjs command will take you through a dialogue asking you to assign an axis or button to a long list of operations. You probably won't have enough axis or buttons to handle them all, so for many of them you'll have to simply skip them. You do that by pressing a button when asked for an axis, or by moving the joystick on an axis when asked for a button.
The program asks you to confirm each assignment as you go. When it's finished, it creates a jsX.xml file in the working directory, with the X indicating which joystick it's for. Copy that file into the FlightGear/Input/Joysticks/Default directory as joystick.xml and you're all set.
One final word of caution regarding your joystick, if you use one. Don't blame the joystick or its configuration if your aircraft drifts to left while taking off, or turns to the left while in flight. It's the realism of the simulator, and it's more pronounced in propeller-driven craft, like the default Cessna 172 you probably were flying on your maiden flight. I've seen this drift explained both as the result of propeller torque or a slip-stream effect, but I don't know which if either is correct. But it's not the joystick.
If you don't have a joystick, you can still fly, using the keyboard and mice bindings given in keyboard.xml and mice.xml in the FlightGear root directory. Hack them if you like.
Page 2: Taking your first flight, and FlightGear screenshots...
Note: Comments are owned by the poster. We are not responsible for their content.
Why are you such a spineless coward?
A small nit.
Posted by: Anonymous Coward on December 05, 2006 03:04 AM#