			       * AFTMAPED *

			    Map File Editor for
	     Chuck Yeager's Advanced Flight Simulator/Trainer
			    by Electronic Arts


		       COPYRIGHT (c) 1988  Bill Crow

			  Release A.00.00 4/23/88


				 Bill Crow
			     1681 Grizilo Drive
			     San Jose, CA 95124

			   CompuServe: [76703,632]
			      MCI Mail: BCROW




THE REQUISITE LEGAL STUFF

The files in this ARChive are for use with Electronic Art's "Chuck
Yeager's Advanced Flight Trainer" and "Chuck Yeager's Advanced Flight
Simulator" for PC compatibles.  Users are free to use this for any
non-commercial purpose, and distribute it to others as long as the
complete ARChive file is distributed, including this documentation.
The ARChive file may be uploaded to other non-commercial bulletin
boards, and may be distributed via public domain software libraries,
as long as no fees are charged other than a reasonable disc
duplication fee.  Any other use of the material in this ARChive file
requires the express written consent of the author.  

    THE AUTHOR MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS
    MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    PURPOSE.  THE AUTHOR SHALL NOT BE LIABLE FOR ERRORS CONTAINED
    HERIN OR FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES IN
    CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS
    MATERIAL.  


CONTRIBUTING TO THE CAUSE

This software is copyrighted by the author.  You are free to use it
for any non-commercial purpose.  There is no required registration or
license fees.  It's free!  There is also no restriction on what you do
with the new or modified mapfiles you create with this program.  

If you like AFTMAPED, and you would like to encourage me to continue
to improve this program, and work on other related tools and utilities,
you are welcome to send me a contribution of $20.00 to the address
listed above.  In return for your $20.00, I'll send you the Microsoft
QuickBASIC 4.0 source code to the latest version of AFTMAPED, laserset
documentation, and additional documentation and utilities that I have
created while working and playing with AFT.  


SUPPORT

If you have questions, comments, bug reports or enhancement requests
for AFTMAPED, leave me an electronic message on CompuServe either via
EasyPlex or in the message area of the HP Forum (GO HP).  I'll do my
best to respond to reported errors with updated versions uploaded to
CompuServe.


INTRODUCTION

Chuck Yeager's Advanced Flight Trainer (a.k.a. Chuck Yeager's Advanced
Flight Simulator) has to be one of the best pieces of entertainment
software I have ever found.  Not only is it a a tour-de-force of
graphics animation and flight dynamics simulation, its design allows
for lots of customization and expansion.  As many have discovered the
aircraft specification files (.FLY) and the race course definition
files (.RAC) are easily modifiable with a simple ASCII editor.  The
program also allows you to create your own stunts for training and
formation flying.  Also, when flying the races, your own best flights
are saved and used to control the competitive airplanes in subsequent
races.

The one thing that I wanted to be able to change, but could not, was
the scenery and obstacles available.  While AFT provides a good
variety of obstacles and scenery variations, I had my own ideas about
how I would like to arrange buildings, gates, runways, mountains and
other scenery components to create my own special environment.

All the information to control the specific scenery is contained in
the sixteen MAPxx files.  These are binary files, and not editable
with a standard ASCII editor.  However, after several hours spent with
DEBUG, I was able to decode the formats of the MAPxx files and start
creating my own scenery.  While it was possible to do so using DEBUG,
it was a slow, tedious and error-prone procedure.  So, I created
AFTMAPED, an editor to display, print and edit the contents of the AFT
MAPxx files.


THE AFT WORLD

