Decoding - Unit.dat



This section has information about the construction of the game files and how to edit them. If you know something about a that there is no information available about, please contribute! Provided are documents, descriptions and tools allowing you to edit the files.

The information here is based on The Peasants Rebellion, unless otherwise stated!





Contents: The unit.dat includes information such as the hitpoints, attack power, defense and speed of soldiers. The stats for citizens are also stored individually.
Status: ~50%
Contributors: Zomis
Documents: Not available
Tools: Merchator download.png





This information was posted by Merchator at the forums:


Just open unit.dat in "/data/defines/" and change this things manually.
(Offsets are decimal).


Offset Typ


00015680: Serf
00086762: Laborer
00023578: Woodcutter
00055170: Carpenter
00094660: Stonemason
00047272: Farmer
00063068: Baker
00039374: Animal breeder
00070966: Butcher
00078864: Fisherman
00118354: Recruit
00031476: Mine worker
00110456: Metallurgist
00102558: Blacksmith

Military units

Offset Typ

0030%252: Militia
00134150: Axe fighter
00142048: Sword fighter
00149946: Bowman
00157844: Crossbowman
00165742: Lance carrier
00173640: Pikeman
00181538: Scout
00189436: Knight
00197334: Barbarian
00205232: Rebel
00213130: Rogue
00221028: Warrior
00228926: Vagabond
00236824: Catapult
00244722: Ballista

Now lets take a look at a swordfighter:

Offset 00142048

03 00 37 00 00 00 00 00 03 00 18 00 0D 00 09

1st byte: Hitpoints
3rd byte: Strenght
5th byte: Strenght against horses (pikes)
7th byte: unknown
9th byte: Defence
11th byte: Speed
13th byte: unknown
15th byte: Look Instance

Please remember that between each "important" byte a "00" is.
Unit.dat include also animations, as far as I know, but I don't know exactly which value means which animation/picture.


Some additional notes by JBSnorro:
The value of the 7th byte is always 0, the value of the 13th byte is always 0 or 13, and after those 15 bytes there still are some values, but 90 % is -1 and I didn't notice any differences in gameplay when I altered the other 10 %.