FS2004 AI Aircraft


Real AI Traffic! Not an Orbit in sight

FS2004 AI Traffic

One of the highlights of FS2002 was the introduction of AI traffic. It was a superb addition too - a quantum jump from previous attempts such as FSTraffic in FS98/FS2000. Aircraft no longer flew down the ILS and then disappeared - they land, taxy in, taxy out, talk to ATC and, most cleverly of all, they all interact between each other and with your aircraft. The AI aircraft follow set routes and times - but if you happen to turn up and break the flow it will result in a different pattern of aircraft movements. It's all very clever and it's thoroughly enjoyable.

The next best thing to happen was the decode of the AI traffic file. The data contained in this is easily understood and highly adaptable. This page will explain the way the traffic file works, how you can change it and some of the pitfalls to be aware of.

The Sword is mightier than the Pen

In this case it is Lee Swordy we pay tribute to for his simple but stunningly effective TrafficTools program. It's simplicity is in the fact that it just decompiles the traffic.bgl in FS2004. It's strength is that the resultant text files can be amended very easily and then recompiled back into FS2004. Let us look further into the files that TTools creates.

When you run the Decompiler program it automatically finds FS2004 on your system, grabs the traffic.bgl file, shakes the goodness out of it and presents you with three files for you to enjoy at your pleasure. These files are:



We need to understand how at all these files work to get the best out of your system - but you can already see how neat the AI system is. All it is doing is operating pre set flight plans from the flightplans.txt file using the aircraft and airports listed in the other two text files. Let us look at these in a little more detail.


Airports File

At the moment the airports.txt file is the one I have not dabbled with at all. That is not to say it can be ignored but it is best to put it to one side for the present. It's real use will come later when scenery designers find out how to add/amend the parking gates at airports.

Each airport in this file has a simple entry:

EGNX,N52* 50.15',W1* 19.67',305

There are only three components - ICAO code, Lat and Long, Elevation.

The first thing you notice about the file is that it only contains 1842 airfields out of the 22,000 in FS2004. Why the limitation? In a word - Parking. The airfields in this list are the only ones that have designated Parking or Gate points. This area is a little complex and it is the subject of a separate web page FS2004 Gates so I won't repeat the information here. Suffice to say that FS2004 airports that have gates also have the runways and taxiways coded for AI taxying. The 19,000 odd airports without gates can't handle AI traffic - period. The only answer in this case is to get a copy of Lee's outstanding program No.2 called AFCAD which will allow you to build your own - as many people have already done.


Aircraft file

A fascinating little file this - and one that you can get your teeth into. The original file contains a list of the default FS aircraft that are assigned to AI flight plans. Note that I don't say ALL FS aircraft - there are some missing. The original list gives:

AC#1,200,"Beech Baron 58"
AC#2,315,"Beech King Air 350"
AC#3,430,"Boeing 737-400"
AC#4,430,"Boeing 737-400 Paint1"
AC#5,430,"Boeing 737-400 Paint2"
AC#6,491,"Boeing 747-400"
AC#7,491,"Boeing 747-400 Paint1"
AC#8,491,"Boeing 747-400 Paint2"
AC#9,482,"Boeing 777-300"
AC#10,482,"Boeing 777-300 Paint1"
AC#11,482,"Boeing 777-300 Paint2"
AC#12,143,"Cessna 208 Caravan Amphibian"
AC#13,143,"Cessna 208 Caravan Amphibian Paint1"
AC#14,143,"Cessna 208 Caravan Amphibian Paint2"
AC#15,175,"Cessna Grand Caravan"
AC#16,175,"Cessna Grand Caravan Paint1"
AC#17,175,"Cessna Grand Caravan Paint2"
AC#18,129,"Cessna Skyhawk 172SP"
AC#19,129,"Cessna Skyhawk 172SP Paint1"
AC#20,129,"Cessna Skyhawk 172SP Paint2"
AC#21,156,"Cessna Skylane 182R RG"
AC#22,140,"Cessna Skylane 182S"
AC#23,140,"Cessna Skylane 182S Paint1"
AC#24,140,"Cessna Skylane 182S Paint2"
AC#25,140,"Cessna Skylane 182S Paint3"
AC#26,464,"Learjet 45"
AC#27,195,"Mooney Bravo"
AC#28,265,"De Havilland Dash 8-100"
AC#29,265,"De Havilland Dash 8-100 Paint1"
AC#30,265,"De Havilland Dash 8-100 Paint2"
AC#31,437,"McDonnell-Douglas/Boeing MD-83"
AC#32,437,"McDonnell-Douglas/Boeing MD-83 Paint1"
AC#33,437,"McDonnell-Douglas/Boeing MD-83 Paint2"
AC#34,124,"Piper Cherokee 180"
AC#35,124,"Piper Cherokee 180 Paint1"
AC#36,124,"Piper Cherokee 180 Paint2"

