In the world of Flight Simulator, a gauge is any device that might appear in an aircraft’s cockpit, from a simple altimeter or clock, to a GPS system, weather radar, or radio stack. They are all called “gauges”, and they are added to the “panel”—the visible cockpit panel of any aircraft.
Whether the gauge is to appear in the flat 2D view of the cockpit panel (albeit with graphics tricks to make it look more 3D), or in the 3D “Virtual Cockpit” view, the development process is the same. It is important to note that a panel is specific to an aircraft, but a gauge is not. One gauge can be referenced by any number of aircraft. Panels can be shared if, for example, two aircraft are so similar (typically different versions of essentially the same aircraft) that they use a technique known as “aliasing.” The more normal situation is for each aircraft to have its own panel definition file, each of which references a number of gauges that are common to several aircraft, with just a few gauges that might be specific to that one aircraft.
The development of panels and gauges is very much an exercise in good artwork. Except when you’re dealing with the most complex of instruments, creating the artwork probably represents the majority of the time you’ll spend in creating panels and gauges. You’ll need good skills with one or more of the best photo-manipulation software tools if you’re going to create realistic-looking gauges.
There are many examples of panel artwork shipped with FSX, and the definition of a panel is described in the “Panel Configuration File” document that ships with the SDK.
There is only one way to create a panel, but there are several ways to create gauges. Which approach to gauge development you should use depends largely on your C++ programming skills, the complexity of the gauge, and your personal preference.
The easiest way to develop a gauge requires no particular skill in C++ programming: use the ACE tool to develop an XML-based gauge. This process is described in full and illustrated by a complete tutorial in the “Creating XML Gauges” document in the SDK. In addition to showing you how to create a simple panel, the tutorial shows what you need to do to produce a Fuel Pressure gauge, which is the simplest of gauges since all the mechanics that are required is to read the general engine fuel pressure and display it as a floating point number in a simple box of a gauge. The tutorial also shows how you can develop a stopwatch, a more complex gauge that stores information every time one of the buttons of the stopwatch is clicked. If you complete the tutorial you will create both gauges and have them up and running in your version of FSX. They are, however, not very beautiful—good artwork is left as an exercise for the reader!
Very complex gauges have been developed exclusively using the ACE tool and XML, including the GPS systems shipped with FSX. However, there are some disadvantages. First, you’ll need to develop the logic for the gauges in postfix notation (often called “reverse polish notation”), which is fine if the logic is simple but can get very confusing with complex systems. There is also no easy means of debugging XML gauges, and though the system is pretty flexible, it does not match the complete flexibility of the full programming language development systems such as Microsoft Visual C++.
If you’re developing gauges with a programming language, C++ is really your best option. No samples are provided in any other language, and the programming system does not readily support any of the .NET-based languages. However there are two approaches here that are significantly different. The gauge can be developed in its entirety using C++. This is described in full in the “Programming C++ Gauges” document in the SDK, which also includes a full range of samples, including descriptions of how to include the various pieces of artwork (background, moving needles, etc.). This system has traditionally been used by many of the professional gauge developers who have provided high quality add-ons to Flight Simulator. Many developers feel more comfortable with this development model, as their intellectual property is compiled into the binary files and the secrets of their gauge code are not so easily readable as they are with XML files. The disadvantage, though, is it is not very convenient to do quick prototyping or view and design the gauge appearance from the various artwork components.
The third method of developing gauges is to use the XML system to handle the appearance and user interaction of the gauge, while using C++ to handle the processing. This method of developing gauges is described along with a sample, the Cabin Comfort, at the end of the “Programming C++ Gauges” document. The complex callback code that this requires is all present in the sample, so it could readily be used as the basis for a gauge development project. The key here, of course, is information passing from the XML scripts to the C++ code and back. The Cabin Comfort sample is a contrived gauge, where some of the information is obtained from the aircraft in the normal way, while other information is gathered from calculations within the C++ code. And again, it is not an object of beauty; good artwork takes time!
One important note: the SimConnect API system, described in the “SimConnect” document, is not integrated with the gauge system of FSX. The SimConnect system includes many useful API calls for developing other sorts of applications, but could be integrated with gauges using the Cabin Comfort code. Both SimConnect and the gauge system access aircraft data using specific strings that access simulation variables for data or key events for user interaction. These strings are listed in full in the “Simulation Variables” and “Event IDs” documents in the SDK.
If this is your first time in developing a Flight Simulator gauge or panel, start with the tutorial in the “Creating XML Gauges” document. You may well never need to leave this process.
Developing gauges is of course just one kind of project covered in the SDK. Other projects include developing missions, building complete aircraft and scenery, adding weather systems, setting up and controlling aircraft using an add-on developed using SimConnect, and many other tasks. Refer to the SDK Overview document for a brief overview of each SDK component.