AI AIRCRAFT

           revollution

AI aircraft need to be as framerate friendly as possible, because, depending on what airport you find yourself at in the FS world, there may be 50, 60, even 70 aircraft present.  While FS can handle a single high polygon count aircraft with relative ease, framerates will quickly drop as more such aircraft are added.


In addition to the aircraft affecting framerate, other scenery objects affect it as well.  This is especially evident at larger airports which have many airport buildings, runways, taxi ways, and nearby city structures, which just by themselves can take a toll on framerate.  Since it's these larger airports that have the need for lots of aircraft to be present, it becomes pretty obvious why the AI aircraft need to be as framerate friendly as possible.



AI aircraft do not need to be as detailed as player controlled aircraft, and are not designed to be closely inspected.  They should look good sitting at the gate, as seen from a plane at an adjacent gate.  An AI aircraft doesn't need interiors or a large number of moving parts.


Framerate in FS is determined in large part by the number of polygons that FS has to display at any given moment.  The greater the number of polygons in your field of view, the lower your framerate will be.  AI aircraft need to use as few polygons in their construction as possible, and utilize the LOD (Level of Detail) feature which can significantly reduce the number of polygons that FS has to think about.


AI IS ALL ABOUT FRAMERATE

 




POLYGON BASICS


Types of polygons


    The basic building block of  a FS aircraft is the polygon.  A polygon can be a one point/vertex polygon (a dot), a two point polygon (a line) or a three point polygon (a triangle).

dot
There is not much use for a one point polygon in an aircraft, though in other 3D work, one point polygons are often used as stars or particles.

line
    Two point polygons can have a limited use for aircraft, usually as wires.  Antenna wires on a WW2 aircraft, or as rigging on a biplane are probably the most common uses.
 
shapes
    With almost no exceptions, all of the polygons in modern AI aircraft will be triangles.  You can make polygons in Gmax that have more than 3 points, but Gmax still considers them as a collection of triangles.  So, what to you is a square, Gmax sees as 2 triangles.  The "show faces" command in Gmax will show you the triangles.



Normals

    Generally, all polygons are "single sided".  This means that they are only visible from one side, on the opposite side of the visible side a polygon is completely transparent.  This is done to reduce the amount of computation needed to display/render an object.  There's no point in the computer having to render the polygon surfaces that face the interior of an aircraft, since no one would ever see them.

norm-1
    The side of the polygon that is visible is referred to as the "normal", or "surface normal" (as in: "this is the side of the polygon that would normally be visible")  If you turn on "Show Normals", you will see a line projecting from the center of each polygon.  This line will be on the visible side of the polygon.  In wireframe view this will show you which side of a polygon will be visible in the finished model.

    You can "flip" the direction of a surface normal by selecting an object or face, and using the "Flip Normal" modifier.

    If you are seeing the "inside" of a part, you'll want to use "Flip Normal".



Polygon Count & LOD


    There are 2 keys to making framerate friendly aircraft:

1) Polygon Count  Keeping the number of polygons used as low as possible and still result in an acceptable looking model. 

2)  Level Of Detail (LOD)
 Gmax also allows you to use LOD models to achieve framerate friendly aircraft.  LOD uses a series of models, each with progressively less detail.  As you get further away from an aircraft model, the model will appear smaller to you, and you won't be able to make out as many details, so a less detailed model (with less polygons) can be used.  FS will switch between these different LOD models automatically, depending on how far away the aircraft is away from the viewer.  Generally, AI aircraft only need 3 LOD models, but any number can be used, the default 737-400 has 9 LOD models!  In short, LOD is simply a method of reducing the number of polygons that FS has to consider when displaying a view in FS.  

The LOD models for an aircraft are usually referred to by number. For an AI aircraft with 3 LOD models  "LOD1" is the most detailed model, the model that will be displayed when you are very close to it.  "LOD2" is the midrange model, you can make out the shape pretty well, and would most likely be able to identify the airline.  "LOD3" is the far off in the distance model, no details are visible, just the basic shape of the aircraft.

lod1 wire
LOD 1     1600 polygons
LOD2 wire
LOD 2      1067 polygons
LOD3 wire
LOD 3      84 polygons
LOD1
LOD2

LOD3



Both of these, polygon count and LOD need to be used in conjunction to in order to deliver a framerate friendly aircraft.  Doing one well, but being sloppy with the other will result in less than spectacular framerate performance.  A high polygon count model used with very efficient use of LOD, is about the same as a low polygon count model used with inefficient LOD modeling.

What we are striving for is a low polygon count model, coupled with a good use of LOD.  This will result in a superior AI aircraft, because it will be very framerate friendly.




How to count polygons.


Click the hammer icon hammer to bring up the utilities panel, then select "Polygon Counter".

This will bring up the "Polygon Count" window.  The top counter shows the polygon count of just the selected objects, the lower shows the polygon count of all of the objects.  

You can set the number of polygons you would not like to exceed in the "Budget: windows.  As the number of polygons in your model approaches the budget level, the status line will change from green, to yellow, and finally red.

Note that in this screen shot, the polygon counter is counting the polygons of the simple cube that you saw in the preceding screen shot for surface normals.  While a cube only has 6 sides, Gmax sees each of those square sides as 2 triangles, not 1 square.  This is why the polygon counter is showing 12 polygons counted, not 6.
poly-counter




POLYGON COUNT

First, let's deal with polygon count.  Shouldn't you use as many polygons as it takes to make a good looking model?  Sure, but being AI aircraft, we don't need to be absolutely faithful to the prototype, and there are many things that you can do to keep your polygon count lower than you might think and still have a nice looking model.  A very common mistake that first time 3D modelers often make is to use far, far more polygons than are needed.  (I know I did.)

