The SCASM Language

The SCASM (Scenery Assembler) language, authored by Manfred Moldenhauer (M_Moldenhauer@compuserve.com) of Hamburg, Germany, gives model designers a way to tinker with the object source code (.sca) file for a flight simulator model. SCASM is the most widely used scenery compiler in the world of flight simulation.

Microsoft´s Flight Simulator was developed to allow users to add their own scenery and models to the program. These scenery objects, contained in files with the ".bgl" extension, contain the binary HEX code used by the simulator engine to properly render and animate the object.

The object source code file (.sca) for scenery objects is simple ASCII text that can be read and edited with any text editor program. In fact, with the help of a simple text editor, you can make some remarkable scenery objects by hand coding alone!

A SCASM Compiler translates this standard ASCII text file (easily readable by humans) into a binary hex code file with the ".BGL" file extension (easily readable by computers).

NOTE
Yes ... an airplane is considered a scenery object. If you put the aircraft model into a .bgl file you get a static scenery object. Put that same .bgl code into a .mdl file however, and you get a flying scenery object!

"Hey ... I'm not a programmer! Why do I need to know this stuff?"

The simple answer is that some knowledge of SCASM programming is essential for making high-quality 3D models. With your knowledge of SCASM and how CFS2 renders models you'll be a much better designer/modeler. Furthermore, you cannot create the special effects described in this guide without it.

The 3D World

When you create a model with FSDS, or any other model design program, all you are creating is a 3D object that CFS2 will place within its own 3D virtual world. Your model consists of a large number of coordinate points defined relative to the model's coordinate system located at X=0.000000 Y=0.000000 Z=0.000000.

That's fine, but just where is CFS2 (or FS2002) supposed to put this thing once it's loaded into the simulator?

When building your model with FSDS, take a close look the Project Properties window. Here you'll see the input fields for the Scenery Header, Reference Point, Area Block, and Area Type.

These data define where in the simulator world your model will exist, the scale of your model, how far away it can be seen, and, most importantly, exactly where to place it the simulator's three-dimensional world.

The Longitude and Latitude set in the Area Block fields along with the Elevation set in the Reference Point field define the location of your model's coordinate system in three-dimensional space, i.e. the exact location of your model's reference axis system, or origin. CFS2 uses this information to recalibrate your model coordinate system to zero and place it in the simulator's own 3D world.

In the normal orientation of the CFS2 simulator world,

X Axis    East to West    East is positive
Y Axis    North to South    North is positive
Z Axis    Up and Down    Up is positive

The Virtual Point System

In order to operate in the flight simulator's imaginary 3D-world, we build object models composed of hundreds, even thousands, of 3D-points to define the basic shapes that create an aircraft, a building, a ship, or some other physical object. The flight simulator engine uses this vast set of points to determine the size, orientation and visibility of your object.

It is entirely possible to use the SCASM language alone to create these objects, but that would be a challenge reserved for folks with little else to do in life and lots of time in which to do it. Fortunately, there are a number of good 3D design programs that do all the tedious detail work for us and make quick work of creating objects.

Among the most well-known design programs are FSDS (Flight Simulator Design Studio, Abacus), NOVA2000 (Rafael Garcia Sanchez), GMAX (Discreet Software), and EOD (Easy Object Designer, Matthias Brueckner). Their greatest asset is their ability to generate and manage a large set of 3D points that you define to represent an object.

SCASM is a language that, in a sense, "connects the dots," by telling the flight simulator what to do with all these points.

Design programs generate the SCASM code necessary to visually display and place objects in the simulator's three-dimensional world. The better design programs also generate an object source code file (.sca, .scm, .scx) containing all the SCASM code used to render the object.

Every object in the flight simulator consists of only one thing ... points in space.

There is the Point (a single dot), rendered as a visible colored point with a graphic halo-like effect around it. It always appears with the same brightness, regardless of any other lighting conditions.

There is the Line, a visible line which can be colored and drawn between two points in space.

Finally, there is the Polygon, a flat plane surface that exists between at least three points in space and which can be filled with a color or bitmap texture.

The simplest polygon is the triangle. They can exist with more points, but they are most often defined with just 3 or 4 points.

When you start creating polygons of more than 4 points, you have to be very careful that the resulting shape is planar, i.e. flat, not concave or convex. The polygon can be oriented any way you wish and can be an irregular trapezoid, pentagon, or any other shape with a plain surface, but it must be flat.

Regardless of the shape of the polygon you create, when CFS2 renders that shape it will draw it as a series of 3-point polygons (triangles).

To create a rounded surface, say a wheel, you will end up with an object comprised of a series of rectangular and triangular planar polygons. The more polygons you use, the smoother the rounded surface will appear in CFS2. You probably already know that a 32-sided fuselage looks much better than a 8-sided tube.

NOTE
A simple 4-sided tube with two sections is defined by 12 points. If the ends are closed, that's 20 polygons. A 32-sided tube with two sections is defined by 96 points. If the ends are closed, that's 256 polygons. Quite a difference.

Every polygon you create is paid for in computer performance.
The more polygons ... the greater the cost.

Remember ...

Good object-design is not measured by the number of polygons.

The flight simulator is a dynamic environment, with a lot of objects being moved in every frame. Your design should always be a trade-off between the level of detail and flight simulator performance.