                  Some Notes on the Structure of the file
                             SQUAD0.DAT in AoE

     The file SQUAD0.DAT is used to describe various aspects of each
     and every aircraft unit in the game. This includes NPC units
     (i.e. bomber units) as well as those units which the player can
     select to fly with. Each unit in the game is described by a
     variable length record and each of these records has within it
     data which determines its length. Although these unit records
     are not fixed-length, they are fixed-format. The data contained 
     within a record gives the following information:

        Dates of the units history - creation, disbandment, leaves
                                     from the front, etc.
        Aircraft type assigned to the unit
        Bases where unit is stationed
        Number of A/C assigned to a flight
        Flight formation
        Mission types

     TYPICAL RECORD STRUCTURE

      BYTES   FUNCTION
     =======  ===============================
      01-02   Offset address for text relating to this unit
         03   Service Nationality:
                00 = USAAF                    
                01 = RAF
                02 = Luftwaffe
         04   Unit Type:
                00 = Fighter
                01 = Light Bomber   (Ar-234 and Mosquito Units)
                02 = Medium Bomber  (Ju-88S, B-25D [RAF], and B-26 Units)
                03 = Heavy Bomber   (B-17G and B-24J Units)
         05   Unit Pilot Quality
                00 = Poor
                01 = Fair
                02 = Average
                03 = Good
                04 = Excellent
      06-07   Number (N1) of 4-byte subrecords which follow immediately
              and which describe the unit history. These 4 bytes
              are as follows:
                M1 - Month   00 = Jan, 01 = Feb, ..., 0B = Dec
                D2 - Day     01, 02, ..., 1D, 1E, 1F (31)
                Y3 - Year    2C = 1944; 2D = 1945
                     This 3-byte method of describing dates is used
                     throughout every unit record.
                S4 - Unit status beginning on the preceding date
                     00 = Active
                     01 = Away from the front (on leave, refitting, etc.)
                     02 = Ended (disbanded)
                     03 = Evacuated
                     04 = Removed from game (!)
      08-11   1st unit history subrecord (SR) desribed above
      12-15   2nd unit history SR
       ...    ...
    xx-xx+1   N1st unit history SR
   xx+2-xx+3  Number (N2) of 5-byte subrecords which describe this
              unit's aircraft assignments. The first 3 of these 5
              bytes are the date of assignment and are as for the unit
              history as described above. The 4th and 5th bytes are
              the hex code of the aircraft assigned to this unit. These
              aircraft codes are:
                
                
                00 00 = Bf-190G
                01 00 = Bf-190K
                02 00 = Fw-190A
                03 00 = Fw-190F
                04 00 = Fw-190D
                05 00 = Ju-88S  *
                06 00 = Me-262
                07 00 = Ar-234b
                08 00 = Hawker Typhoon
                09 00 = Hawker Tempest
                0A 00 = Spitfire Mk IX
                0B 00 = Spitfire Mk 14
                0C 00 = Mosquito Mk 18
                0D 00 = Mosquito Mk VI
                0E 00 = P-51D
                0F 00 = P-38J
                10 00 = P-47D
                11 00 = B-26   *
                12 00 = B-25D  *
                13 00 = B-17G  *
                14 00 = B-24J  *
                * - NPC only aircraft

   xx+4-xx+8    1st aircraft assignment SR
      ...       ...
    yy - yy+1   N2nd aircraft assignment SR

  yy+2 - yy+3   Number (N3) of 5-byte subrecords which describe the number
                of aircraft in a flight for this unit. The first three
                bytes are the date as described above and the 4th and 
                5th bytes give the number of aircraft in the flight
                beginning on the date given in this SR. 
  yy+4 - yy+8   1st "Number in flight" SR
      ...       ...
    zz - zz+4   N3rd "Number in flight" SR
  zz+5 - zz+6   Number (N4) of basic flight formation (BFF) subrecords 
                for unit. Each BFF is 5 bytes long; the first three bytes
                are the beginning date for the formation and the 4th
                and 5th bytes are the formation hex code number:
                                   
                  01 00 = Vic
                  02 00 = Line Astern
                  03 00 = Line Abreast
                  04 00 = Echelon Left
                  05 00 = Echelon Right
                  06 00 = Finger Four  (most common formation for Allies)
                  07 00 = Element (2 aircraft)
                  08 00 = Rotte, LW  (1 - 2 aircraft)
                  09 00 = Schwarm, LW  (1 - 4 aircraft)
                  0A 00 = Kette, LW  (3 aircraft)
                  0B 00 = Bomber Vee (RAF and Luftwaffe)
                  0C 00 = Heavy Bomber Combat Box (US and RAF)
                  0D 00 = Medium Bomber Combat Box (US only)

  zz+4 - zz+8     1st Unit Formation SR
  zz+9 - zz+13    2nd Unit Formation SR
      ...         ...
    ww - ww+4     N4th Unit Formation SR

  ww+5 - ww+6     Number (N5) of Airfield Assignment (AFA) subrecords
                  to follow. Each of these AFA SRs are 5 bytes long 
                  with the first three bytes giving the date of
                  assignment to the airfield designated and the



                  last 2 bytes being the hex code for the airfield
                  to which the unit is assigned. For hex codes
                  identifying the various airfields, see the
                  AEBASE.TXT which is included in this file set.

  ww+7 - ww+11    1st Unit AFA SR
 ww+12 - ww+16    2nd Unit AFA SR
      ...         ...
   vv  - vv+4     N5th Unit AFA SR

  vv+5 - vv+6     Number (N6) of Mission Assignment SRs to follow. For
                  NPC bomber units, the value of these two bytes is 
                  always 00 00. Each Mission Assignment SR is 8 bytes
                  in length. What is known about the structure of
                  the MA SR is given below:

                   BYTES   Function
                  =======  ================================
                  01 - 03  Date in the format given above
                       04  Number of times that this mission type
                           is scheduled to be performed following
                           the date above and until the next date
                  05 - 06  Mission Type hex code
                  07 - 08  Mission generation seed number ??? or
                           Mission class number
                           (00 00 = Historical mission)

                    MISSION TYPE HEX CODES
                    
                    Value  Mission type
                    =====  ========================
                    00 00  Antiship
                    01 00  Antiship, interdiction
                    02 00  Escort bombers
                    03 00  U.S. Bomber Offensive
                    04 00  Allied Tactical (Close Support or Interdiction)
                    05 00  "    " "      "
                    06 00  "    " "      "
                    07 00  U.S. 8th AF
                    08 00  U.S. 9th AF
                    09 00  Crossbow
                    0A 00  Crossbow
                    0B 00  Interdiction
                    0C 00  Armed Recon
                    0D 00  Luftwaffe in France
                    0E 00  "   "   " "" "    "
                    0F 00  "   "   " "" "    "
                    10 00  Luftwaffe Bomber Intercept missions
                    11 00  "   "   " Ground Support
                    12 00  Arado 234
                    13 00  All 
                    14 00  Fighter Sweep
                    15 00  Luftwaffe in Holland

   Since the unit records are not of the fixed-length type, finding
   the location of a particular unit can be a very tedious process.
   The table given immediately below contains a listing of all non-NPC
   units and the address for the first byte of that unit's record.
   Using that address and the format for a typical unit, any of the
   unit's subrecords can be located, albeit through a different
   tedious process.





   Unit                  Starting Address
                          DEBUG/normal
   ==================    ================
   356th FS/354th FG       0106/0006
   338th FS/55th FG        01cc/00cc
   343rd FS/55th FG        024e/014e
   487th FG/352nd FG       02e8/01e8
   328th FG/352nd FG       038a/028a
   334th FS/4th FG         044c/034c
   336th FS/4th FG         04e1/03e1
   62nd FS/56th FG         058e/048e
   61st FS/56th FG         0630/0530
   401st FS/370th FG       06ea/05ea
   374th FS/361st FG       0783/0683
   602 Sqdn.               0982/0882
   41 Sqdn.                0a05/0905
   132 Sqdn.               0ac3/09c3
   248 Sqdn.               0b83/0a83
   349 Sqdn.               0c04/0b04
   274 Sqdn.               0cc5/0bc5
   610 Sqdn.               0d76/0c76
   443 Sqdn.               0e1e/0d1e
   181 Sqdn.               0f0f/0e0f
   164 Sqdn.               0fe9/0ee9
   486 Sdqn.               10de/0fde
   305 Sqdn.               1185/1085
   333 Sqdn.               1214/1114
   613 Sqdn.               128e/118e 
   II/JG 1                 13de/12de
   III/JG 2                14ab/13ab
   I/JG 4                  1599/1499
   III/JG 7                1618/1518
   II/JG 11                16ba/15ba
   II/JG 26                1767/1667
   III/JG 26               186b/176b
   I/JG 27                 198b/188b
   III/JG 54               1a81/1981
   III/SG 4                1b59/1a59
   Kommando Nowotny        1c3e/1b3e
   JV 44                   1c99/1b99
   III/KG 76               1cff/1bff
   III/KG 54               1d72/1c72
   II/KG 77                1de5/1ce5

   I realize that some of the above may be confusing, so I am also
   including an annotated dump of the file header and the unit
   record for the 356th Fighter Squadron. Each type of SR is noted
   in the hope that these notes will clarify the above description.

   As usual I welcome any remarks or questions concerning this text.

                                                     J.W. Johnson
                                                     aka "Jaybird"
                                                     74020,1734
   


                       A DUMP OF THE AoE FILE SQUAD0.DAT
                               356th FS RECORD

     0100  3F 05 00 00 
     0100              34 00    <-- Number of records in the file
                                    (52; 51 Unit records and 1 text record)
