Step By Step Guide To Data Editing - Part 1

Article written by Jatayu
Published on 07-09-2016; updated on 12-24-2016
Tags: Modding Archives

Part 1 - units and graphics

. When I learnt this thing I had to figure out most of the things myself and ask a few other people, which was not very efficient. Hopefully this will make it much easier for anyone who wants to take the plunge into data editing. The problem is that map design, triggers etc. is not too hard to figure out and even AokTS and Genied2 are somewhat self explanatory. However it is quite difficult to find stuff related to Genied1 data editing and I hope this will really come of use to those who want to make their custom data files.

I made this originally in html so some things will be a little peculiar like sentences jointed together, however it is coherent enough. The original documents, along with my custom data file and example scenario, can be downloaded here.

The .dat file

The .dat file (either empires2_x1.dat or empires2_x1_p1.dat) stores the data that the game engine makes use of. By modifying this file, you can literally convert your Aok into something entirely different. Note that this file does not store graphical or sound data - it just references them. All your data files can be found in the AoK Data directory. For eg. C:\Games\AOE\Data\

First of all, back up ALL your graphics data. If you mod or hack a lot, accidents will happen and you need to create multiple backups. Otherwise you will need to reinstall to get your data files back.

Now before we go further, you will need.. It is also recommended that you have a look at Rennaissance expansion by oliver.

Some definitions which I'll be using throughout:


