Battle Isle 2

Unit class table

LIB/UNIT000.DAT

One 88-byte record per unit type: movement, fuel, weapons, armour, transport and terrain.

Every other unit reference in the game, such as the units placed on a mission map or stored in a facility, is a record index into this table.

record 88 Brecords 54layout array of UnitClassRecord, no headerbyte order little-endianfields 35 ● 26 ◐ 7 ○ 2
Unit88 bytes
0x00000x2c00
× 54
Point at the bar to name a field; select it to jump to its row.
knownpartly knownunknown: investigatenamed, never setalways one valueunused bits

Abilities

1 field · 4 bytes
0x04u32leflags ◐Unit FlagsUnit capability bit set.
313029282726252423222120191817161514131211109876543210
22 named9 set but unnamed1 named but never set
bitmasknamemeaning
00x00000001buildBuilds roads through constructor selector0.
10x00000002fortifyBuilds fortifications through constructor selector2.
20x00000004lay railsLays rails through constructor selector1.
30x00000008occupyCan occupy buildings.
40x00000010transporterCarries other units.
50x00000020unnamedMeaning unknown. Set in 32 of 54.
60x00000040unnamedMeaning unknown. Set in 42 of 54.
70x00000080unusednever set in this fieldAlways zero in the shipped unit class table.
80x00000100unnamedMeaning unknown. Set in 11 of 54.
90x00000200single unitFights as one entity; strength comes from 0x47.
100x00000400repairRepairs other units.
110x00000800refuelHands out fuel.
120x00001000no tracksLeaves no vehicle tracks.
130x00002000unnamedMeaning unknown. Set in 39 of 54.
140x00004000rearmHands out ammunition.
150x00008000unnamedMeaning unknown. Set in 1 of 54.
160x00010000demolishAdmits demolition in the generic material constructor route.
170x00020000no attack after moveMust stand still to attack.
180x00040000move after attackOffers a follow-up Move after a selected attack when the unit survives and its calculated remaining allowance is greater than one whole hex. The grant branch does not require a first Move.
190x00080000unnamedMeaning unknown. Set in 10 of 54.
200x00100000refuel aircraftRefuels aircraft.
210x00200000unnamedMeaning unknown. Set in 1 of 54.
220x00400000unnamedMeaning unknown. Set in 1 of 54.
230x00800000planeAircraft or helicopter; classifies units into the AIRFORCE experience tally.
240x01000000climbCan climb to the high-air layer.
250x02000000diveCan dive.
260x04000000unnamedMeaning unknown. Set in 11 of 54.
270x08000000no counterfire (provisional)Losses inflicted by side 2 are cleared in selected attacks.
280x10000000railTrain.
290x20000000no experience tallyLeft out of the end-of-mission (ASCR250) experience tally. The units still gain experience.
300x40000000crystalThe crystal object.
310x80000000shipHull, submarines included; classifies units into the MARINE experience tally.

Movement

4 fields · 8 bytes
0x08u32leterrain_mask ●Terrain MaskTerrain the unit may enter.
313029282726252423222120191817161514131211109876543210
22 named1 named but never set9 unused
bitmasknamemeaning
00x000001road
10x000002path
20x000004ditch
30x000008rail
40x000010minor obstacle
50x000020major obstacle
60x000040hill
70x000080mountain
80x000100slope
90x000200grassland
100x000400forest
110x000800hazard
120x001000water basin
130x002000mud
140x004000snow
150x008000rock in water
160x010000shallow water
170x020000medium water
180x040000deep water
190x080000ice
200x100000buildingnever set in this field
210x200000building (enterable)
220x400000building entrance
23–31unusedNever set in any record.
0x16u16lefuel ●4–48038 distinct valuesMaximum fuel.
0x18u8move_range ●0–12825 distinct valuesStored movement ceiling in eighth-points.
0x19u8fuel_usage ●1 · 2 · 3 · 4 · 5 · 6Fuel multiplier per hex of geometric start-to-destination distance, 1..6 in the shipped table.

Identity

