Flight Unlimited III high resolution terrain processing workshop

noncommercial FU3 support page - just to keep FU3 flying !

Set the AI plane parameters directly using AIModelViewer


Managing behavior of AI Planes

There are just 28 slots in FU3 to define AI Planes. No more than 28 plane types can be defined. The names of the slots are the plane names of the original LockingGlass version defined in planetyp.h. This set is hard coded in fu3.exe. The values are stored in the file aimodel.dat for each region. This make 28 plane types for each region possible. Modification to aimodel.dat was done by editing tables in a PERL script as here for the Trainer.

Cessna172 :
#                thrust      weight     max_rpm      climb     takeoff     land      stall
#                                                               dist       dist
        info       150        2300        2700        645        865        520        41

#        mode     speed        power      turn       flaps      gear     attitude
        cruise     109        75          std          0         up         0
        <10K       109        75          std          0         up         0
        C&D        109        75          std          0         up         0
        downwnd     85        50          std          0         up         0
        apch        80        30          30deg        20       down        0
        final       65        20          30deg        30       down        0
        climb       80        100         30deg        0         up         0
        takeoff     55        100         30deg        0        down        5
        tchdown     51        20          30deg        0        down        7
        accel        0        100         30deg        0        down        0
        brake        0        20          30deg        0        down        0

The tables are combined to fill missing values and minor computations are done.
Result of running the PERL script is the file aimodel.dat.
There is no 1:1 relation between the tabulation inside the PERL script and the final data in aimodel.dat.
The stall value is not stored, but just used to compute the attitude.
If you define more than 28 plane types you will not get more than 28 plane type entries in aimodel.dat.

Best way to modify AI parameters is to work directly using aimodel.dat. This file contains binary packet data and is not suitable for a texteditor. Working with hex data is very tricky but using AIModelViewer is simple and quick.

You can download AIModelViewer v3.0 288KB right here.

You are using this freeware tool at your own responsibility !

Backup your aimodel.dat file before using this tool !

All load and save operations are using a file dialog box. You can work outside of the fu3 area also.

First select the aimodel.dat to open, then you can view all values of the 28 plane types as treeview.



There are 2 main sections for each plane type:

1. the info line



2. the mode matrix.



Changes in the Info and Mode Matrix Dialog are retained by closing the window with OK. Result are then still in memory and you must save the aimodel.dat file to see the changes in FU3. You are free to choose any name for the file, but the active file in FU3 must be named aimodel.dat and the location must be inside the region folder. Export to XLS creates a file using TAB as delimiter. Open this .txt file using excel to make a nice log of your changes.

For each plane, the following information is tabulated in the info line:
 1. max thrust, given in pounds.
 2. gross weight (lbs)
 3. the engine rpms at full power
 4. the engine rpms at min. power = 0.2 * (rpms at full power)
 5. the max climb rate, in feet per minute
 6. the distance the plane takes to takeoff, (the time it's moving on the ground)
 7. the distance the plane takes to land

 caution the tabulated value for stall is not retained in aimodel.dat !

In addition, each of the following is tabulated for each plane type and each "mode":
 1. speed (knots)
 2. power, as a percentage of max power
 3. turn type
          0    halfstd for half-standard-rate turns
          1    std for standard-rate turns, 360 degrees in 2 minutes
          2    30deg for turns with 30 degrees of bank
          3    ground for ground-reference turns
 4. flaps (0, 10, 20, 30)
 5. gear status (up=0 or down=1)
 6. attitude   computed by the PERL script from -31 to +31

 if not entered in the PERL tabulation the script will compute attitude as
 attitude = 15 * (stall / speed)^2  * ( 1.5 / (1 + 0.5*flaps/30.0)) - flaps/10.0 - correction;

 rather wired, so better select a value inside the range to make a good looking plane.
 See the possible range for the attitude here applied to the Cessna 172 in the Final mode with the values +31 and -31.
 In both cases the transition to touchdown was smooth with a perfect landing - try it !.


the following modes are used:
 1. cruise:
    used for level flight over long distances.
    For the airliners, this will be flight in the stratosphere
    at speeds near that of sound.

 2. cruise below 10000ft:
    like cruise, except below 10,000 feet above sea level.
    for the jets, this is much slower than cruise.
    For other planes, it's identical or nearly so.

 3. C&D:
    used for flight in class C and D airspaces (also for B).
    the speed limit here is even slower.

 4. ground;
    used for ground-reference turns near or in the pattern

 5. downwind:
    used for the downwind leg.
    like C&D, except that the gear should be down.

 6. approach:
    used for the base leg, and for the end of the downwind leg.

 7. final:
    used for the final leg.

 8. climb:

 9. takeoff:
    where the plane is when its wheels begin to leave the ground

10. touchdown:
    where the plane is when its wheels touch the ground on landing

11. accelerate:

12. brake:

Address
The Structure of the aimodel.dat file
0x0000

        Info part:  28 blocks of 28 bytes as 7 integer values (784 bytes total)
                    part(0) thrust
                    part(1) weight
                    part(2) max_rpm
                    part(3) max_rpm * 0.2
                    part(4) climb
                    part(5) takeoff distance
                    part(6) landing distance
        
0x0310

        The second part contains the mode tabulation in compressed form
        as 12 integer at 4 bytes = 48 bytes total for each plane entry.
        One mode line is stored in 4 bytes ( X for used bits for the value )

        speed           0000 0000 0000 0000 0000 00XX XXXX XXXX
        power           0000 0000 0000 000X XXXX XX00 0000 0000
        turn            0000 0000 0000 0XX0 0000 0000 0000 0000
        flaps           0000 000X XXXX X000 0000 0000 0000 0000
        gear            0000 00X0 0000 0000 0000 0000 0000 0000
        attitude        sXXX XX00 0000 0000 0000 0000 0000 0000
                        s = sign bit for attitude

        The second part has a total of 28 * 48 = 1344 bytes
        


under construction last update 21.Jan.2005

Information: André Meystre
back to FU3 Terrain Workshop      next to MSFS to FU3 static model converter