The AFT world is 40 miles square, made up of sixteen 10x10 mile
squares.  Each of the MAPxx files corresponds to one square as
follows:

     +-----------+-----------+-----------+-----------+
     |           |           |           |           |
     |           |           |           |           |
     |   MAP21   |   MAP31   |   MAP01   |   MAP11   |
     |           |           |           |           |
     |           |           |           |           |
     +-----------+-----------+-----------+-----------+         
     |           |           |           |           |         N
     |           |           |           |           |         |
     |   MAP20   |   MAP30   |   MAP00   |   MAP10   |      W -+- E
     |           |           |           |           |         |
     |           |           |           |           |         S 
     +-----------+-----------+-----------+-----------+
     |           |           |           |           |
     |           |           |           |           |
     |   MAP23   |   MAP33   |   MAP03   |   MAP13   |
     |           |           |           |           |
     |           |           |           |           |
     +-----------+-----------+-----------+-----------+
     |           |           |           |           |
     |           |           |           |           |
     |   MAP22   |   MAP32   |   MAP02   |   MAP12   |
     |           |           |           |           |
     |           |           |           |           |
     +-----------+-----------+-----------+-----------+


The world "wraps around" in both dimensions.  If you fly off any edge,
you reappear at the same point on the opposite edge.  For example, if
you leave the home airport and fly North for forty miles, you will be
right back where you started.

The home airport (where all flights begin) is located in the lower
left corner of MAP00, near the center of the world.  Actually, the
balloon to the southwest of the airport is in the exact lower left
corner of MAP00.


INSIDE THE MAPxx FILE

Each MAPxx is 256 bytes in size.  It contains a list of up to 85
3-byte object definition records.  Each 3-byte record consists of an
object code, X coordinate and Y coordinate.  There are 31 usable
object codes, described in more detail in the tables that follow.  

