Hex editing guide 1 - EE-modders/Empire-Earth-toolbox GitHub Wiki
This a guide to modifying the default values for Empire Earth units. This means you can do things like change the default tech tree and default unit values so that you can use them in a random map. You can also add units and buildings into the game that could previously only be used in the map editor.
You need 3 pieces of software...
- EE Studio: Use this to extract the 4 .dat files you will have to change
- Empire Earth Unit Editor by Matthew Wolf: This makes it easier to change some of the values
- A hex editor: This allows you to edit the .dat files directly
Download 1 and 2 from: http://dynamic5.gamespy.com/~empires/downloads/categ.php?cat=21.
Use EE Studio to get the 4 .dat files. Instructions on how to do this are found in EE Studio and the Empire Earth Unit Editor. The 4 files are:
dbtechtree.dat
dbobjects.dat
dbgraphics.dat
dbbuttons.dat
Make copies of these files and store them in a safe place. Make a folder called "db" inside "C:\Program Files\Empire Earth - the Art of Conquest\Data" and put the 4 files in there. If you mess the files up, copy the backup files over them to fix them.
Now you can use your Hex Editor to edit the 4 files inside the "db" folder.
You have to be able to translate the hexadecimal notation (you can use the scientific calculator in Windows). For example, a food cost for building a unit might appear as β32β in hex, but the value is actually 50 in decimal. Also, when you see a value like β46 05β the decimal value is 1350, not 17925 because you have to read the hex backwards (β05 46β).
Whenever you change something in the files you must always overwrite the old data, otherwise Empire Earth may not run at all due to the change in file size. Obviously you must be in hex mode to change the hex values, and in character mode to change the names/strings.
This file holds the tech tree used in the game. Open this file in your Hex Editor.
Each entry in the tech tree starts with the name. For example, the name for the Riot Police unit is "sp Riot Police" and the Zeus is "Mech Zeus". Everything after the name but before the next name is the tech tree data for that object.
All the units in the tech tree have certain numbers in the same position. I have highlighted the ones I understand in the colour coded diagram below. The Hex Editor shows the Riot Police unit used as an example...
Tech ID Number: This is used to identify the tech. When you want to change a building to be able to build a particular unit you have to use this number (see βAdding Editor Only Unitsβ later in guide).
Start/End Epoch: β0Fβ seems to mean βdoesnβt endβ, so therefore β0Eβ is the Space Age, β0Dβ is the Nano age, β0Cβ is Digital Age etc. Changing the Start Epoch does not always seem to work, especially if you want to change something to start in the Space Age instead.
Costs to build: The second blue box is for the Gold cost, and the last two are Iron and Food. Iβm not sure about which ones are for Stone and Wood. These particular values are easier to change in the Unit Editor anyway.
Build Speed: Change this in the Unit Editor. It is usually a large number.
Button ID: If you change this value then you can change the button graphic used for this tech.
Position of button on interface: Use the Unit Editor to change this. If the button appears in the same place as another button in the same epoch, then one button will appear on top of the other, making one of the techs unavailable. If there is no value for the position of the button then the button will not be visible, so you wonβt be able to use the tech at all.
Unit is Editor only: β01β=Unit is Editor only, β00β=Unit is not Editor only. For some objects, getting them to appear in the game is more complicated than just changing this value (see later in the guide).
Object unit comes from: This seems to be where the object comes from. In the example, Object 22 is the Barracks (see the Unit Editor). Therefore the Riot Police unit comes from the barracks. After the 22 there is a β01β and another β22β. This appears to be a list of some kind. So β01β means there is 1 item in the list, and β22β is the item in the list (the barracks again). The number in the first β22β position and last β22β position always seems to be the same.
This file holds just about all the information about the units you can think of that is not in the tech tree.
Like the tech tree, each entry starts with the name, e.g. βGun Artillery13 Colossusβ. However, there is a lot more data for an object than in the tech tree. So I have divided these diagrams into several parts.
The second name that appears is the type of unit it is, e.g. βhelicopterβ, βAircraft Carrierβ, βLand Patrollingβ, βCalamity Casterβ, βSimple Buildingβ etc. If you change the unit type name then the unit behaviour will change, but sometimes it could crash the game.
Here is an example of the first part of a object, the Pandora (note: for some reason the Pandora is called a βCyclopsβ in the tech tree file)β¦
Speed is a bit odd because the value does not reflect what appears in the game. I think it goes up in steps of βDβ (13)β¦
Hex Value | Speed in game |
---|---|
19 | 12 |
26 | 13 |
33 | 14 |
40 | 15 |
4D | 16 |
The other numbers near the speed might have something to do with acceleration or turning speed.
Attack mode is how the unit attacks other units. If you look at the attack mode values in other units you can work out what they are for. Here are some I have notedβ¦
Value | Unit Reaction | Examples |
---|---|---|
07 | Fires at air units | AA Tower, Stinger Soldier |
29 | Fires at air and fround units | Talon Fighter/Bomber |
09 | Fires at submarines | Sea King |
41 | Fires at space units only | Space Turret |
21 | Fires at ground units | Panzer Tank |
0C | Fires at air units | Nebula Fighter, Gunboat |
If you change the Space Turret to β21β for example, then you will find that the Space Turret starts zapping ground units! |
I donβt know where the Range is, although when editing the Zeus II, it seemed to be a part of the Hit Points.
Now let us examine the next part of an object, this time the Enterprise Aircraft Carrierβ¦
This part is self-explanatory.
The next part of the object includes information about where the unit is allowed to move (this is still the aircraft carrier example) β¦
The last part of the Enterprise carrier object is shown belowβ¦
Since the aircraft carrier can actually create objects (i.e. planes), there is a list of Tech ID numbers at the end for those objects. With building objects there is always a list of Tech ID numbers that the building can create.
You must be careful when making an object cloaked. If you cloak an object that has no attack range (e.g. B5 stealth bomber) then that object can never be destroyed by the enemy. This is because the object will always be invisible and the enemy will not be able to see it no matter how close they get.
However, if you cloak something with attack range (e.g. a marine) then you should have no problem. If you can find out how to change the range for an object which has no range then you can cloak that unit without it becoming invincible.
The textures for the buttons are recorded here.
The format for this one is quite simple. First there is the name of the button (βAtomic Bomber Rally Pointβ) and then the path to the texture (βtextures\act_infiniteatomic.sstβ).
The textures for the models are recorded here. It is probably easier to change the graphics in the Unit Editor. The format is quite simple so you should be able to work it out for yourself.
Here is a summary of how to get the βEditor Onlyβ units into the random maps.
-
Open the βdbtechtree.datβ file in the Hex Editor and search for the unit you want to put in.
-
Change the βEditor Onlyβ value to β00β.
-
Check the βObject the unit comes from valueβ. In nearly all cases this number should be correct. However, when I was adding the Zeus II, the number was β8B 01 00 00β when it should have been β45 00 00 00β (the Cyber Factory). Make sure you change both numbers if you have to edit it, i.e. β8B 01 00 00 | 01 00 00 00 | 8B 01 00 00β would become β45 00 00 00 | 01 00 00 00 | 45 00 00 00β.
-
Save.
-
Go to the Unit Editor and change the button position for the unit to a suitable place.
Sometimes these 5 steps will be enough to add it to the default tech tree. However, with other units such as the βUFOβ you have to attach it to a buildingβ¦
-
Find out the Tech ID for the unit you want to add.
-
Open the βdbobjects.datβ file in the Hex Editor and search for the building/object you want to create the unit with.
-
Increase the βNumber of objects this unit may createβ value by 1.
-
Add the Tech ID number you discovered in (6) and add it to the end of the TechID list. For example, to add the UFO you would put βDC 37 00 00β at the end (just overwrite the βFF FF FF FFβ values).
-
Save.
When I tried to add Zeus II to start in the Space Age I found that I couldnβt change the Start Epoch. So Zeus and Zeus II were both appearing in the Nano Age.
The way round this problem is to have Zeus and Zeus II in the same button position so that Zeus appears in front of Zeus II for the Nano Age. The order of the items in the Tech ID list matters if you have units that appear in the same Epoch and button position. The items later in the list will appear in front of those earlier in the list. So I put Zeus at the end of the list and Zeus II earlier in the list. Then all you have to do is make sure the Zeus end epoch is Nano, and the Zeus II will appear in its place for the Space Age.