==============================================================================
                              
                              356th FS/354th FG

     0100                    00 00  <-- Text Offset for this unit in the text 
     0100                         -00  <-- Nationality
     0100                             00  <-- Unit type
     0100                                04  <-- Pilot Quality 
     0100                                   02 00  <-- # SR, Unit History
     0100                                         03 01 2C <-- 1 Apr 44, Active
     0110  00 
     0110     04 07 2D 02  <-- 7 May 45, Disbanded
     0110                 03 00  <--  # SR, A/C type
     0110                       03-01 2C 0E 00  <-- 1 Apr 44, P-51D
     0110                                      0B 02 2C 10  <-- 2 Dec 44, P-47D
     0120  00 
     0120     00 0F 2D 0E 00  <-- 15 Jan 45, P-51D
     0120                    01 00  <-- #SR, number of A/C assigned to a flight
     0120                         -03 01 2C 04 00  <-- 1 Apr 44, 4 A/C
     0120                                   ~~    01 00  <-- # SR, Formation
     0120                                               03  <-- 1 Apr 44, Finger 4
     0130  01 2C 06 00 
     0130              04 00  <-- # SR, Bases
     0130                    03 01-2C 48 00  <-- 1 Apr 44, Lashenden
     0130                                   05 11 2C 77 00  <-- 17 Jun 44, St. Croix
     0140  08 15 2C 02 00  <-- 21 Sept 44, Amiens-Glissy                  -Sur-Mer
     0140                 0A 19 2C-75 00  <-- 25 Nov 45, Rosieres
     0140                                10 00 <-- # SR, Mission type assignments
     0140                                      03 01 2C 03
     0150  07 00 BC 02 
     0150              03 18 2C 01-1B 00 00 00 
     0150                                      03 1B 2C 04
     0160  07 00 6C 02 
     0160              04 14 2C 04-0A 00 BC 02 
     0160                                      05 03 2C 06
     0170  0C 00 BC 02 
     0170              05 11 2C 03-08 00 20 03 
     0170                                      05 1C 2C 03
     0180  0C 00 A2 03 
     0180              06 0A 2C 04-07 00 BC 02 
     0180                                      07 06 2C 04
     0190  0F 00 BC 02 
     0190              07 12 2C 05-12 00 BC 02 
     0190                                      07 1F 2C 03
     01A0  0C 00 E8 03 
     01A0              08 0F 2C 0A-07 00 BC 02 
     01A0                                      0B 0A 2C 08
     01B0  08 00 6A 04 
     01B0              0B 15 2C 08-12 00 BC 02 
     01B0                                     00 0A 2D 06
     01C0  02 00 12 02 
     01C0              01 0D 2D 09-03 00 BC 02 