3 fields · 6 bytes
0x10u16leclass_name_id ●0–5354 distinct valuesKey into ENG/UNIT000.TXT, band 0..53; equals the record index in every shipped record.
0x12u16lemodel_name_id ●64–11754 distinct valuesKey into the 64..117 band of ENG/UNIT000.TXT (the proper/model name, e.g. TECHNOTRAX).
0x14u16leshort_name_id ●128–18153 distinct valuesKey into the 128..181 band (four-letter code, e.g. TANK).

Production

2 fields · 2 bytes
0x1au8cost_energy ●0–12030 distinct valuesProduction cost in energy.
0x1bu8cost_material ●0–10025 distinct valuesProduction cost in material.

Weapons

5 fields · 40 bytes
0x1ci16le[4]weapon_damage ●0–98041 distinct valuesDamage of weapon slots A..D.
0x24u8[4]weapon_min_range ●0 · 1 · 2 · 3 · 4Minimum firing range of slots A..D, in whole tiles.
0x28u8[4]weapon_max_range ●0–88 distinct valuesMaximum firing range of slots A..D, in whole tiles.
0x2cu16le[4]weapon_ammo ●0–99025 distinct valuesAmmunition of slots A..D.
0x34u32le[4]weapon_targets ●Weapon Target MaskTarget/resource selector and weapon type of slots A..D.
313029282726252423222120191817161514131211109876543210
15 named16 set but unnamed1 unused
bitmasknamemeaning
00x0001ammoSupplies ammunition.
10x0002fuelSupplies fuel.
20x0004energySupplies energy.
30x0008materialSupplies material.
40x0010high air (high-altitude aircraft)Hits high-altitude aircraft.
50x0020air (low-flying aircraft)Hits low-flying aircraft.
60x0040land (ground)Hits ground units.
70x0080water (naval)Hits surface ships.
80x0100underwater (submarines)Hits submarines.
90x0200structure (buildings)Hits buildings.
100x0400unnamedMeaning unknown. Set in 6 of 216.
110x0800Air-Air Rocket
120x1000Ground-Air Rocket
130x2000Air-Ground Rocket
140x4000Ground-Ground Rocket
150x8000Torpedo
160x10000unnamedMeaning unknown. Set in 2 of 216.
170x20000unnamedMeaning unknown. Set in 3 of 216.
180x40000unnamedMeaning unknown. Set in 10 of 216.
190x80000unnamedMeaning unknown. Set in 46 of 216.
200x100000unnamedMeaning unknown. Set in 24 of 216.
210x200000unnamedMeaning unknown. Set in 54 of 216.
220x400000unnamedMeaning unknown. Set in 4 of 216.
230x800000unnamedMeaning unknown. Set in 10 of 216.
240x1000000unnamedMeaning unknown. Set in 36 of 216.
250x2000000unnamedMeaning unknown. Set in 10 of 216.
260x4000000unnamedMeaning unknown. Set in 20 of 216.
270x8000000unnamedMeaning unknown. Set in 2 of 216.
280x10000000unnamedMeaning unknown. Set in 3 of 216.
290x20000000unnamedMeaning unknown. Set in 3 of 216.
310x80000000unnamedMeaning unknown. Set in 7 of 216.
30unusedNever set in any record.
slotweapon_damageweapon_min_rangeweapon_max_rangeweapon_ammoweapon_targets
A0x1c0x240x280x2c0x34
B0x1e0x250x290x2e0x38
C0x200x260x2a0x300x3c
D0x220x270x2b0x320x40
Where each slot's values sit: slot k is element k of every array above.

Transport & facilities