Aircraft take a lot more polygons to construct, than say, a building.  It is very easy to build a blocky object such as a building with very few polygons.  Aircraft, because of their curved surfaces, require many, many more polygons.  A 3D model can represent a cube with ease, because all of the cube's surfaces are flat.  The way that a 3D model represents a curved surface is with a series of flat surfaces stuck together so that they appear to be a curved surface.


 Let's look at 2 simple cylinders.




Even though these look like round cylinders, they are actually many flat surfaces put together that create the illusion of a cylinder.  Adding smoothing makes the illusion more convincing since it eliminates the facets that an unsmoothed object has.  Beginning 3D modelers often use an excessive amount of polygons to make a curved surface.
cyl01





Cylinder 1 has 28 polygons, cylinder 2 has 168 polygons, more than 8 times the number of polygons as cylinder 1.  You might think that cylinder 2 will look better in FS than cylinder 1 because it has more polygons.  But, once smoothing and a texture are applied they will be almost indistinguishable in FS.

The parts of an aircraft that consume the most polygons are parts that are round or curved; fuselages, engines, wheels, etc...
cyl 02







HIDDEN POLYGONS

After constructing a model there are several parts of the aircraft that may contain hidden polygons.  Even though you can't see these polygons, FS still "sees" them and will waste a few milliseconds of time displaying them.

There are several places to look for these unseen polygons.  Any part that is inserted into the fuselage probably has a few polygons capping off the end of the part that is inserted into the fuselage.  Wings, fins, pylons, gear struts, etc., all have polygons that can be eliminated since they will never be seen.
hidden polys
polys removed



ENGINE TRICKS TO REDUCE POLYGON COUNT
Most likely when constructing a jet engine you will end up with a couple of discs, one at the end of the intake, and another in the exhaust cone.




A 14 sided disc consists of 12 polygons.

The 14 sided disc can be deleted and replaced with a pentagon or hexagon.  It will look exactly the same as the disc, but will only use 3 or 4 polygons instead of 14.

So, in this example, on a single engine, you can replace the front and rear discs (28 polygons) with 2 pentagons or hexagons with a total polygon count of 6 or 8 polygons.

 On a 4 engined aircraft this can eliminate 88 polygons!
eng 01
eng 02



GEAR STRUT TRICKS
On a real aircraft, the landing gear struts are cylindrical in cross section.  For an AI aircraft, a much simpler cross section can be used.  Using a square or even triangular cross section on your gear struts can save many polygons.

Regardless of which cross section you use, all of the polygons that cap the ends of the struts can be deleted since they will either be hidden in the fuselage or hidden by the wheels.
strut01       strut02       strut 03





GEAR DOORS
Landing gear doors are another place where a significant reduction in polygon count can occur.



Here's typical gear door.

It consists of 12 polygons, you can eliminate the top edge polygons where the top edge intersects the fuselage, and this will reduce the polygon count to 10 polygons.
gear door 1


For even more reduction, you can delete all of the narrow edge polygons and move the 2 remaining parts very close together.  Now the count is down to just 4 polygons.
gear door 2
Pretty good, but we can go even further by eliminating one of the remaining halves, leaving us with just a single rectangular shape.

As is, this part is single sided and can only be seen from one side.  However, when applying a texture to this part in Gmax, if you use the prefix "DS_" in front of the material name, this part will be double sided, meaning that it can be seen from both sides of the polygon, not just from one side as is the case with most of our aircraft's parts.

gear door 3

So, we've taken a 12 polygon part and reduced it to just 2 polygons with no appreciable impact on the visual appearance of our aircraft.  On a single door, that's a reduction of 10 polygons, which may not seem like a lot, but remember, that's just for ONE door.  On a 727 for example, the nose gear alone will require 4 of these rectangular doors, thus 40 polygons can be eliminated using this technique.



TRAILING EDGES

trail 1

After initial construction, the trailing edges of many parts will be a series of rectangular polygons. These trailing edge polygons can be deleted.

trail 2

Trailing edge polygons have been deleted.  Next step is to weld the adjacent points  together to close up the opening where the deleted polygons were.
trail 3

After the 2 sets of points have been welded together.

This technique only removes 2 polygons, but your aircraft will look better for it, since the trailing edges of air foils should not look blocky anyway.

.

Depending on how it was constructed, the trailing edge of a jet exhaust will often have a series of polygons making up the edge.  These polygons can be eliminated, and the resulting opening closed up by welding the adjacent points together.
ex wire 01
ex shade 01

Here, all of the polygons that made up the rear edge of the exhaust cone have been removed.  This leaves a gap that needs to be closed up.
ex wire 02
ex shade 02

After all of the trailing edge points have been welded together.  This removed 28 polygons from the engine, and the exhaust cone looks better as well.
ex wire 03
ex shade 03




WHEELS


AI wheels need to be circular, but that's it.  They do not need to have edges rounded off.  This is a very nice looking wheel, but at 164 polygons, it's not very good for AI use,
tire 01

Essentially, a good AI wheel is nothing more than an extruded 12 sided disc.  This will result in a 44 polygon wheel.  Even the smallest commercial airliner probably has at least 6 wheels, that's 264 polygons.  With larger airliners with more elaborate gear, that number can be much higher.
tire 02

A 44 polygon wheel is acceptable for the LOD1 model, but the LOD2 model can use a much simpler wheel.  Using double sided polygons on the LOD2 model's wheels, the polygon count can be reduced to just 8 polygons per wheel.  The LOD3 model is seen from such a far distance that it doesn't need wheels at all.
tire 03

 



Questions?  Comments?  Suggestions?
drawlins@sprynet.com

A BASIC ANIMATION PAGE is still under construction, but you can get a preview by clicking the ANIMATE button.

Animate

© 2002  David Rawlins