![]() |
How is a Flight Simulator plane designed?
Illustrated using "R4D-6 #50819", by the Mid Atlantic Air Museum Simulation Team
I
have had so many requests to describe how Flight Simulator planes are put together
that I have finally caved in and decided to write something about it. While
I make no claims to have more than a superficial understanding of how a package
is put together, I had some excellent advice while I was doing the background
for the piece, so hopefully, this article will give you a better idea what lies
behind the packages that we enjoy using so much.
The big news is that I have been very fortunate to be able to write in cooperation with the team behind the much-anticipated Gmax version of the Mid Atlantic Air Museum R4D-6 simulation project: Bill Rambow, Jan Visser and Fred Banting. In partnership with the Mid Atlantic Air Museum, they are creating an exceptional add-on for Flight Simulator, and showcasing its development happens to be the best way I can think of showing what leading-edge FS design can achieve.
So before I say any more, I am going to beat the drum for the Mid Atlantic Air Museum. MAAM was formed in 1980, for the purpose of acquiring, restoring, operating and preserving classic aircraft. The museum has expanded tremendously over the years and now posesses a collection of around fifty aircraft thanks to the support of more than a thousand volunteers. MAAM is certified as a non-profit organisation by the IRS and relies entirely on donations and membership subscriptions for its existence; without them its collection (which ranges from a 1928 Elias Aircoupe to a 1983 American Aerolights Double Eagle) would be dispersed or left to rot.
There are precious few organisations around the world with any kind of commitment to keeping aviation history alive - so they all need our support. MAAM is a good setup, and furthermore it has good track record of financial support from the flight simulation community. In the same way that simmers have taken Meig's Field to heart, many have adopted MAAM, raising tens of thousands of dollars towards a worthy cause.
The
one request I have is that if you like what you see and read about the R4D here,
and would like to support the museum, make sure you order a copy of the R4D
and the B25 CDs when they become available. Why should you buy the CDs? Well,
first of all they would be a bargain at twice the price; and second, if they
make enough money, then we can look forward to regular upgrades. R4D has already
proved to be one of the most popular packages ever released for Flight Simulator
and the B-25 sim which is currently waiting in the wings promises to be just
as good.
For flight simmers, the bottom line is that the R4D is seriously good fun, and it isn't often that you get to enjoy yourself and help a good cause at the same time. All the revenue from the #50819 simulation goes to MAAM and the museum is critically dependent upon it - without the money, R4D, which hasn't flown for three years because of engine problems, may end up being gronded indefinitely. According to Bill Rambow, 'MAAM has already purchased an engine for their Martin 4-0-4 Silver Falcon, which has been stranded away from home at Johnstown, PA for a year or so - that unit was a bargain at $28k. The Martin got priority because we wanted to get it home to Reading, whereas the Douglas is on our own ramp. However, the engines for the R4D pose a tricky problem, because they are not normal, run of the mill 1200 hp DC-3 engines; they are the very much rarer 1350 HP P&W R-1830-94's. These can only be had from two rebuilders, both on the west coast of the U.S., and the units cost $48k each; since one engine is shot, and the other is of nearly the same age, two are on order. So far the R4D Team has raised nearly $80,000, but since the total bill for buying, shipping and fitting all three engines is $144,000, which leaves the museum with an all too real $64,000 question.' Sixty four thousand bucks might sound a huge sum, but it is an achievable target. After all, if flight simmers could help save Meig's field, then surely R4D deserves a chance - besides, I can't wait to see what it looks like in FS2004...
Future versions of FS aside, a whole lot of water has passed under the bridge since R4D's hull first flew in the nineteen forties. This is a plane that has made history; it served with the Naval Air Transport Service in '44 and '45, a small cog in the military logistic machine, before seeing seventeen years of service with the FAA as an instrument approach check plane. #50819 is an old lady indeed, and getting just a little tired, but nothing that a new pair of Pratt and Whitneys couldn't sort out.
Teamwork
In
the same way that the real R4D has to be maintained by a team, so the sim has
a group of developers behind it. Twenty years of upgrades have made Flight Simulator
so complex that it is no longer common for planes to be designed by a single
person; the reason being that, in general, one man can't acquire all the skills
necessary. Of course, there are exceptions to this rule, and there are plenty
of aircraft out there that have been coded by a lone simmer, but they tend to
be at the less complex end of the scale. For example, while you can find many
planes with excellent visual models, it is rare to find one with any more than
a so-so 2D panel, few have virtual cockpits and most use one of the default
sound sets. And when you do find that some heroic individual has developed most
of a plane, the credits will often mention others who have pitched in. That
is just the way it is.
We are getting into deep water already, so I guess I had better explain some of the background. Forgive me if I am teaching my grandmother to suck eggs, but if you aren't clear about how Flight Simulator planes are designed, read on, because the processes involved are seriously interesting. If you are clear, then from the design point of view, there are four major parts that make up an FS aircraft:
1. the visual model -
2. the panel -
3. the sound set -
4. the flight model -
We'll look at each one in turn.
The Visual Model
Essentially,
this is what you would see if you walked around the real plane and peered in
through the windows - the fuselage, the wings, the control surfaces, the engines
and the wheels; but also the interior of the plane and the cockpit.
For readers who aren't too sure about what virtual cockpits are, FS2002 planes can have two different panels: the 2D panel, which has a fixed view; and the 3D panel, or virtual cockpit, which can be panned around at will using a hat control. The virtual cockpit is called the VC for short, and in Flight Simulator terms, it is in its infancy - not even all the default Microsoft planes have one. We'll get on to the VC in a minute.
The visual model offers all kinds of challenges to the programmer. Airplanes aren't regular items; they have all kinds of lumps and bumps and kinks and all in all, they are some of the most subtle and complex shapes around. Capturing the basic lines of the fuselage of a really simple GA plane like a Cessna single can take hundreds of hours of programming and that is before you begin to think of the aerials, windows and cockpit. Then there is the gear to consider - how many parts do you think the average main wheel assembly has in it? The R4D unit for example, has no less than 24 major components and is a simple example, since unlike most aircraft with retractable undercarriage, the Douglas has no gear doors.
Once the initial work on the shape of the plane is done, the designer is barely half-way there. Unfortunately, airplanes have moving bits on them - in the older versions of Flight Simulator, animation wasn't possible, but try releasing a plane nowadays with fixed control surfaces and see how many downloads you get. People expect the closest possible imitation of reality and that means that if a plane has retractable wheels, they should retract, and if it has an opening cockpit, it should open. So visual models have to be animated.
But before we get onto animation, I had better back track a little. How are visual models designed? It would be possible to write a whole article on the history of the tools involved, but for our purposes, most FS2000 planes were designed with Louis Sinclair's FSDS, which is now rivalled by Discreet's Gmax, which has increasingly become the tool of choice of commercial FS developers. There is a lot of politics surrounding the change, but from a user's point of view, there is no reason why visual models won't work in FS2004, which is good news. Although Gmax is becoming more popular, we are still seeing quite a few FSDS designed planes appearing, but almost all commercial designs are now being built using the new tool.
The screen shots show the R4D model being constructed using GMax. Visual model construction is a painstaking process that starts with blueprints and photos of the plane, from which a wire frame model is built. Once this first stage of the visual model is complete, textures need to be applied. The best way of thinking of textures is that they are a colored "skin" wrapped around the aircraft model - different sets of textures can be used to create representations of different planes and these are commonly known as "repaints". Sources of textures include books and photographs of real planes; and they can either be scanned or hand-painted, depending on the effect the visual modeler requires. GMax makes it possible to have external objects reflect on visual model textures, hence the current popularity of bare metal fuselages in FS2002.
The next stage is animation. In the past, this was done using a separate animation tool which was used to set up the range of movement of control surfaces, with macro programming languages being used to design the more sophisticated effects, such as oleo leg compression. In Gmax, all these processes are brought together in a single application. If you look at the screen shot above, the scale and "slider" you see underneath the two lower viewports belong to the Gmax animator. 'We can have up to 200 frames of which the last 100 are only used for gear damping animation,' Jan Visser told me. 'In this picture the slider is located at the frame 100 so everything which is animated (including all animated peripherals belonging to the VC) is in fully extended position, gear, flaps, cowlflaps, pax door, etc.'
As
you can imagine, animation is one of the most complex and interesting areas
of FS design, because the movements of control surfaces, for example, in the
visual model has no effect on the flight path of the aircraft itself, so judgement
is needed to set up proportional effects. With the advent of GMax, it has become
possible to integrate animation into the basic airframe design, which cuts out
many problems in the design cycle.
Take a look at the screen shot of the wheel and gear above. The model you see consists of 24 'objects' , 1133 'vertices', and 1817 polygons, or "faces". While you can only see one wheel there, FS2002 designs need three, because of the way it does wheel animation. The first wheel is used for 'static' display, the second when the aircraft is starting to taxi slowly, and the third when the aircraft is moving at a fair speed. As it happens, this particular animation is not made with GMax but is taken care of by FS2002 itself; as long as the wheel parts are named correctly (f.i. l_tire, l_tire_still and l_tire_blurred for the seperate 3 wheel objects) FS will go ahead and animate them on the fly without being asked. By the way, this goes for the wheels animation only, the gear retraction/extension animation does have to be animated within GMax.
The final part of the visual model is the virtual cockpit, or VC and the interior of the plane. The VC has been growing in importance ever since we first saw it a few years ago. FS2000 VCs were very simple creations with non-moving bitmaps for gauges, but the important thing about them was that it became possible to smoothly pan the pilot's viewpoint to any position the user wanted. FS2002 added working gauges to the VC, making it easy to imagine that one day the 2D panels we know so well might disappear entirely. The existence of two completely different ways of being able to "see" the cockpit of an FS2002 plane has long been a source of confusion; but until now the justification for retaining the 2D panel has been preserving frame rates and providing a way of adjusting instruments.
The
R4D also includes a fully detailed virtual interior to go with the VC, which
will allow users to stretch their virtual legs by taking a walk around the plane,
using the appropriate key commands. Virtual interiors started to appear late
in the FS2000 release cycle and have proved to be terrifically popular. The
fact that users like them so much has spurred designers on to even greater efforts
and as you can see from the screenshot, the plane is pretty much state-of-the-art
in this respect.
The panel
The first version of Flight Simulators had the most basic wire frame graphics and two instruments; but as the program became more and more sophisticated, so did the panels, with the result that nowadays, when you first load an FS plane, you can expect to see a close approximation of what a real pilot sees - what we call the 2D panel.
At its most basic, all a 2D panel is is a single bitmap upon which the gauges are placed, but the more sophisticated examples have 8 or more different fixed views. The key to the 2D panel is the word "fixed". When this feature of Flight Simulator first appeared it was so novel that no-one minded that the range of viewpoints was limited, but as time has gone by, users have begun to demand more, hence the rise of the 3D panel, or VC, which lets you look anywhere you like.
Having two different types of panel isn't terribly logical, so while it is possible that the 2D panel may persist in FS2004, its days are numbered. As part of this swan-song, the R4D has one of the best 2D panels ever released, with two main panels views - one for the pilot and the other for the co-pilot.
2D panel design starts (hopefully) with the developer sitting in the cockpit of a real plane, armed with a digital camera. A series of shots are taken from the pilot's "point of view" and these are converted into the familiar views we see in the sim. It sounds simple, but there is quite an art to it.
If
you have ever wondered how cockpit "windows" are made in Flight Simulator,
they are constructed by "blacking out" areas of the cockpit bitmaps.
Any areas colored with pure black (0-0-0) are rendered transparent by FS - the
screen shot shows you how the left hand seat view bitmap looks before being loaded
into the program as part of the package.
But in many ways the most interesting thing about a Flight Simulator panel is the gauges. The reason the panel bitmap here is blank is because the gauges haven't been positioned over it yet; check out the screen shot above to see what the finished article looks like. But what most simmers don't realise is that the only limit on what gauges do is the developer's imagination - they aren't just restricted to representing things like airspeed indicators and altimeters. So, for example, the throttle quadrant in many FS cockpits is a gauge, only instead of having hands moving around a dial, it has levers. Gauges have been used to program everything from moving windshield wipers to visors in FS planes - in-flight simulation of the beta range of variable pitch propellors being another good example (in this case the code was "buried" in an indicator light on the aircraft's panel).
As you might imagine, there is more to a gauges than just a pretty face, and even the simplest DI will have around 150 lines of code driving it, while more complex ones have thousands. The protean nature of gauges means that not only can they be used to display data derived from Flight Simulator's complex physics engine - for example outside air temperature - but they can also be used to alter the state of the simulator. The throttle quadrant is a good example of a gauge affecting the sim; if you advance the propellor lever, you increase the engine rpm.
Just
to give a flavor of how gauges are designed, let's take an artifical horizon,
shown in the screen shot opposite. The graphical components include a background
bitmap for the bezel, for which the lighting would be the same as the main panel
lighting, another bitmap for the face, and one for each needle. The lighting
is for each bitmap is defined separately, the bezel using the main panel lighting,
and the face and needle using the gauge lighting. A pixel on each of the needle
bitmap is chosen as a rotation point and this is positioned over a similar point
on the background bitmap - think of this point as the "pin" the needle
turns on. The needle bitmaps are then programmed to rotate on this pin according
to data read from the appropriate FS variable and all motions are relative to
the background. The bitmaps stack up from bottom to top just as the elements
in the real gauge would and the whole thing is driven by code written in C++.
The screen shot shows the parts from which the upcoming MAAM B-25 sim's AI is assembled, which gives an inkling of how complex these things can be; and for those who are interested in a little more detail about how gauge design is done, I have included a mini-tutorial by Fred Banting, which is based on an oil pressure gauge for a light twin.
Gauge programmers tread on a tightrope, because the complexity of modern panels means that inefficient coding can slow the entire sim to a crawl. In the case of the R4D there is a total of 31 gauges, though in Flight Simulator advanced coding techniques allow them to be packaged very efficiently. According to Fred Banting. 'Since the advent of the multigauge format however single gauges are becoming a rarity. These days all the gauges in a project are built into a single multigauge so it becomes more meaningful to think in terms of the code for an entire project. The code will probably end up at around 8000 lines total.'
The Sound Set
Next
comes the sound set, a very specialised area in its own right. Although the
quick and dirty solution is to use a sound editor to alter an existing set of
aircraft noises, the best sound sets are painstakingly recorded in the field.
This means that the recordist has to actually fly in the cockpit, capturing
everything from the start-up procedure to the clunk of the gear locking down
on approach. And that is just the interior sounds - a separate set has to be
recorded externally, which are played when the user switches to spot plane mode.
Given the immense difficulty of cadging rides in airplanes, it probably isn't
surprising that the vast majority of sound sets available for FS aren't original.
819 hasn't flown for so long that people are beginning to forget what she sounds
like, so until a new pair of engines can be bought, the FS2002 sounds come courtesy
of Jeroen Pletttenberg of the Dutch Dakota
Association - they contain no less than 39 unique .wav files at the time
of writing.
One problem FS sound developers face is that because all engine sound files apart from the startup/shutdown wavs have to be played as loops, repetitious effects are quite likely, and piston engined planes like the R4D are much worse affected than jets. While you might get a good result with a repeating 3 second long cruise sound wav for a jet airliner, it would be almost impossible to make this work for a reciprocating engined aircraft.
The next issue is a purely practical one; many flightsim addons make the majority of their sales online, so file sizes have to be kept down to allow for download time. Guess what? The biggest sound files are normally the startup/shutdown wavs - for example the start-up wav of the current B-25 soundsuite is about 1.5MB. If file size were no object, a cruise sound wav with a file size reaching 2MB is easy to imagine, but much same effect is theoretically possible with a carefully edited 300 kb wav. How is this possible?
According to Jan, 'Setting up a cruise sound wav for a recip engine, you'd first carefully examine the source sound and pick out a sequence which sounds suitable, nice steady sound of the engine, with no disturbing other sounds like talking. Once you have recorded the sequence in your sound editor program you can play it back in a loop and then, mostly, the real work begins. In most cases the loop effect will be very obvious no matter how steady the engine sounds, there's a hell of a lot going on inside that engine of course. Now it will be "just" a matter of trying to "glue" the beginning and the end of the sequence together by cutting bits off of either the beginning of the sequence or the end or both. Depending on your luck you might end up with a sequence with which the loop effect cannot be heard anymore. If not you start all over again....;-)'
The sound set is hung together using a file called sound.cfg which lives in the aircraft's sound folder. This has individual entries within it for each possible combination of sounds, so that the user hears the correct noises even in complex situations, for example where the right engine is at idle, the left at full power and flaps and gear are being lowered. The difficulties of coding sound sets are such that it is often the last part of a package to be addressed, and it is often done very badly, but the sounds are a real delight - chiefly because the developers are officially part of the Museum and have easy access to the plane.
The Flight Model
There
are very few really good flight models available for Flight Simulator, for the
simple reason that coding one is like playing three dimensional chess in the
dark. The sheer difficulty of producing a good one means that like sound sets,
flight models have a disturbing habit of being "borrowed" from other
planes and hacked about until they are approximately right. But while it is
hard to imagine that Flight Simulator will ever climb the mountain of simulating
every single physical sensation of flight, it can "do the numbers",
producing planes which climb at the correct rate and fly at the correct airspeed
for any given power setting.
Even "doing the numbers" can be very tough, because most of the code which specifies performance is hidden away in two venerable Flight Simulator institutions, the ".air" file and a file called the aircraft.cfg.
The values in the air file interact with the physics model within Flight Simulator to produce the aircraft's handling characteristics - with a bit of juggling you can make a 747 fly like the 172, just by changing their air files around and doing a little editing. In a nutshell, that is it, but the complicating factor is that Flight Simulator has various inbuilt engine models: a piston engine; a turboprop; and a jet and none of them are very good for taxiing. The worst problem is that all of these are showing their age and furthermore, the turboprop model is hacked from the jet engine, which causes all kinds of difficulties. When you add to that the fact that the air file codes have never been properly documented, you can understand why flight models are so hard to do well.
Part of the trouble is that even the values whose properties are well-known; for example, the "dihedral angle", can produce unexpected effects. If dihedral is set anywhere near its true value for the real plane, the result is a simulation that rolls out of turns in a most unreal fashion, possibly the single most irritating bug I can think of in Flight Simulator.
So
flight modellers have one of the most frustrating jobs in Flight Simulator development,
fine tuning completely abstract values to produce the correct "feel".
There are hundreds of values to play with, and achieving the right effect can
involve changing several different values at the same time. As Fred points out,
'One change will often have an undesired side effect somewhere else which requires
another change, which... and around and around it goes. There are so many variables
to juggle that every flight model is a balancing act of compromises until the
designer is satisfied, and if several designers were to develop a flight model
for the same aircraft each would be different even though they all might be
considered "correct" within the limitations of FS.'
The aircraft.cfg file is the glue that holds the flight model together: it specifies which engine model the plane should use (the helicopters use the turboprop); holds reference values for various other bits of data, such as weight and balance; and points FS to which air file should be used. There probably was some kind of logic behind what goes in the air file and what goes in the aircraft.cfg, long ago, but whatever it was has been lost in the mists of time. All that is left now is a mess, but designers have learned to get along with it - when they aren't chewing thecarpet over it.
And that is how a Flight Simulator aircraft package is put together. This article barely scratches the surface; it would take a hundred thousand words to do the subject justice, but I hope this has proved informative and that it has whetted your appetite for the Gmax R4D. The team that is developing the package has given their time for nothing so that a very rare old lady can stay in the air; the only request I am going to make is that you seriously consider buying the CD when it is released.
Andrew Herd