Howto:Make an aircraft

From FlightGear wiki
Revision as of 16:55, 7 May 2009 by MILSTD (talk | contribs) (augmenting status field info, just telling something about development status without specifying valid values isn't of much use to newcomers)
Jump to navigation Jump to search
WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.
This article is a stub. You can help the wiki by expanding it.

There are many things required to develop an aircraft for FlightGear. We encourage new developers to start their 'career' by enhancing existing aircraft. It is much easier to do and gives you a giant advantage by the time you create an aircraft completely by yourself.

The content in this article gives a summary of codes and can be found on most planes. So, for examples on how it's used, you can take a look at some random planes.

Before you start

An aircraft in FlightGear has two main development areas:

  1. The Flight Dynamics Model (FDM): This tells the computer how your aircraft reacts to various conditions. The FDM is composed of two main models most people use, either JSBSim or YASim. Or the lesser used model UIUC. They specify how the aircraft reacts based on aerodynamic data and facts such as wind, terrain and control inputs. You need to supply and specify these parameters in order to model your aircrafts flight characteristics as close to reality as possible, the more parameters the better. A subarea of the FDM are integral systems like the autopilot and fuel systems.
  2. The appearence of the aircraft, which can be split in two ares:
    1. 3-dimensional model in .ac format and all of its visual aspects, animations, lighting and textures.
    • auditory (sounds).

All images in FlightGear should be sized to powers of two (eg. 64*64, 128*256 or 16*1024). Since FlightGear 1.9, images no longer have to be saved in the .rgb format. Right now .png is most common used among FlightGear developers.

Please note that we use spaces in our codes, some developers use rather tabs, to make our code easy(er) to read. Every line that starts a new tag, we press the space key once, so you get a kind of stairs. It does not really matter what method you use, as long as you use it consistent throughout all of your files.

Directories and files

The data created during development results in many files, which are stored in several directories per aircraft. Each aircraft has its own directory in the $FG_ROOT/Aircraft/ directory. The first thing to do when you start working on a new aircraft is to make a directory for it. A short version of the aircraft name (eg. harrier), or its serial number (eg. 747-400) is prefered. More directories might be needed further on, but we will create them when we need them. For now we create one directory, namely:

  • Models/ all files related to the appearence of the model are saved in this directory.

All paths are relative to $FG_ROOT, with the exception of some that are explicit noted.

The .xml file (FDM)

This file contains the entire (or partial) Flight Dynamics Model of the aircraft. We have three different systems; they all have their up- and downsides.

When you have acces to real windtunnel data, JSBSim might be a better choice.

The -set.xml file

This is the most important file of a FlightGear aircraft. This is the only file that is read directly by FlightGear. Actually it can be compared with an airport hub (from where flights of a certain airline to all other airports departure and arrive). The -set.xml file leads FlightGear to all files that are needed to simulate the aircraft. The -set.xml file should be stored in the aircrafts root directory (eg. $FG_ROOT/Aircraft/747-400/)

Always begin the -set.xml file with:

<PropertyList>
 <sim>

and close the file with:

 </sim>
</PropertyList>

The following tags are to be placed between the <sim> and </sim> tags.

<description></description>

The text that have to be showed in the Aircraft selection dialog of FlightGear.

<aircraft-version>

Commonly shows the latest update date.

<status></status>

The status of the development of your plane. This can for example be used in order to get a list of aircraft with a certain minimum development status by passing the --min-status= parameter to the fgfs executable.

As of 05/2009 the following status "symbols" are supported:

  • alpha
  • beta
  • early-production
  • production

<author></author>

Place your name(s) here. If multiple people worked on the same aircraft, you can place the specific development area for each person between ( ).

<flight-model></flight-model>

What FDM system is the aircraft using. Set to 'yasim' for YASim and to 'jsb' for JSBSim.

<aero></aero>

The filename of the FDM file, without .xml. You have created this file earlier on at: #The .xml file (FDM)

<splash-texture></splash-texture>

Place the location of an image you would like to show during loading of the aircraft.

<model><path></path></model>

Where to find the model. Could be an .ac file or .xml if you want to have extras like animations etc.

<sound><path></path></sound>

The path to your aircrafts sound file, do not include if you don't have one. The pitch and volume of the sound is controlled by the xml file and throttle position. If for example you find a nice wav file of the jet engine you're using, you can fix it up with your favorite sound editor so it loops nicely and include that into your model (I've noticed a few models where it can get quite annoying when the loop length is so small you can really notice it) so make it smooth.

<panel><path></path></panel>

Where to find the (2D) panel. We prefer 3D cockpits, which are linked in the model .xml file.

<autopilot><path></path></autopilot>

Where to find the autopilot system.

Extra codes

We can place information in our files, that will not be read by FlightGear. Such as summaries of the codes to follow, last update dates or explenations of codes.

 <!-- Last update: 09-10-2007 -->

Related content