Ground target data in eaw.exe (notes by Andy) 21.10.2002 ===========================================

==
(Submitted by RAF_Dumoulin)

The table starts at byte offset:

0012 12CE (eaw.exe V1.2)
0011 D2D6 (eaw.exe V1.1)
0012 9AFE (eaw.exe V1.2a)

with the HEX-values:

0100 6B03 0E03 0000 0102 03FF 2616 ...

for the first target, the oil plant (target 01). byte3/4: 6B03 = 875 dec, byte5: 0E = 14 dec, byte6 = 03 and so on, as can be seen in the table below.

#define FEET *21L (multiplied with 21 dec)
#define MILES *0x20000L
(multiplied with 131072 dec = 00002000H)

TargetInfo TargetData[MAX_TARGET_TYPES] =

AndyGround1.jpg

AndyGround2.jpg

typedef struct _TargetInfo

UWORD TypeNum;
short MaxDamage;

UBYTE RepairTime; repair time for destroyed
UBYTE RepairRate;
repair rate
UBYTE DestructionMod; used in campaign engine, how difficult it is to destroy the target
UBYTE Smoke;
0 no smoke, 1 smoke

UBYTE Armor; Armor Rating 0 = No Armor
UBYTE ModelType;
0 = no model, 1 = plane sized object, 2 = ground sized object
UBYTE PeopleCount; number of people to spawn (around are), then
UBYTE RandomChance;
on destruction spawns more if non-zero and building

UWORD Width;
UWORD Height;
UWORD Length;

UWORD Radius;
UBYTE Score;
UBYTE ExplosionSize;

long DetailDist;
long MaxVisDist;
short SmokeOffsetX;
short SmokeOffsetZ;

ULONG TargetType;

UWORD LowModel;
UWORD HiModel;
UWORD DestroyedModel;
UWORD ShadowModel;

} TargetInfo;

#define TAR_ANY 0
#define TAR_OIL_PLANT 1
#define TAR_BALL_PLANT 2
#define TAR_CHEM_PLANT 3
#define TAR_AIRCRAFT 4
#define TAR_AIRFIELD 5
#define TAR_ARMAMENTS 6
#define TAR_RAILYARD 7
#define TAR_SHIPPING 8
#define TAR_UBOAT 9
#define TAR_V1SITE 10
#define TAR_ROAD_RIVER_BRIDGE 11
#define TAR_ROAD_COAST_BRIDGE1 12
#define TAR_ROAD_COAST_BRIDGE2 13
#define TAR_RAIL_RIVER_BRIDGE 14
#define TAR_RAIL_COAST_BRIDGE1 15
#define TAR_RAIL_COAST_BRIDGE2 16
#define TAR_HEAVY_AA 17
#define TAR_LIGHT_AA 18
#define TAR_OIL_STORAGE 19
#define TAR_RADAR_STATION 20
#define TAR_RADAR_TOWER 21
#define TAR_FOREST3 22
#define TAR_FORTS 23
#define TAR_FUEL_DUMP 24
#define TAR_AIR_CTRL_TOWER 25
#define TAR_ANM_BUNKER 26
#define TAR_HANGER 27
#define TAR_BARRACK 28
#define TAR_HQ_BUILDING 29
#define TAR_O_CLUB 30
#define TAR_BRIEFING_ROOM 31
#define TAR_TREE1 32
#define TAR_TREES1 33
#define TAR_TREE2 34
#define TAR_TREES2 35
#define TAR_TREE3 36
#define TAR_TREES3 37
#define TAR_TREE4 38
#define TAR_TREES4 39
#define TAR_FOREST1 40
#define TAR_WAREHOUSE 41
#define TAR_FOREST2 42
#define TAR_TRAIN_ENGINE 43
#define TAR_TRAIN_TENDER 44
#define TAR_TRAIN_BOXCAR 45
#define TAR_TRAIN_OIL_TANKER 46
#define TAR_TRAIN_FLATBED 47
#define TAR_TRAIN_FLATBED_TANKS 48
#define TAR_TRAIN_FLATBED_GUNS 49
#define TAR_FUEL_TRUCK 50
#define TAR_TRUCK 51
#define TAR_TRUCK_COVERED 52
#define TAR_HALFTRACK 53
#define TAR_JEEP 54
#define TAR_PANTHER_TANK 55
#define TAR_SHERMAN_TANK 56
#define TAR_TRANSPORT 57
#define TAR_CHURCH 58
#define TAR_CITY1 59
#define TAR_CITY2 60
#define TAR_CITY3 61
#define TAR_CITY4 62
#define TAR_CATHEDRAL 63
#define TAR_FARM 64
#define TAR_CASTLE 65
#define TAR_CHATEAU 66
#define TAR_WINDMILL 67
#define TAR_HOUSE 68
#define TAR_PARACHUTIST 69
Fake Targets for spawning people
#define TAR_PEOPLE_MILLING 70
#define TAR_PEOPLE_MARCHING 71

