Home  |  About  |  Links



AI Tutorial

This AI tutorial was written for traffic bgl's created for FS9 using the TrafficTools program.  There are other utilities available that will create bgl's for either version of FS.  I'm told that there are even utilities available to make bgl's created in FS9 compatible with FSX, but I have no first hand knowledge of this...check the forums of the popular FS/AI sites for the details. 

Creating a traffic file is very easy, and flight sim allows you to have multiple traffic files (new in FS9).  First, you create three small text files; Aircraft_xxxx.txt, Airports_xxxx.txt, and Flightplans_xxxx.txt  Second, you compile them using TrafficTools.  Finally, add parking spaces (as needed) with the AFCAD program.  It really is as simple as it sounds, and before too long your home A/P can look like this

Before we get started, you'll need to download and install the FSUIPC  utility from Pete Dowson.  You'll also need the TrafficTools and AFCAD programs by Lee Swordy.  

Although it's not necessary for this tutorial, I'd strongly suggest that you get acquainted with the help files in the TrafficTools, and AFCAD programs.  They're very well written, well organized, and are generally considered to be "the bible" for all things AI in FS9.  Refer to them often, because the answers to most of your questions will be found there.

Table of contents

Section 1
The Aircraft.txt file
The Airports.txt file
The Flightplans.txt file

Section 2
Putting it all together with TrafficTools

Section 3
Adding parking with AFCAD


Create a folder on your desktop. Name it whatever you want, with the understanding that when you compile the three text files, the resulting traffic bgl will have the same name as the folder you just created,  Traffic_samename.bgl. (this will be known as the traffic folder)  Create three empty txt files.  Give them the same name as the folder you just created.  I'll be using KOWD in this example, so the folder and the txt files would be named KOWD.

Example:  Folder name=KOWD Files=Aircraft_KOWD.txt, Airports_KOWD.txt and Flightplans_KOWD.txt

The three txt files must always begin with Aircraft_  Airports_  Flightplans_ and should reside in a folder of the same name.


Weíll start with the Aircraft.txt file.  In this file you would ordinarily choose which aircraft in your Ö\FS9\Aircraft folder you want to use as AI, however, in this example weíll be using the DC-3 and the Piper Cub. After youíve created the file, make the appropriate entries. You can simply copy and paste my entry at the end of this section, if you prefer.

1. First youíll give the A/C a number that youíll also reference in the Flightplans.txt file later.  We'll be using the DC-3 as our first aircraft.

2. Followed by the cruise speed. I use the one referenced in the aircraft.cfg file. Optionally, you can use the @ symbol in the flightplan to force arrival times at a gate, as noted in the TT's help files.  The DC-3's cruise speed is listed as:

3. Next youíll need the title= line, found in the [fltsim. #] sections of the A/C cfg file. I recommend you copy and paste it instead of typing it. It may save you headaches down the road. The title line is critical! It determines which plane (texture) will show up as AI, so read the A/C cfg file very closely and select the title line for the correct texture.
"Douglas DC-3 Paint2"
Note that the title line is in quotes. The completed Aircraft_xxxx.txt file should look like the one below.

AC#1,161,"Douglas DC-3 Paint2"
Note that each component of the file is separated by a comma. (no spaces)

The entry above represents the Aircraft_xxxx.txt file for the DC-3 Cargo aircraft.   We're going to use three aircraft for this example, so we need to add two more aircraft.

4. Next, copy the entire entry you just made and paste it below the original. You should now have two entries.
AC#1,161,"Douglas DC-3 Paint2"
AC#1,161,"Douglas DC-3 Paint2"

5. Change the AC# on the second line to 2, and leave the cruise speed at 161. Go to the A/C cfg file for the DC-3 and find the title line for World Travel Airlines. Copy the title line, and paste it in AC#2, replacing the existing title line. When completed the file should look like the lines below.
AC#1,161,"Douglas DC-3 Paint2"
AC#2,161,"Douglas DC-3"

Now we need to add the Cub.

6.Find the folder for it in the FS9 aircraft folder, and open the A/C cfg file. Youíll see that the cruise speed for it is listed as 63, and the title= line is "Piper Cub" Thereís only one texture. (fltsim.#)

7. Insert the necessary information as the third line of text in the Aircraft_xxxx.txt file, so that it looks like the one below.
AC#1,161,"Douglas DC-3 Paint2"
AC#2,161,"Douglas DC-3"
AC#3,63,"Piper Cub"

This completes the Aircraft_xxxx.txt file. Remember to save the file and place it in the traffic folder on your desktop.


For this exercise it would be preferable to use airports with existing AI, that are relatively close to each other. 
Another method of performing the step below would be to run the CollectAirports utility that came with TrafficTools, and cut and past the airports coordinates from the resulting file.

Next you'll need to select the airports you want to include in this AI scheme.  Choose three airports.

Open the AFCAD program and open the first A/P on your list.  Select file>open airport.  In the Open Airport window, be sure the "From All Scenery" radio button is selected and enter the complete airport code (donít abbreviate), or you can select the name from the list on the left. The airport will then open in the bottom window. In most cases, only the "stock" airport will appear, however, if the airport has already been modified with the AFCAD program you may see additional airports of the same name ("Mod") with a different layer number.  

Example: My airport has already been modified with AFCAD, so two instances of Norwood Meml appear. Another reason you may see two airports is because often times scenery designers will include an AFCAD in their addon scenery, and they sometimes will bundle it in the scenery subfolder of their scenery.

Unless you are using a modified version of the airport, open the default. Double click on an empty area of the open airport, and that will bring up the Airport Properties window. In it you will find the latitude, longitude and elevation.

In the Airports_xxxx.txt file you will enter:

1. Full A/P code
Iím using KOWD. Substitute this with the A/P of your choosing

2. Latitude
I suggest you copy & paste this

3. Longitude
Again, I suggest copying and pasting

4. Field Elevation

The resulting file should look like the one below
KOWD,N42* 11.44',W71* 10.38',49

Note that each component is separated by commas without spaces

In this exercise weíre using three different airports so repeat the above process for two additional airports located close to one another.  Iíll be using KHYA and KMVY. The resulting file should resemble the one below:
KOWD,N42* 11.44',W71* 10.38',49
KHYA,N41* 40.16',W70* 16.82',52
KMVY,N41* 23.58',W70* 36.86',66

This completes the Airports_xxxx.txt file. Remember to save the file,  and place it back in your traffic folder.  Pretty easy so far, hugh? Now on to the Flightplans_xxxx.txt file.


Where you see the airports Iíve referenced, (KOWD, KHYA, KMVY) replace them with the airports youíve selected in your Airports_xxxx.txt file. Each plan has only one leg to keep things simple.

The flight plan below is a simple, one leg plan. Lets break it down.  AC#1 Refers to the A/C of the same # in the Aircraft_xxxx.txt file.   N1382 The A/Cís tail #.   80% Indicates that the A/C will appear if the traffic slider in the sim is at 80% or above.  4Hr The repeat time is every 4hrs, which means the AI cycle starts at midnight every day and repeats itself every 4Hrs.  VFR Self explanatory ;).  12:00,, The DC-3 departs KOWD at 12:00Z. Arrival at KHYA (,,) will be determined automatically by TT when we compile the Traffic_XXXX.bgl.  14:00,, It departs KHYA at 14:00, and arrives back at KOWD? (time to be determined automatically by TTís when we compile (,,))  025 Cruising altitude is 2,500í.  R ATC will use the tail # instead of a flight #.  0000 A flight #, if used, would go here.  KHYA The 1st (and only in this case) destination A/P.  KOWD The first departure, and final destination A/P.   FP's can have many departure airports (legs)

  • AC#1,N1382,80%,4Hr,VFR,12:00,,025,R,0000,KHYA,14:00,,025,R,0000,KOWD

    Letís do another with the Cub practicing touch & go's (TNG).
  • AC#3,NP643,50%,4HR,VFR,12:01,TNG12:30,010,R,0000,KOWD,13:30,TNG14:00,010,R,0000,KOWD

    Letís add one more before we put it all together. Weíll list the third and final A/C in the Aircraft_xxxx.txt file.
  • AC#2,N6273,55%,4HR,IFR,12:02,,025,R,0000,KMVY,13:00,,025,R,0000,KOWD

    All three flight plans above may be copied and pasted into your Flightplans_xxxx.txt file and compiled into a Traffic_xxxx.bgl using TrafficTools. Or, if you'd prefer to use your own airports, simply replace my A/P codes with your own, making sure theyíre the same in the Airports_xxxx.txt file.  Remember to list the field the plane departs from last. 

    Again, I suggest you read the TrafficTools help files, the  "Source Files and Formats" section, item 21, for important information regarding flight plans.


    Important points worth repeating:
    -The aircraft and airports in the Flightplans_xxxx.txt file must match the ones used in the Aircraft_xxxx.txt and Airports_xxxx.txt file.
    -The A/P that an AI departs from first is always listed last in a FP.



    Now that the three source files are completed, itís time to compile them using TrafficTools. But first we need to tell TTís where to find your installation of flight sim, where to get the source files, and where to place the traffic.bgl.

    1. Open TTís and click File>Locate Flight Simulator, and select your path to FS9.
    2. Click File>Select FS2004 Traffic Folder, to select the default location of traffic files.
    3. Click File>User Defined Source Folder, to check that option. Then navigate to the folder with the three source files you just created.
    4. Select the Flightplans_xxxx.txt in the left window. All three files will then be selected.
    5. Press the "Compile" button in the center of the TTís window, you will see the resulting Traffic_xxxx.bgl information in the right window, and the flight plan information in the bottom window, assuming youíve done everything correctly.
    Errors in the txt files will be highlighted in red. Note the path to the source files, and Traffic.bgl in Flight Sim are located directly below their respective windows.


    TrafficTools Main Screen


    Congratulations! Youíve just created your first AI traffic file. Letís see how you did. Close the sim and reopen for the changes to take affect.  Go to the departing A/P, set the time for 12:00Z, (right hand time window in the sim) and see if the two DC-3ís and the Cub are parked at that airport.   If they are, youíre done! Tune the radio, listen and watch.

    If theyíre not, however, you may need to add parking spaces at the A/Pís you selected for this traffic file. This is why I recommended using A/Pís that have existing AI at the beginning of this exercise. You can change the airports to those that are known to have AI, or you can simply add parking, as outlined in the next section.

    Changing them requires you change both Flightplans_xxxx.txt, and Airports_xxxx.txt, and recompile them.  But as you've just seen, this is a very simple task!




    Adding Parking with AFCAD
    Lack of parking is a common occurrence when building AI traffic files.  See my comments below.  Letís assume that youíve completed everything properly up to this point, and youíre AI just arenít showing up. Itís a pretty good bet that there arenít enough parking spaces, they're the wrong type parking spaces, (as determined by the aircraft.cfg file), the wrong size spaces, or there are no spaces at all at the A/Pís youíve selected. To be sure, however, you might want to review the previous steps before proceeding.

    More on AFCAD

    Parking types and sizes (radius) are crucial to the operation of your AI.  There are rules/conditions that govern when and why an AI parks where it does.  You may build a perfectly good traffic file, but if that AI doesn't have a parking space of the proper type and size, it's not going to show up and you may end up wondering what you did wrong in the flightplan for hours, possibly days!  This can be avoided by  reading those two sections of the AFCAD help files.  That said, if you're simply trying to place a few of your favorite 747's at a good sized commercial A/P (LAX, JFK, BOS and many, many others)  you're less apt to have a problem with parking.  If, however, you're adding even a few AI at a small GA A/P, that might not be the case.  I've found that it's best to always add parking at the smaller GA A/P's.  You may even want to consider placing a couple of oversized spaces (or more)  before doing the FP's to completely eliminate the chances of a no-show AI due to inadequate parking.  Personally, I do GA exclusively and I add a space for every AI plane I add to an A/P.  I do it before writing any FP's.  AFCAD is a major consideration when building AI.


    1. Start the sim and get into windowed mode. (Press Alt+Enter). Get into slew mode (Y). Go to the first airport listed in the Airports_xxxx.txt file and minimize the sim. I also find it convenient at this point to be in top down view. (Ctrl+S)

    2. Open the AFCAD program to the first A/P listed in your Airports_xxxx.txt file.  At or near an existing parking space is a good place to be, if one is available.  Use Alt+Tab, or click the task bar icons on the bottom of the screen to switch between the two programs.

    3. With the sim and AFCAD opened to the same A/P, switch to AFCAD and click the lock icon on the toolbar. This will put AFCAD and the sim in synch. AFCAD now "overlays" the sim, so when you slew around in the sim, the red cross hairs from the sim are visible in the AFCAD program.  (try it out, switching between the two programs to see where you are in each program) 


    AI Lock AFCAD to Sim

    4. In the AFCAD programs tool bar on the far left youíll see a text box containing a drop down arrow which shows the various types of parking spaces available. Press the drop down arrow and select Ramp GA Large.


    AI Parking Type


    5. Switch to the sim and locate a desirable location for three parking spaces.  Slew to the first location and press the letter o.  This places a parking spot in AFCAD, exactly where your A/C is in the sim.  Switch to AFCAD to view it.

    6. Place one more Ramp GA Large, and one Ramp GA Small parking space at the locations you've selected.
    Note: To rotate the space, select the space by clicking on it.  A small dot appears at the front of the space.  To rotate it to the heading you desire, click and drag the small dot.

    Youíve placed three new parking spaces. Now we need to connect them to the taxiway system (if it has one) so the AI will recognize and use the new spaces. (ATC will also recognize them).  Note: Not all A/P's in FS9 are "AI ready."  If you do not see any existing parking spaces at an A/P it might not be set up to accept AI.  You might need to add runways or taxiways by reading those sections in the AFCAD help files.

    There are two items on the AFCAD toolbar that youíll need to take note of. The Apron Link, and the Normal Node. The Apron Link is the green line with a small blue dot on either end, and the Normal Node is the larger blue dot without a line.


    AI Apron Link          AI Node


    To connect the newly created parking spaces to the taxiway system, switch to AFCAD:
    7. Select the Apron Link icon.  Place the curser in the center of the parking spot, click and drag to begin laying an apron link system.  When you release the mouse button, you will see a section of the apron link that resembles the picture below.  Note that releasing the mouse ends a section of the link and automatically inserts a normal node.  This is also how you would "steer" apron links around corners, to the nearest taxiway.  Continue on, connecting all three parking spaces to the nearest taxiway. (blue line)  Hint: You can sometimes run three lines into one, and then connect a single apron link to the taxiway.

    AI Parking Space

    8. Click Tools>Fault Finder>Select every option>Find Faults. If the fault finder finds any errors, you will receive a visual display so you can easily identify where the error is and correct it.  This would be where reading the help files really comes in handy!
    9. Save the file. Accept the default name and location AFCAD gives you.

    You're done! Close the sim and restart for the changes to take affect.
    Move to the departing airport in the sim, set the time for 12:00Z, and watch the show.

    If you found this tutorial helpful, buy me a cup of coffee...donate a buck...one dollar!




    Home | About | Links

    hit counter script