
            Dynamix's ACES OF THE PACIFIC Data File Structures

                    Data decoded, collected, and written
                       by Tim Kilgore (CIS:72760,1022)

                         Revision 1.06, 06-12-03


The following information is, to the best of my knowledge, accurate.  If you
have any info about other file structres that you'd like to share, I'll be
glad to include it in this document.  Please contact me on CIS at the
FSForum.

NOTE: This document is NOT formatted for printing.  Be sure to add page breaks
where ever you want them prior to printing.

-------------------------------------------------------------------------------

HISTSN_0.DAT, HISTSN_1.DAT  (Historic mission selection descriptions)
HISTBF_0.DAT, HISTBF_1.DAT  (Briefings)
HISTOV_0.DAT, HISTOV_1.DAT  (Historic overview)
    Purpose: Historic Mission Descriptions
    Layout:
        Byte 1-4  Total number of bytes in records section (no header or array)
        Byte 5-6  Number of records
        OFFSET START ARRAY(Number of records * 4)
            4-byte offset start, read from offset until a null is encountered
            Note: offset 0 is referenced as : (records * 4) + 6
        Variable length null-terminated strings follow to EOF

        NOTE: Mission date appears to be extracted from the MISSx.DAT file
              (Confirmed 06-09-93)

-------------------------------------------------------------------------------

ROSTER.DAT Structure Information -
2  <Header Size (number of active records)
122  <Record Size
ASCII   <Data Type
    1 , c , Name                                 Width:  15         
   16 , c , Unused                               Width:  1          
   17 , c , Comment                              Width:  15         
   32 , c , Unused                               Width:  1          
   33 , t , Roster Position                      Width:  1          
   34 , t , Jap/American                         Width:  1          
   35 , t , Service & Branch                     Width:  1          
   36 , t , Rank                                 Width:  1          
   37 , t , Pilot status                         Width:  1          
   38 , c , Unknown                              Width:  2          
   40 , l , DS 1900 - Start date                 Width:  2          
   42 , c , Unknown                              Width:  2          
   44 , l , DS 1900 - Date NOW                   Width:  2          
   46 , c , Unknown                              Width:  3          
   49 , i , Total Missions                       Width:  2          
   51 , i , Successful missions                  Width:  2          
   53 , i , Campaigns completed                  Width:  2          
   55 , t , Plane Type                           Width:  1          
   56 , c , Unknown                              Width:  1          
   57 , t , Duty station (name)                  Width:  1          
   58 , c , Unknown                              Width:  1          
   59 , t , Squadron                             Width:  1          
   60 , c , Unknown                              Width:  1          
   61 , t , Starting location???                 Width:  1          
   62 , c , Unknown                              Width:  4          
   66 , t , AMedal Purple Heart                  Width:  1          
   67 , t , AMedal ???                           Width:  1          
   68 , t , AMedal DF Cross                      Width:  1          
   69 , t , AMedal ???                           Width:  1          
   70 , t , AMedal Silver Star                   Width:  1          
   71 , t , AMedal ???                           Width:  1          
   72 , t , AMedal ???                           Width:  1          
   73 , t , AMedal ???                           Width:  1          
   74 , t , AMedal ???                           Width:  1          
   75 , t , American Medal CMH                   Width:  1          
   76 , t , American Medal ???                   Width:  1          
   77 , t , JMedal 1                             Width:  1          
   78 , t , JMedal 2                             Width:  1          
   79 , t , JMedal 3                             Width:  1          
   80 , t , JMedal 4                             Width:  1          
   81 , t , JMedal 5                             Width:  1          
   82 , t , Unknown                              Width:  20         
  102 , l , Score                                Width:  2          
  104 , c , Unknown                              Width:  4          
  108 , i , Air Victories                        Width:  2          
  110 , i , Ships sunk                           Width:  2          
  112 , c , Unknown                              Width:  11         

-------------------------------------------------------------------------------

SCRIPT.DAT, MISSx.DAT
    Purpose: Mission control file, holds plane, ship, and pilot references
             as well as locations of said items.  Also hold planes per flight,
             a mission type identifier (career, historic, single mission),
             weapon load-outs, and location/altitude info for each waypoint.
             Understanding this file is the key to creating a true mission
             designer.

    Layout: (partial, but getting more and more complete all the time)
        Byte 001-002  Unknown (always seems to be a 04 00)
        Byte 003-008  Unknown
        Byte 009      Map used, where -
                           01 = Japan
                           02 = Formosa, Northern Philippines
                           03 = Western New Guinea, South Philippines
                           04 = Marianas and Caroline Islands
                           05 = New Guinea, New Britian, New Ireland
                           06 = Solomons, New Britian, New Ireland
                           07 = Marshall and Gilbert Islands
                           08 = Marcus and Wake Islands
                           09 = Hawaii
                           0A = Midway
                           0B = Japan (WWII:1946! addition, I think)
        Byte 010      Unknown
        Byte 011      Cloud cover, where -
                           00 = Clear
                           01 = Light cloud cover
                           02 = Cloudy
                           03 = Overcast
        Byte 012-018  Unknown
        Byte 019-020  Days since 1900 (date info, matches pilot record)
        Byte 021-096  Ground/ship target data (?)
        Byte 097-098  Unknown (always seems to be a 07 00)
        Byte 099-100  The number of 14 byte records to follow
        Byte 101-???  Array of 14 byte waypoint record(s)  (see below for
                      details)

        Random positioning from this point on due to the variable number of
        records above.  Proceeding from the end of the 14 byte records we
        have:

        Word          Unknown, always seems to be 01 00
        Word          The number of planes involved
        PlaneRec * Number of planes (22 bytes per plane record)

        Unknown from this point on except that the waypoint text is immediately
        proceeded by a word telling the length of the text used.