A unit is an object that appears in the units window in the map editor (provided it's unlocked ). The standard Aok data file has 866 units, which can be unlocked using Genied. Most of the stuff that appears in the game- arrows, dead bodies, plants etc. are actually units even though they are not selectable. That does not mean everything you see is a unit. Terrains, splashes, water trails behind ships etc. are not units. Their graphics can be brought into a unit, which I'll discuss later on.

Graphic slot, or graphic

A graphic slot is a slot referenced by a unit and contains information abouthow it will look. It does NOT contain the images itself. It references SLP files located in graphics.drs, terrain.drs, interfac.drs etc.

Research and techage slot

Contains the technology tree and research related data.


The files that contain the images of Aok are called slp's. They are located in DRS files. They can be modified or extracted using DRSbuild or Mod Pack Studio.

The data file contains unit data, graphic data, research data and a few other stuff.

The drs files graphics.drs, terrain.drs and interfac.drs contain slps. The other drs files you'll find in your Data folder contain other stuff, for eg.gamedata_x1.drs contains Random maps, sounds.drs contains sound etc.

Changing the data file

Hex editing

A very good guide to hex editing by oliver can be found here.

Hex editing is quite a pain compared to Genied1 though possibly more powerful. For the remainder of the guide, I will focus on Genied1.

With the release of AGE (advanced genie editor), a lot of things have gotten much simpler, especially adding new units. However it is still not a replacement to genied1 and in many ways working with a script is a lot easier than point-clicking. Anyone who wants to go really deep into heavy .dat editing will definitely want to learn Genied1, whereas those just looking for adding a couple of units should learn AGE.


The help section of Genied1 should give you all the information you need to get you started, but I'll repeat it here anyway.
  1. Start up Genied1
  2. Go to Edit Settings. In SWGB location, type the name of the file you want (empires2_x1.dat). This file should be located in the same directory.
  3. Select Decompress Genie. This command decompresses the data file with the name you entered, under the folder directed in "AoK Location" setting. Afterwards, a new file called "genie.unz" would be created in the "ged_data" folder.
  4. Select Read data. This command would tell GeniEd to read the data from the decompressed *.dat file "genie.unz". You must do the "Decompress Genie" task at least once before attempting to run this command.
  5. Convert data to text. Then the data file is converted into text files located in the text folder of ged_data.
  6. Make changes in the patch file (will be the real subject of discussion)
  7. Finally, when you are ready with your patch file, select create new genie file. This file will be named genie.dat in your ged_data folder. Rename to empires2_x1.dat and replace in your Aok data directory.
Genied1 is not really so much of a pain and a hassle as it is sometimes made out to be. It has been the mainstay of advanced data editing for a while, and is likely to remain so until someone comes up with a much better program. (In fact there already is one, called AGE, but Genied1 is still important.) Even so, the basic concepts would remain the same.


The unit data is located in the files civ0units.txt -- civ18units.txt and units.txt.

Most of it is in civ*units.txt (* = 0 to 18)

For example, you can find the line
civ_0_unit_74_hit_points: 40
in civ0units.txt

This says that unit 74 has 40 hit points. Unit 74 happens to be militia (checkup with Genied2). Now if we want to give the militia 100 Hp, just write in patches.txt (note: Do NOT make changes in civ0units.txt):

civ_0_unit_74_hit_points: 100

To make this change for all civilizations, use a variable patch

civ_*_unit_74_hit_points: 100

Important note - variable patches take much longer (at least 10 times) to compile compared to fixed patches. If you want to use fixed patches, you would have to copy out the line 18 times like this

civ_0_unit_74_hit_points: 100
civ_1_unit_74_hit_points: 100
civ_18_unit_74_hit_points: 100

And then create the new genie file etc.

Now as most of you must be knowing, it is a whole lot easier to do this inGenied2 enhanced versions. In fact almost every aspect of unit data can be modified using Genied2. I won't be discussing Genied2 here, these threads give you a lot of information:

Thread by Trisolo
Guide by qaz123tfg

Some things in Genied2 which people have not been using very much:

Projectile displacement: You can see this effect with the necromancer of Renaissance. It's projectile displacement 3 value is 33. According to Aok's isometric system that means the height from the anchor point of the unit firing the projectile.

Multiple projectiles: This is only there in the latest version of Genied. It is called secondary missile and secondary missile duplication. By judiciously modifying these and the projectile inaccuracy you can create units that spew multiple projectiles, eg. the volcano of Renaissance.

There are only a few things that cannot be done in Genied2:

Adding a new unit: Scenario_t_c's straightforward guide tells you how to add a new unit. I have included the file patches_dock.txt which adds the juggernaut ship. Note the lines:

civ_*_unit_868_name_length: 11
civ_*_unit_868_name: Juggernaut

which change the new unit's name to Juggernaut. The rest of it is copied from the dock data. The ship is later made movable using Genied2 and given different graphics. However with the release of Advanced Genie Editor we can expect this to be obsolete as well.

Modifying some of the 'unknown' data: If you look at the civ data for any unit, say fishing ship, you'll see a lot of "unknown" values. For example:

civ_*_unit_13_unknown22: 45 0 -1 -1

With a little bit of intelligent guessing and testing, I figured this meant that the fishing ship deposits fish at the dock (unit 45). I cloned a 'trawler' using the fishing ship data with this modification.

civ_*_unit_869_unknown22: 87 0 -1 -1

The trawler deposits at the archery range (id 87).

Another example is modifying terrain left behind. Eg. outpost (unit 598)

civ_0_unit_598_terrain: 27

Means that on being created, it changes the terrain to terrain 27. You can look this up in terrains.txt. Changing this to 26 (Ice) would mean formation of ice terrain when outpost is created. You can find terrain changers template by scenario_t_c here and a great example where this is used, The old man and the sea by matty12345

There are many such unknowns whose function is not yet known. Modify them to suit your unit.


Now we come to the important part - graphic slot editing. This is not addressed AT ALL by Genied2 versions. Graphics data is located in mostly in graphics_other.txt, also in graphics_head.txt and graphics_koh.txt.

Open up graphics_other.txt. Let's look at the attacking archer's graphics lot, which happens to be 627 (You can look this up in Genied2).

graphic_627_name1: ARCHR_AN
graphic_627_name2: ARCHR_AN
graphic_627_slp: 2
graphic_627_unknown01a: 00 00 00 01 14
graphic_627_unknown01b: -1
graphic_627_replay: 1
graphic_627_unknown01c: 00 00 00 00 00 00 00 00
graphic_627_delta_count: 3
graphic_627_sound: -1
graphic_627_extras: 1
graphic_627_numframes: 10
graphic_627_angles: 8
graphic_627_unknown02: 0 0.07 0
graphic_627_unknown03: 3
graphic_627_id: 627
graphic_627_type: 6
graphic_627_delta_000: 2256 0 0 0 0 0 -1 0
graphic_627_delta_001: -1 0 0 0 0 0 -1 0
graphic_627_delta_002: 626 0 0 0 0 0 -1 0
graphic_627_extra: 5 312 7 314 -1 -1 5 312 7 314 -1 -1 5 312 7 314 -1 -1 5 312 7314 -1 -1 5 312 7 314 -1 -1 5 312 7 314 -1 -1 5 312 7 314 -1 -1 5 312 7 314 -1-1

Now let's look at these lines carefully.

name1 and name2 - a name to identify the graphic. This has nothing to do withthe internal name, which also happens to be ARCHR. You could rename it to anything you like and it wouldn't matter. This is basically for identification purposes, so that you know what the graphic slot is.

_slp: This number is the slp referred to in graphics.drs. Open up graphics.drs in MPS or DRS_Aok and find resource #2. It is an attacking archer.

Changing the SLP of the graphic slot is a way to find many good tricks.Suppose we want to change the archer to a longbowman, let us replace it with the slp of the longbowman, which is 702 (look up MPS).

graphic_627_slp: 702

matty12345's thread gives many examples of how to creatively use Genied1.

If you don't want to edit a graphic slot but add an entirely new graphics slot, masterjoab's thread tells you how to do it. Examples are in patches_graphics.txt.

Continued in part 2.

Do you want to comment on this article? Thank the author? Tribute resources for its improvement? Raze it to the ground?

Come by and visit its thread in the University Forum!