If you check this list against all the FS default aircraft you will see that the IFR variants for the C172, C182 and Mooney are missing. This is understandable as these variants use identical textures to one of the standard models. This AI list gives us 36 different aircraft flying around the skies - but only 13 distinct aircraft types. You can alter this situation very easily by adding any new aircraft you have acquired to the list - I have about 90 aircraft on my revised listing and I am sure it will grow..

There are just three elements to each line of the aircraft.txt file.

Element 1 - AC#

AC# is a specific ID number for each AI aircraft. This is incremental so any new aircraft you add should start at AC#37 upwards. The list need not be sequential and that you can have gaps in the numbers.

Element 2 - Speed

This is the cruising speed for the aircraft in knots. It need not be an exact figure but it should be a sensible one for the aircraft.

Element 3 - Title

This is the designated Title for the aircraft - as found in the aircraft.cfg file in the [FLTSIM] section. Please remember this!

There is a very strong relationship between the FS AI traffic, ATC and the aircraft.cfg file for each aircraft, particularly the lines;


Again, this is delving into deeper waters and I have written a separate page FS2004 Aircraft Configuration (aircraft.cfg) File on the subject.

Very early on I had decided that the default titles were rather naff and I had renamed a lot of my FS aircraft names. Out had gone "Cessna Skylane 182S Paint1" in favour of "Cessna Skylane 182S Green". Bad move - it stopped those aircraft appearing as AI traffic until I twigged. So, if you do change any aircraft title in the aircraft.cfg file remember to alter the AI aircraft.txt file to match!


How do I get my new aircraft to appear as AI traffic?

Before we move onto the flightplans.txt file proper a quick word about options here. Adding your new aircraft onto the list above won't automatically see them appear as AI traffic - all you've done is put them on the register for reference. They won't appear in the skies until a flight plan has been created for them. There is one instant fix for this if you are in a hurry.

The list above contains, as I said, a lot of duplicates - only 13 specific aircraft produce the 36 variations. You can replace any of these by changing the title to that of an add-on aircraft. For instance, I replaced the "Cessna Skylane C182S Paint3" with "Piper PA24 Comanche". This works fine - with one word of caution. Replace any default aircraft with one of very similar speed - or faster. Don't replace it with a slower aircraft.

I used this method very successfully until recently and it was nice to see much more variety of aircraft flying around the skies instead of dozens of Caravans! I only stopped doing this because I ran out of Paint slots - so to speak - and decided that it was time I did things properly. This meant turning to the next file - which is rather a good point to move on.


Flightplans.txt file

The heart of the matter! So simple and yet very powerful.

MS have supplied a total of 23115 existing flight plans for their AI traffic. Sounds a lot but if you divide that evenly amongst the 1842 AI airports it only works out at 12.5 flights per airport. Neither is the spread even - it is loaded much like real world operations with the big airports taking the bigger share. For some reason it is Atlanta that hits the top of the brigade with 112 movements. Heathrow isn't far behind with 88. Down at the bottom comes Pago Pago, Port Salines and Takushima with just one flight each.

The flight plans work very simply. The aircraft starts up, gets an ATC clearance and takes off. It then flies a direct track to it's destination and, after ATC vectoring, lands and taxies to the assigned gate. Note the interaction between the AI bit and ATC - the AI flights aren't cast in stone and are very much subject to variation from the ATC engine and from your own presence in the airspace.

Now let us look at the first few flightplans in the text file. Note that all the default FS plans are return flights, A to B and back to A again.