-------------------------------------------------------------------------------

WAYPOINT DATA from SCRIPT.DAT/MISSx.DAT

Here is extracted data from a SCRIPT.DAT file.  These are the 14 byte records
mentioned in the description of SCRIPT.DAT and I've included an example in
case any one has suggestions about the ?? data.

Mission info -  Solo patrol, 4 flights of 4 enemy planes appear


                     WAYPT  SML X  BIG X  SML Y  BIG Y  ??  -ALT-  XX
Rec 01, offset 101 - 00 00  31 6D  66 00  7E 6A  81 FF  00  00 00  00   START
Rec 02, offset 115 - 00 01  02 E2  56 00  7E 6A  81 FF  40  9C 00  00   WP #1
Rec 03, offset 129 - 00 02  31 6D  66 00  AD F5  90 FF  40  9C 00  00   WP #2
Rec 04, offset 143 - 00 03  60 F8  75 00  7E 6A  81 FF  40  9C 00  00   WP #3
Rec 05, offset 157 - 00 04  31 6D  66 00  4F DF  71 FF  40  9C 00  00   WP #4
Rec 06, offset 171 - 00 05  02 E2  56 00  7E 6A  81 FF  40  9C 00  00   WP #5
Rec 07, offset 185 - 00 06  31 6D  66 00  7E 6A  81 FF  10  27 00  00   END

Rec 08, offset 199 - 00 FF  65 8A  62 00  E1 12  8D FF  00  FA 00  00   Group1
Rec 09, offset 213 - 00 FF  31 6D  66 00  7E 6A  81 FF  00  FA 00  00   end

Rec 10, offset 227 - 00 FF  94 15  72 00  49 4D  85 FF  00  FA 00  00   Group2
Rec 11, offset 241 - 00 FF  31 6D  66 00  7E 6A  81 FF  00  FA 00  00   end

Rec 12, offset 255 - 00 FF  FC 4F  6A 00  1A C2  75 FF  00  FA 00  00   Group3
Rec 13, offset 269 - 00 FF  31 6D  66 00  7E 6A  81 FF  00  FA 00  00   end

Rec 14, offset 283 - 00 FF  7E 74  65 00  33 AC  78 FF  00  FA 00  00   Group4
Rec 15, offset 297 - 00 FF  31 6D  66 00  7E 6A  81 FF  00  FA 00  00   end

Rec 16, offset 311 - 00 FF  31 6D  66 00  7E 6A  81 FF  00  00 00  00  Landing?


WAYPOINTS -   FF = a stationary group (landing fields (?) or enemy flight
              locations)

COORDINATES - I don't know what the rules for these coordinates are just yet,
              I just know that they work.  It probably breaks down into an
              X-Y system.

SML X/Y   -   Works as BIG X and BIG Y, but the second byte is used for things
              other than positive/negative determination.  I'd guess that the
              method is based on a normal grid -

                         Max X
                           |
                           |
                           |
                           |
                        0,0|_____________ Max Y

              Again, the scale is unknown, but enemy planes are generally
              visible with large changes in either X or Y coordinates.


BIG X/Y   -   The first byte is the unit and the second byte will be either
              a FF (negative, going left on the X axis, down on the Y axis)
              or a 00 (positive, going right on the X axis, up on the Y axis).
              I haven't determined the unit of measurement yet, but it appears
              to be several miles per increment.

              This means that larger maps are broken into four quadrants as
              shown below -

                                      0-0
                                       |
                                       |
                                 00----+-----FF   Y axis
                                       |
                                       |
                                      F-F
                                    X axis

              Note: Big X and Big Y apply only to the current campaign map
                    (to change maps, see Byte 9 in SCRIPT.DAT above).

??       -    Unknown, could be an action identifier for the waypoint (i.e.
              bomb, patrol, escort, whatever).

ALTITUDE -    is calculated in the following fashion -

                            byte1 * 64 feet
                            byte2 * 16384 feet

              What's an FA in the altitude column?  I think it means to match
              the altitude of the players flight. (Less sure of this, now.)

   NOTE: Placing a null in the first byte has unexpected results if the
         second byte is not null.  A 00 01 results in over 18,000 feet
         while a 01 01 results (as expected) in about 16,450 feet.  Go
         figure...

XX is probably a null terminator for the record and can be ignored.

What's missing?  Heading, but this could be garnered from tracing the
flight path.  Speed, but this could be based on 90% of throttle or
something like that.  There is information following the plane records
that I have not examined, but the answers may be in this section of
the file.

One extremely important piece of information that I'm missing is the
data that breaks down each flight and assigns the number of planes to
a given flight.  This is probably elsewhere in the mission file and
not in this section of the data.

Another important piece of information is a byte declaring the number of
waypoints a mission has.  It is possible to count all the non-FF waypoints
to arrive at this total, but that's a royal pain.

NOTE: From time to time AOTP generates missions in which the player's
      waypoints are NOT the first ones listed.  Do _not_ assume that the
      first record read will be the starting location for the player's
      flight.

--------------------------------------------------------------------------


EOF