7 fields · 7 bytes
0x44u8weight ●1–12631 distinct valuesTransport volume the unit occupies when carried.
0x45u8transport_volume ●0–11012 distinct valuesTransport volume the unit provides.
0x4au8transport_class ●Transport ClassesExactly one bit, the class the unit counts as when carried.
76543210
8 named
bitmasknamemeaning
00x01infantrythe three RECON. PATROL / robot classes
10x02mineMINE
20x04crystalCRYSTAL
30x08lightlight vehicles, artillery, emplacements
40x10heavyREPAIR VEHICLE, MAIN BATTLE TANK, ASSAULT TANK, TRANSPORT TANK
50x20supportradar, tanker, ammunition and transport vehicles, LANDING BOAT
60x40airevery aircraft and helicopter
70x80not transportablestructures, trains, hulls, the heavy aircraft
0x4bu8shop_mask ●Shop MaskFacility kinds the unit may enter.
76543210
8 named
bitmasknamemeaning
00x01hqset on every mobile class
10x02airportfixed-wing aircraft, both helicopters, and classes with the all-category mask 0xff
20x04harbourhulls, LANDING BOAT, and classes with the all-category mask 0xff
30x08factoryground classes
40x10depotground and rail classes, and both helicopters
50x20cityground classes, and both helicopters
60x40academythe classes that can gain experience
70x80-unlabelled
0x4eu8interaction_mask ◐0 · 1 · 2 · 3Compared with another class's +0x4f tag in a movement interaction filter.
0x4fu8pickup_type ◐0 · 1 · 2Special map-object pickup kind: 1 Crystal, 2 Mine.
0x50u8transport_mask ●Transport ClassesTransport classes this unit can carry.

Uses the bits listed under transport_class.

Combat

4 fields · 6 bytes
0x46u8group_size ●1 · 5 · 10Members in a full group: 10 for ordinary units, 5 for a few, 1 for a unit that fights as a single entity (structures, trains, capital ships, submarines).
0x47u8group_strength_override ●0–107 distinct valuesLives of a unit that fights as a single entity; 0 when the class fights as a group.
0x48u16learmour ●50–75037 distinct valuesDefence value, 4..750.
0x52u16leattack_initiative ●0–99042 distinct valuesAttack initiative, 0..990; the game's manual calls it the attack initiation value.

Senses & sound

4 fields · 4 bytes
0x4cu8sight_block ◐0–408 distinct valuesClass-table byte associated with radar jamming: ANTI RADAR VEHIC jams radar in player-confirmed play, and the manual labels the field.
0x4du8sight ◐0–8018 distinct valuesClass-table byte labelled sight; the AI availability builder passes it to a geometry helper.
0x54u8sfx_select ◐1 · 2 · 4 · 9 · 10 · 26Sound id candidate: constant per movement domain (2 ground, 4 air, 9 ship, 26 rail, 10 structure, 1 small boat).
0x55u8sfx_fire ◐0–128 distinct valuesSound id candidate: varies with the weapon loadout rather than the movement domain.

Unknown / reserved

5 fields · 11 bytes
0x00u32lereserved_head ●always 0Always 0 across all 54 records.
0x0cu16leunknown_word_0c ○0x0040 · 0x18e0 · 0x18f0 · 0x60e0 · 0xe0e0 · 0xe1e0Values cluster within broad movement domains: 0x60e0 ground, 0x18f0/0x18e0 air, 0xe0e0/0xe1e0 sea, 0x0040 crystal.
0x0eu16leunknown_word_0e ○0x0008–0x042d10 distinct valuesLow-byte values cluster by movement domain (0x0d ground, 0x08/0x0c air, 0x09 ship, 0x0b submarine); a non-zero high byte occurs only on ARMOURED CAR, ROCKET TANK, RAILMOUNTED GUN, ANTI AIR EMPLAC. and TRANSPORT HELI. These distributions do not establish a role.
0x51u8reserved_51 ●always 0Always 0.
0x56u16lereserved_tail ●always 0Always 0.

Example: the Samurai 2 main battle tank

The Samurai 2 is unit id 11, the twelfth record, so its 88 bytes start at 11 x 88 = 0x3c8 in UNIT000.DAT. Each line is one field: its offset in the record, its bytes as stored, and the value they decode to.

0x00  00 00 00 00                                reserved_head = 0
0x04  60 20 00 00                                flags = 0x00002060
0x08  1f 62 00 00                                terrain_mask = 0x0000621f: road, path, ditch, rail,
                                                   minor obstacle, grassland, mud, snow
