# Warlords II Army Data Structure

Contributed by Matt Caspermeyer, caspermeyer.matt@asu.edu.

This file contains the army HEX file format for the IBM version of Warlords II (and the HEX data structure for DAT resource in the Mac army files). On the IBM, the default army file is called ARMYTYPE.DAT (there is also an ARMYTYP2.DAT with a slight variation of army names) and is located in a subdirectory TERRAIN0 off of the Warlords II main directory.

Note:The Warlords II Deluxe ARMY.DAT file is IDENTICAL to the Warlords II ARMY.DAT file, so the information below on HEX editing the WL2 ARMY.DAT file applies to the WL2D ARMY.DAT file as well.

The data for each army consists of 62 spots where information can be stored. The file does not use all of these positions. It's laid out similar to what you would see in a HEX editor.

                                          (10 11 12 13 14 15)
            00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F
    00 (00) PI 00 Name-------------------------------- 00 00
    10 (16) 00 00 00 00 00 00 ST 00  TI 00 CO 00 MO 00 Estab
    20 (32) CG 00 OG 00 FG 00 HG 00  CS 00 OS 00 FS 00 HS 00
    30 (48) AT 00 -Modi SP 00 FL 00  FM 00 HM 00 NA 00

    Here are want the codes mean:

    Using 00 as the first one and all numbers need to be in HEX, i.e. movement

    PI (00) = Picture Identification
            0B = Scouts             0F = Giant Bats
            02 = Light Inf.         0E = Orcish Mob
            0D = Light Cav.         0A = Catapult
            01 = Heavy Inf.         06 = Archers
            03 = Dwarves            10 = Pikemen
            04 = Heavy Cav.         07 = Wolfriders
            05 = Navy               00 = Giants
            11 = Minotaurs          0C = Spiders
            08 = Pegasi             09 = Griffins
            15 = Unicorns           12 = Elephants
            17 = Wizards            14 = Giant Worms
            18 = Ghosts             1A = Demons
            16 = Elementals         1B = Devils
            13 = Archons            19 = Dragons
            1C = Hero

    Name (02-13) = Name of Unit, try not to go past 12 characters

    ST (22) = Strength, have not tried values greater than 9

    TI (24) = Time to build (5's the limit in SB)

    CO (26) = Cost to build (99's the limit in SB)

    MO (28) = Movement (99) don't forget 16 movement is 10 in HEX

    Estab (30-31) = Amount it costs to establish that army type at a city.  For
    non-allies Bit 30 works like this:  whatever the number is in HEX convert it
    to Decimal i.e. HEX DC = 220, and bit 31 works like this:  take whatever
    number is there and multiply by 256, i.e. HEX 05 so take 5 x 256 = 1280.
    Then add the two, 220 + 1280 = 1500.  For Allies it works slightly different:
    for bit 30 take that number convert to decimal and subtract from 256, i.e.
    HEX 48 = 72 so 256 - 72 = 184; and for bit 31 take that number and convert
    it to decimal and substract from 255 (yes 255) so HEX F4 = 244 and 255 -
    244 = 11 now multiply that number by 256, 11 x 256 = 2816 now add the
    two 184 + 2816 = 3000! There are your costs to establish.  Take note that FF
    for both bits 30 and 31 is the Hero designation.

    CG (32) = City Individual Strength bonus 00 = None, 01 = +1 Strength in
    cities, etc.  I haven't tried going past 03 (+3) because that's the limit in SB

    OG (34) = Open Individual Strength bonus same as CG

    FG (36) = Forest Individual Strength bonus same as CG

    HG (38) = Hill Individual Strength bonus same as CG

    CS (40) = City Stack Bonus 00 = None, 01 = +1 to all creatures in that city
    stack, 03 is again the limit in SB

    OS (42) = Open Stack Bonus same as CS

    FS (44) = Forest Stack Bonus same as CS

    HS (46) = Hill Stack Bonus same as CS

    Note:  If the army has +1 (or more) in all of CS, OS, FS, HS then they have
    the general stack bonus that a Unicorn would have for instance.

    AT (48) = Ally Type 00 = None, 01 = regular ally, 02 = Temple Ally (this
    means that this army can be given as a reward for completing quests, and
    according to the SB manual Temple Allies must be given flight capability)

    Note:  If you make an army an ally don't forget to give them bonuses in CS,
    OS, FS, and HS of at least +1

    -Modi (50,51) = Negative modifier bit 50:  FF = -1, FE = -2, FD = -3; bit 51:
    FF = Identifies whether army has a negative stack bonus, 00 = no negative
    stack bonus

    Note:  In SB armies cannot be allies and have a negative stack bonus

    SP (52) = Special Army Bonus 00 = None, 01 = Cancel City Bonus, 02 =
    Cancel Hero Bonus, 03 = Cancel Non-Hero/City Bonus, 04 = Fortify Bonus

    FL (54) = Fly 00 = No, 01 = Yes (note:  Temple Allies must be given flight
    capability otherwise they will not be awarded for completing quests
    according to SB manual)

    FM (56) = Forest Movement Bonus 00 = None, 01 = Yes use only 2
    movements points for each forest square

    HM (58) = Hills Movement Bonus same as FM

    NA (60) = Navy 00 = No, 01 = Yes

    All other bits with 00 are not used by the game.  Take note that Estab uses
    two bits and that armies that cost less than 255 GP will only use bit 30.
    Okay, Lets look at an example!

    Here is how it looks like for the first two armies in the default army set:

                                          (10 11 12 13 14 15)
            00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F
    00 (00) 0B 00 53 63 6F 75 74 73  00 00 00 00 00 00 00 00
            |     S  c  o  u  t  s
            Picture I.D. = Scouts picture
    10 (16) 00 00 00 00 00 00 01 00  01 00 02 00 10 00 0A 00
                              |      |     |     |     |
                   Strength = 1      |     |     |     |
                     Time to Build = 1     |     |     |
                Cost to make = 2 (upkeep = 1)    |     |
                                 Movement 10H = 16     |
                           Cost to Establish 0AH = 10 GP
    20 (32) 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
       Nothing here no specials or anything (crossbow fodder)!
    30 (48) 00 00 00 00 00 00 00 00  01 00 01 00 00 00 0F 00
                                     |     |           |
                 Forest Movement Bonus     |           |
                        Hills Movement Bonus           |
               Start of next army 0F = Giant Bat Picture
    40 (64) 47 69 61 6E 74 20 42 61  74 73 00 00 00 00 00 00
            G  i  a  n  t     B  a   t  s
    50 (80) 00 00 00 00 01 00 01 00  05 00 10 00 1E 00 00 00
                        |     |      |     |     |
             Strength = 1     |      |     |     |
              Time to Build = 1      |     |     |
          Cost to make = 5 (upkeep = 2)    |     |
                           Movement 10H = 16     |
                      Cost to Establish 1E = 30 GP
    60 (96) 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
            more crossbow fodder!
    70(112) 00 00 00 00 01 00 00 00  00 00 00 00 02 00 . . .
                        |                        |
                      Fly                        |
        Start of next army 02 = Light Inf. Picture . . .

    This format is followed for all the armies including Navy and Hero although
    for the Navy anything placed in the 62 bits along with the Navy identifier
    (60) is ignored (except for picture and name) and for the Hero after FF FF is
    specified for bits 30 and 31 you can only change strength (22) and
    movement (28)

    Things that you can try that I haven't done:
    1.  Make the Strength larger than 9 (i.e. 0A)
    2.  Make two Hero or Navy armies
    3.  Make a Super Army i.e give it +3 for all terrain individual strength and
    stack bonuses make it have -3 enemy stack bonus and then one of the
    special bonuses i.e. Cancel Hero bonus.
    4.  Make a powerful army that can "polymorph" and look just like a less
    powerful army (use that lesser army's Picture I.D.) like a Light Inf. unit or do
    the opposite.
    5.  Put your own here

    Things that I've done to enhance the default army set:
    1.  Make catapults strength 6 or 7 and bump up their cost statistics that way
    computer players will use them more often (I found that 4 turns for a piddly
    2 was hardly ever made by computer players).
    2.  Give wolfriders a hills movement bonus (how can you add +1 to a stack
    in hills if you have problems moving through them?).
    3.  Change the griffin's city individual strength bonus to a city stack bonus.
    4.  Change the pegasi's stack bonus to a fortify bonus.
    5.  Add two moment to all armies.
    6.  Make the (d)orcish mob's time to build to 1 or make them stronger (who
    wants to wait 2 turns for a 2!).
    7.  Make light cav. units have 3 strength.
    8.  Make pikemen take only 2 turns to produce (3 turns for a 4 even though
    it's +1 in the open - blach!).
    9.  Make heavy cav. strength 5 (makes them tougher).
    10. Make spiders, elementals, devils, archons, and the hero faster (maybe
    +2-4 to movement).
    11. Give elementals forest and hills movement bonuses (they travel on the
    elemental plane and obstructions in this plane don't slow them down, except
    marshes - can't do anything about that!).

    Things that don't show up properly in the army bonus menu (IBM)
    1.  Fortify bonus does not appear at all (a simple - instead)
    2.  If a unit has an individual strength bonus in all terrains it shows up as
    a hills individual strength bonus, stack bonuses for all terrains show up
    properly (+1 stack)
    *3.  If you give an ally a negative enemy stack bonus and take away its
    stack bonuses it shows up as +0 (I like allies with negative stack bonuses)
    *4.  If you give an army strength bonuses in more than one category but not all
    (see 2 above) it will show up as a strength bonus of the last bonus in the
    list (the order is city, open, forest, hills), i.e. if a unit has +1 forest and
    hills bonuses it will show up as a +1 hills bonus (this applies to individual
    or stack)
    * = This can only be achieved through the use of a HEX editor