These first five flights are typical of the default AI flights - but the format is not rigid. You can, if you wish, make each aircraft fly up to 100 sectors in the one line (they'd have to be very quick flights!).

Each of the above lines has 16 parameters - let's break down the first five on the list:

AC#24, N8552, 87%, 12Hr, IFR, 01:53:50, 06:31:02, 100, F, 7770, CYKZ, 07:53:44, 12:30:57, 090, F, 7771, CYHZ


This is the aircraft selected to fly this route. Look it up in the table above and you'll see it's the "Cessna Skylane C182S Paint 2".


This is the tail number (aka registration) of the aircraft for this flight. A clever touch by MS here if you think about it. If the AI aircraft used the tail number in the aircraft.cfg file then there would be a heck of a lot of identical registrations flying around - an ATC nightmare. This method ensures that there is a more random pattern in AI callsigns. The tail number in the aircraft.cfg file is therefore only used when you fly that aircraft in FS.

87% - Traffic percentage

This tells FS when to load an individual flight plan - this is determined by the slider you set in the ATC menu for Traffic Density. Only when you set the slider to 100% will you get every flight plan on this list available in FS.

12Hr - Repeat frequency

Careful with this. You can set this value to 1, 2, 4, 6, 8, 12 or 24hrs. With 24HR set the flight will repeat once every day. Any other value will make a second flight start at that time interval after the first one. In other words if the first flight set to start at 0800 and you had a value of 6 here then the aircraft would start a second, identical flight at 1400.

If you set this value to less than the aircraft's round trip time it probably won't run again.


A choice here that determines how ATC will handle the flight.

Now we start on the data for the actual route. This bit is a little confusing because the airport of departure is missing. Because the route line always ends with the airport of landing you have to go to the very end of the line to find out where you are starting from! In this case it is CYHZ which is Halifax in Nova Scotia (of course you knew that anyway didn't you?).

To carry on..

AC#24, N8552, 87%, 12Hr, IFR, 01:53:50, 06:31:02, 100, F, 7554, CYKZ, 07:53:44, 12:30:57, 090, F, 7555, CYHZ


In this case 01:53:50 which is rather precise, and a bit early in the morning - or is it? All the time fields are UTC, not local time..


Here the time of 06:31:02 is the computed time of arrival at the destination. Now don't expect the AI traffic to be totally robot like and fly exactly to these times - I can assure you they don't. The aircraft can depart anything up to 15 minutes after the nominal ETD and the en route time is also affected by ATC. The result is a slightly different traffic flow every time you run the sim.

Flight Level

In this case FL100 (10,000ft) which is correct (Even levels Westbound, Odd levels Eastbound)

F or R

Flight Number or Registration. If you choose R the aircraft will call itself N8552. If F is used the aircraft will call itself by the airline specified in the aircraft.cfg file under the line ATC_AIRLINE if there is one - if not it will default to the aircraft registration. The Cessna does not have an airline listed in it's cfg file - but if this plan had used AC#4 (Boeing 737-400 Paint 1) then the airline listed for this 737 variant is Landmark and this would have been the callsign.

Flight Number

Again, if F is used to specify a Flight Number and the aircraft is recognised as having an associated airline then this will be the flight number. If we use AC#4 again the full callsign for this flight would be Landmark 7554. The flight number specified in each aircraft.cfg file is for when you fly the aircraft.

Destination airport

Here it is CYKZ which we all know is Toronto Buttonville.

So, to recap. This plan sends C182, callsign N8552 from Halifax to Toronto starting at 01:53 UTC. It flies IFR at FL100 and gets to Toronto around 06:31 depending upon ATC <g>. If we continue reading this line we will see that the aircraft leaves Toronto again at 07:53 flying IFR at FL090 back to Halifax. It lands back there at 12:31. At 13:53 it begins the flight again - the plan having a 12Hr repeat.


Going solo

So now we have the basic rules for flight plans - and we can go on to write our own. One such flight might be:


In this case I have created a flight plan on my system for a Cherokee Warrior called G-BATG from Belfast to Birmingham and return. It leaves Belfast at 10:00 climbing to 5000ft VFR and it departs from Birmingham later on at 14:00 back to Belfast, also VFR but at 6000ft. The aircraft will also leave Belfast again at 1800 and repeat the flight. This flight plan uses an aircraft registration of GBATG so, although flight numbers have been added to the line (5432 and 5433) they will not be used. Finally, the plan will only operate if you have the ATC slider greater than 52%

There is one nice bit about creating your own flight plans - you don't have to work out the en route times! Do as above and leaves the fields as zeroes - the time gets calculated automatically when the program compiles the flights.

Building you own flight plans

As in the example above you can add to the list of default plans quite easily. Before you do a few pointers on potential pitfalls.

Don't create a plan to an airfield that is not in the airports.txt file. Obvious but enthusiasm might run away with you!

Have the aircraft.txt file handy so you can rapidly look up the AC# numbers of the aircraft you wish to use.

Don't put a registration in a flight plan that already exists in any of your aircraft.cfg files. If you do you could end up flying this aircraft in an area with an AI aircraft using the same callsign!

You can have more than two flights on each input line. You can send an aircraft from Lydd to Jersey to Exeter to Gatwick if you wish.

If you create a flight plan for a short flight - say from Birmingham to East Midlands or Coventry DO NOT assign a 24Hr period for it. This can cause problems so I'll explain this a bit further.


Where has all my traffic gone?

You have created lots of new flight plans, compiled these and eagerly started FS to see the new flights operate. You find nothing on the ramp apart from the same old Caravans (they get everywhere don't they?) but no BA Tridents or Tiger Moths. As you look around you hear G-ANTE call on final (so your flight plans DO work!) and slew round to spot him. Sure enough it appears on final, lands - and disappears... Why? Because all your gates are full with aircraft and there's no room left for your additional flights.

This is a bad problem in FS because they have given a lot of airports far too few gates for aircraft to park at. Additionally, all the gates are specific sizes (have a look at them in FSNav and you'll see their designations). At Ronaldsway only two gates are classified as Ramp GA (Large) - which means that only two airliners can park at the airport. All the other gates are too small.

You can get round this. Either increase the gate options (outside the scope of this article - see my Gate Page for this) or trim your traffic. Let us refresh what was said about adding aircraft in the flightplans.txt file - and my comment on line 6 above..

FS AI aircraft don't disappear after they have completed any of the routes in the flightplans.txt file. They sit on the ground until next called upon to fly - and block a parking slot up. If you create a plan for that flight from Birmingham to Coventry, with a 24Hr repeat cycle, that aircraft is going to be flying for maybe an hour at the most - and sitting on the ground for around 22hrs! Kiss one gate goodbye!

Going back to my Belfast flight..


Here the aircraft leaves Belfast at 1000 UTC and it will take about 1 hour 50 min to get to Birmingham. It will sit on the ground there until 1400 - over two hours - and then fly back to Belfast, landing about 1550. The aircraft will therefore block a stand at Birmingham for two hours and a stand at Belfast for just over two hours (because the flight repeats every 8Hrs and will depart Belfast again at 1800). It's not too bad - could be a little bit trimmer by bringing the ETD from Birmingham back to 1300 and choosing the 6Hr repeat. But you see the point - keep aircraft in the air as much as you can, not on the ground. This is why you see such early departure times in the default plans and low repeat frequencies - the aircraft are flying almost all the time.

Taking heed of this will ensure that your airport isn't clogged up with aircraft sitting idle for long periods. Additionally you can also scan through the flightplans.txt file for other flights operating from your airport and cut these down if you want (or, better still, change the airport to another). I suggest you open the flightplans.txt file with Excel to do this as you can sort the flights very quickly into airport order. Tweaking is then a doddle. Save the resultant data as a CSV file to retain the format.


Adding Airline Schedules

This is another growing hobby on the FS sites and it is also a very quick way of turning the AI traffic from mythical to reality. In most cases files are available for a particular airline's operations. All you do is cut the data and paste it into the flightplans.txt file. There is one thing you must do first though - change the aircraft codes. Everyone's aircraft listing is unique so the creators of these lists won't know what you have on your system. Most will tell you the codes they have used in their listing and which aircraft it is supposed to represent. IF they have AC#88 assigned to "Boeing 737-300 KLM" all you do is look for the KLM aircraft on your system and replace the AC# code with your one.

Don't worry if you don't have the exact aircraft - you can substitute another. I have all the EasyJet flightplans on my system but no EasyJet 737. For now I've assigned these plans to the Lufthansa 737 until a decent EasyJet aircraft turns up. When it does it will be a quick job to swap the codes to the new aircraft.

Beware of files that offer flights from a specific airport rather than airlines. If you find a file that gives all flights from say Bristol it will work - until you grab a file with all flights from say Manchester. There's going to be some duplication. Airline files are the safest to opt for.

Finally, take a close look at any airline files you get before you import them into your flightplans.txt file - some are good, some not so good. They should all assign an aircraft to fly all its routes for the day on just one line. If each return flight is entered on a separate line you end up with each aircraft making one flight daily and then sitting around for the rest of the day blocking your valuable stands.

This is a good example of a well written AI traffic file as this aircraft will fly six Paris to London sectors and hardly be on the ground at all. This is a single line entry which I have had to break up for this illustration:


and the example below is a bad file! Each aircraft flies about three hours a day and then sits on a stand for the remaining 21 hours.


In the case above there were 112 separate flights with 24Hr intervals. 112 aircraft sitting around most of the day. I reworked this file and eventually got it down to 33 individual aircraft to fly all 112 sectors. It's really not worth the hassle though - if you find any like this I'd recommend you pass them by.