0x0c  e0 60                                      unknown_word_0c = 24800
0x0e  0d 00                                      unknown_word_0e = 13
0x10  0b 00                                      class_name_id = 11
0x12  4b 00                                      model_name_id = 75
0x14  8b 00                                      short_name_id = 139
0x16  5a 00                                      fuel = 90
0x18  28                                         move_range = 40
0x19  03                                         fuel_usage = 3
0x1a  09                                         cost_energy = 9
0x1b  08                                         cost_material = 8
0x1c  30 02 36 01 00 00 00 00                    weapon_damage = 560, 310, 0, 0
0x24  01 01 00 00                                weapon_min_range = 1, 1, 0, 0
0x28  01 01 00 00                                weapon_max_range = 1, 1, 0, 0
0x2c  06 00 08 00 00 00 00 00                    weapon_ammo = 6, 8, 0, 0
0x34  c0 00 28 01 60 00 28 01 00 00 00 00 ...    weapon_targets = 0x012800c0, 0x01280060, 0, 0
0x44  0a                                         weight = 10
0x45  00                                         transport_volume = 0
0x46  0a                                         group_size = 10
0x47  00                                         group_strength_override = 0
0x48  c2 01                                      armour = 450
0x4a  10                                         transport_class = 0x10: heavy
0x4b  79                                         shop_mask = 0x79: hq, factory, depot, city, academy
0x4c  10                                         sight_block = 16
0x4d  10                                         sight = 16
0x4e  00                                         interaction_mask = 0
0x4f  00                                         pickup_type = 0
0x50  00                                         transport_mask = 0x00
0x51  00                                         reserved_51 = 0
0x52  a4 01                                      attack_initiative = 420
0x54  02                                         sfx_select = 2
0x55  01                                         sfx_fire = 1
0x56  00 00                                      reserved_tail = 0

The four weapon arrays (weapon_damage, weapon_min_range, weapon_max_range, weapon_ammo) and the target masks hold one entry per weapon slot, and this tank uses two. Slot A is the main gun: 560 damage at range 1 to 1, 6 rounds, and its target mask 0x012800c0 has the land and water bits (0xc0) set. Slot B is the secondary gun: 310 damage, 8 rounds, with mask 0x01280060, whose low bits (0x60) are air and land. That is how a tank shoots at aircraft. The other two slots are zero. terrain_mask is a bit set naming the tile classes the Samurai may enter; it has no major obstacle, which the lighter Ranger does, and no hill or mountain.

Still to investigate

Every field marked unknown or partial above, and every bit that is set without a name or named without ever being set.

  • flags◐Unit capability bit set. Bits 5–6, 8, 13, 15, 19, 21–22, 26 are set but unnamed. Bit 7 (unused) is named but never set. UnitClassRecord
  • terrain_mask●Bit 20 (building) is named but never set. UnitClassRecord
  • unknown_word_0c○Values cluster within broad movement domains: 0x60e0 ground, 0x18f0/0x18e0 air, 0xe0e0/0xe1e0 sea, 0x0040 crystal. UnitClassRecord
  • unknown_word_0e○Low-byte values cluster by movement domain (0x0d ground, 0x08/0x0c air, 0x09 ship, 0x0b submarine); a non-zero high byte occurs only on ARMOURED CAR, ROCKET TANK, RAILMOUNTED GUN, ANTI AIR EMPLAC. and TRANSPORT HELI. These distributions do not establish a role. UnitClassRecord
  • weapon_targets●Bits 10, 16–29, 31 are set but unnamed. UnitClassRecord
  • sight_block◐Class-table byte associated with radar jamming: ANTI RADAR VEHIC jams radar in player-confirmed play, and the manual labels the field. UnitClassRecord
  • sight◐Class-table byte labelled sight; the AI availability builder passes it to a geometry helper. UnitClassRecord
  • interaction_mask◐Compared with another class's +0x4f tag in a movement interaction filter. UnitClassRecord
  • pickup_type◐Special map-object pickup kind: 1 Crystal, 2 Mine. UnitClassRecord
  • sfx_select◐Sound id candidate: constant per movement domain (2 ground, 4 air, 9 ship, 26 rail, 10 structure, 1 small boat). UnitClassRecord
  • sfx_fire◐Sound id candidate: varies with the weapon loadout rather than the movement domain. UnitClassRecord