The X and Y coordinates can be any integer value from 0 through 255.
(0,0) specifies the lower left (Southwest) corner of the square, and
(255,255) is almost at the upper right (Northeast) corner.  The X
value specifies the East-West longitudinal position and the Y
coordinate specifies the North-South latitudinal position.  Since the
10x10 mile square is divided into 256 steps in each direction, each
addressable step represents approximately 200 feet.  (206' 3" to be
precise.)  By the way, the spots displayed on the ground are spaced
approximately 100 feet apart (103' 1.5" for those who really care),
meaning that there are 2 spots for every addressable step.  In other
words, two objects cannot be placed any closer together than 2 spots
in either dimension.  All objects are placed on the ground (at 0'
elevation) with the exception of one of the balloons, which is fixed
at 300' elevation.


STARTING AFTMAPED

Before editing a map file, make a copy!  Whatever you do, don't edit
the files on your original AFT diskette.  Copy the files to another
diskette or to your hard disc.  I have AFT installed on a hard disc,
and before I started any editing, I made copies of all the MAPxx files
using the following MS-DOS command:

                 COPY MAP??. MAP??.SAV

Then if I ever accidentally corrupt a MAPxx file, I can copy the
corresponding MAPxx.SAV file without having to go back to the original
program diskette.

Start AFTMAPED with the following command:

           [d:][path]AFTMAPED [mapfile]

If AFTMAPED is in your current directory or in a directory specified
your current PATH, there is no need to specify the drive and path.
If you are using MS-DOS 2.x, you CANNOT specify the drive and path, so
you must place AFTMAPED in the current directory or in a directory
specified by your current PATH.

If you do not specify a mapfile as a command line argument, you will
be prompted for the file.  If the file does not exist, you will be
asked if you want to create a new file.  If for any reason AFTMAPED
cannot open the specified file, an appropriate error will be displayed
and you will be prompted for another mapfile filename.

If a mapfile is specified on the command line, AFTMAPED will
terminate, returning to the MS-DOS command prompt when you exit from
the map list.  However, if the mapfile is specified when AFTMAPED
prompts for the filename, exiting from the map list will return you to
the mapfile prompt to select another file.

If you press <Enter> without entering a filename at the mapfile
prompt, AFTMAPED will exit, returning to the MS-DOS command prompt.


THE AFTMAPED DISPLAY

The primary display for AFTMAPED is a list of mapfile records,
starting with the first twenty.  A typical display looks like this:

IDX  OBJ  DESCRIPTION                        X     Y         FILE             
  1  [30] Balloon,  Green, at 300'         [  0] [  0]   00: 01 00 00
  2   23  Mountain, Large White Pyramid      64    64    03: 1F 40 40
  3   23  Mountain, Large White Pyramid     192   192    06: 1F C0 C0
  4   23  Mountain, Large White Pyramid      64   192    09: 1F 40 C0
  5   23  Mountain, Large White Pyramid     192    64    0C: 1F C0 40
  6    3  Building, Small White               5     6    0F: 37 05 06
  7    4  Building, Large White              14     5    12: 3F 0E 05
  8    2  Building, Green Blockhouse         17     8    15: 05 11 08
  9    1  Building, Blue House w/Roof         1     4    18: 03 01 04
 10    1  Building, Blue House w/Roof         1    10    1B: 03 01 0A
 11    5  Hangar,   N/S,   Blue/White         2     4    1E: 11 02 04
 12    5  Hangar,   N/S,   Blue/White         3     4    21: 11 03 04
 13    5  Hangar,   N/S,   Blue/White         4     4    24: 11 04 04
 14    7  Wall,     N/S,   Black/White        0     7    27: 0B 00 07
 15    7  Wall,     N/S,   Black/White       18     2    2A: 0B 12 02
 16    7  Wall,     N/S,   Black/White       18     7    2D: 0B 12 07
 17    9  Runway,   N/S,   Blue/Green         1     7    30: 15 01 07
 18    9  Runway,   N/S,   Blue/Green         4     7    33: 15 04 07
 19   11  Runway,   E/W,   Blue/Green         4     4    36: 19 04 04
 20   11  Runway,   E/W,   Blue/Green         4     7    39: 19 04 07


For each record, the following information is displayed:

            IDX: The integer object index within this file.
            OBJ: The integer object code, in decimal.
    DESCRIPTION: A brief description of the scenery object.
              X: The X coordinate (longitude), in decimal.
              Y: The Y coordinate (latitude), in decimal.
           FILE: The hexidecimal offset and contents for this
                 record as it is actually stored in the mapfile.


SCENERY OBJECTS

Here is a table of the scenery objects available, and their decimal
object codes, as used in AFTMAPED.  The colors listed in the
description are based on AFT's default RGB color settings with a CGA
or EGA display.  These colors will be different when using a different
display or palette setting.  See the description of the "D" command
later in this document to instruct AFTMAPED to list alternate color
combinations.  

               OBJ
              CODE  DESCRIPTION
              ----  -----------------------------   
                1   Building, Blue House w/Roof
                2   Building, Green Blockhouse
                3   Building, Small White
                4   Building, Large White
                5   Hangar,   N/S,   Blue/White
                6   Gate,     N/S,   Blue/White
                7   Wall,     N/S,   Black/White
                8   Wall,     N/S,   Blue/White
                9   Runway,   N/S,   Blue/Green
               10   Runway,   SW/NE, Blue/Green
               11   Runway,   E/W,   Blue/Green
               12   Runway,   NW/SE, Blue/Green
               13   Runway,   N/S,   Black
               14   Runway,   SW/NE, Black
               15   Runway,   E/W,   Black
               16   Runway,   NW/SE, Black
               17   River,    N/S,   Blue/Black
               18   River,    SW/NE, Blue/Black
               19   River,    E/W,   Blue/Black
               20   River,    NW/SE, Blue/Black
               21   Lake,     Blue/Black Hexagon
               22   Mountain, Small White Pyramid
               23   Mountain, Large White Pyramid
               24   Mountain, E/W Green Wedge
               25   Field,    Blue/Green on Black
               26   Field,    Blue/Black on Green
               27   Field,    Blue/Green on White
               28   Field,    Blue/Black
               29   Field,    Blu/Grn/Blk, Raised
               30   Balloon,  Green, at 300'
               31   Balloon,  Green, on Ground


NAVIGATING IN THE AFTMAPED DISPLAY

The current record is always indicated by a highlight line, and
brackets surrounding the object code and coordinate values.  You can
change the current record, and display additional records in the file
using the following single-key commands:

        Up Arrow: Move back one record.
      Down Arrow: Move forward one record.
           Pg Up: Move back one page (20 records).
           Pg Dn: Move forward one page (20 records).
            Home: Move to the first record in the list.
             End: Move to the last record in the list.


EDITING COMMANDS

The following single-key commands are used to change the contents of
the mapfile, based on the current record selected.

       E: Edit the current record.

          You are prompted at the bottom of the display to 
          enter new decimal values for the object code and
          X and Y coordinates.  Pressing <Enter> without 
          providing a new value will leave the current value
          unchanged.

     Del: Cut the current record.

          The current record is "cut" from the list, but
          preserved in a temporary "clipboard".  It can be
          restored using the Ins key.

     Ins: Paste a new record at the current position.

          The record contained on the temporary "clipboard"
          (from a previous Cut command) is inserted at the 
          current record position, moving all subsequent
          records down one position.  If there has been no
          previous Cut command, a blank record is inserted.
          The blank record will serve as a placeholder until
          it is edited with the E command.  If blank records
          are left in the file, they will be ignored by AFT.


OTHER COMMANDS

The following single-key commands can be used any time the object list
is displayed (other than while editing the current record):

       H: HELP - Displays a brief description of all commands.

       O: OBJECT LIST - Displays a list of the different
          objects available, including the object code, hex
          file code and object description.  This is a useful
          reference, since objects must be specified by their
          object code when editing a record.

       D: DISPLAY - Changes the colors listed in the object
          descriptions based on what type of display is used when
          running AFT.  By default, the colors listed are based
          on AFT's default RGB setting with a CGA or EGA display.
          AFTMAPED can also display the descriptions based on the
          colors that are shown when running AFT using the "New
          Palette" choice from the "SYS" menu and an EGA display,
          or when connected to a monochrome display using a
          Hercules Graphics Adapter.  The display color mapping
          currently selected is indicated by the code displayed
          in brackets in the lower-right of the object list: 

                  [CGA] - "RGB" with a CGA or EGA display
                  [EGA] - "New Palette" with an EGA display
                  [MDA] - Hercules display

          NOTE: This command does not change the values stored
          in the file.  It only changes the descriptions that
          AFTMAPED shows, to more accurately reflect what is 
          displayed when running AFT.

       S: SAVE - The current map list is saved to the file.

       Q: QUIT - The current map list is saved to the file 
          and AFTMAPED prompts for a new file (if no file was
          specified on the command line) or exits.

     Esc: The current map list is discarded and AFTMAPED
          prompts for a new file (if no file was specified on
          the command line) or exits.

       P: The current map list is listed to LPT1.

       C: Temporarily suspend AFTMAPED and access the MS-DOS 
          command prompt.  This is very handy to rename the
          file you are currently editing if you want to save
          the changed version in memory without losing the 
          previous file.  Use the MS-DOS EXIT command to
          return to AFTMAPED.


ADDITIONAL TECHNICAL NOTES

While it is possible to pack the 85 objects stored in a mapfile in a
close region of the ten mile square, some care must be exersized.  The
more three dimensional objects located in a close reason, the slower
the simulator will operate.  Placing several mountains or buildings
close togther may slow operation to an unacceptable level.  Use three
dimensional objects judicially, and spread scenery objects throughout
the ten mile square.  Keep this in mind as you design your ultimate 
scenery environment!  

AFTMAPED allows you to insert and delete records while editing a file.
While editing, you can create up to 170 records -- twice the number
that can be saved.  However, when saving the file, only the first 85
records will be recorded.  If there are less than 85 records, the
remaining bytes in the file will be filled with nulls, which AFT
interprets as the end of file.


               -##-  END OF DOCUMENTATION FILE  -##-