#define TAR_DESTROYER 72
#define TAR_DESTROYER_TURRET 73

#define TAR_BRIDGE 0x001e
will select any bridge
#define TAR_NONE 0xFF
#define TAR_LONDON 0xEF // special flag for BoB campaign
#define TAR_CONVOY 0xEE
#define TAR_ARMOR 0xED
#define TAR_TRUCKS 0xEC
#define TAR_V1_INTERCEPT 0xEB
#define TAR_SCRAMBLE 0xEA
#define TAR_CONTINENTAL_BASE 0xE9

TAR-TYPE definitions (by Andy)

there are a lot of different target type definitions and combinations of them, but there is a pattern: The tar types are coded as long, that means they consist of 4 bytes.
Since it's difficult to explain I'll simply list all types and combinations that appear in the exe file and you will see how the combinations work. I added some examples that do not appear in the exe for better understanding.
In the text above the variables are called TAR_TYPE_XXXX (e.g. TAR_TYPE_NONE). To make things easier to read I'll leave the 'TAR-TYPE' string and write '_NONE' only. OK, let's start:

TAR_TYPE definition note

usual targets
=

_NONE 0000 0000 not targetable
_ANY 0100 0000 targetable
_BRIDGE 0300 0000 seems not to work as target!
_AIRFIELD 0800 0000

combinations:

_AIRFIELD|_BOMBER 0C00 0000 _BOMBER seems to make the target work for bombing misions
_ANY|_BOMBER 0500 0000 _BOMBER seems to add 04 to the first byte
_ANY_|AIRFIELD|_BOMBER 0D00 0000 01 (any)+08 (airf.)+04 (bomber)=0D
_BRIDGE|_LONGBRIDGE 4300 0000 don't ask me for the meaning, not targetable
_NONE|_DONTSET 8000 0000 _DONTSET appears for trees and radar towers
_ANY|_RADAR 0101 0000
_ANY|_RADAR|_DONTSET 8101 0000 appears for radar towers, maybe _DONTSET means to create a cluster of this target type???

AA targets

==


_AAA|_LIGHT_AAA 2000 0001 byte1 set to 20 means AA, byte4 sets the caliber
_AAA|_MED_AAA 2000 0002 not used in game in this combination! only in connection with ships
_AAA|_HEAVY_AAA 2000 0004
_AAA|_SMALL_ARM 2000 0008 not used in game in this combination! only in connection with tanks

Moving ground ojects (MGO)
==============

_MGO|_SHIP 1000 0100 byte1 set to 10 means MGO, byte3 sets type
_MGO|_ARMOR 1000 0200 not used in game in this combination cause tanks always have AA capability
_MGO|_TRAIN 1000 0400
_MGO|_TRUCK 1000 0800
_MGO|_TURRET 1000 1000 not used in game in this combination! see below

combinations:

_MGO|_SHIP|_AAA|_MED_AAA 3000 0102 byte1: 20 (AA)+10 (MGO)=30, byte3=01 (ship), byte4=02 caliber of AA (Medium)
_MGO|_ARMOR|_AAA|_SMALL_ARM 3000 0208
_MGO|_TRAIN|_AAA|_LIGHT_AAA 3000 0401
_MGO|_TRUCK|_AAA|_SMALL_ARM 3000 0808
_MGO|_TURRET|_AAA|_LIGHT_AAA 3000 1001 Very important! this could be used as 'invisible'
Flak, it is only used by the Destroyers, but is a additional target type that is unknown so far.

Some ideas:
=

We can now change all characteristics of all ground targets. :o) But all major changes have to go hand in hand with tardata.dat- (that means EAW-World-) editing.
This way we could substitute any target for another, even create completely new ones as moving AA or additional tanks, parked aircraft or anything we want.

Maybe the bridges could be simply made targetable by changing their type to _ANY|_BOMBER.

Maybe any ground target can get AA capability by adding an Turret (target type: 73) to it.

Maybe the _DONTSET Flag can be used to create tank platoons...

So, happy HEX-editing. :o)

Greetings,
Andy.