Genie data
From GenieWiki
The Genie Engine uses a single file to store all of its binary game data. This makes the engine so extensible that the three Genie games (AOE, AOK, and SWGB) could theoretically be modded into each other without recompiling a bit of the code. The datafile resides in the \Data folder and is called empires2.dat for AOK, empires2_x1.dat for AOK:TC, empires2_x1_p1.dat for AOK:TC with the c-patch, and genie.dat for SWGB. Almost all of the general data sections have been identified, including the header, player colors, sounds, graphics, terrains, tech effects, unit lines (SWGB-only), unit globals, civilizations (including units), and technologies. Below are summaries of these sections.
Contents |
Graphic data
Graphic data (also known as "graphic slots") are information on the interpretation of SLPs. Research is still being made into the structure of this data, but the following is known:
- Each contains the internal name twice. The internal name seems to always be 8 bytes in length. The first is followed by 13 bytes of NULLs, the second by 5.
- After that is a 2-byte value specifying the SLP resource ID that contains the referenced frames,
- followed by 21 bytes of unknown values,
- followed by a 2-byte value specifying the number of frames per rotation are present in the SLP,
- followed by a 2-byte value specifying the number of directions present in the SLP.
Example: Archer's attack
41524348525F414E0000000000000000000000000041524348525F414E00 0000000002000000000114FFFF0100000000000000000300FFFF010A0008
0000000000295C8F3D000000000373020600D00800000000000000000000 FFFF0000FFFF00000000000000000000FFFF000072020000000000000000
0000FFFF00000500380107003A01FFFFFFFF0500380107003A01FFFFFFFF 0500380107003A01FFFFFFFF0500380107003A01FFFFFFFF050038010700
3A01FFFFFFFF0500380107003A01FFFFFFFF0500380107003A01FFFFFFFF 0500380107003A01FFFFFFFF
- 41524348525F414E: Internal String "ARCHR_AN"
- 0200: SLP Resource ID (2)
- 0A00: Frame(s) per direction (10)
- 0800: Directions (8)
Find out more in this thread.
Terrain data
Terrain data is stored in the following structure:
struct genie_terrain
{
short unknown1, unknown2;
char name1[TERRAIN_NAME1_SIZE];
char name2[TERRAIN_NAME2_SIZE];
long slp_id;
long unused1; //always 0
long unknown3;
long unknown4;
long unknown5;
long color;
char unknown6[TERRAIN_UNKWN_SIZE];
};
name1, name2
These are two internal names for the terrain. Both names are 13 bytes in AOK and 17 in SWGB.
unknown4
Dominance of the terrain. Higher values dominate any values that are less, e.g. one tile Leaves on Grass will almost be not visible, as the Grass blends into the Leaves. One tile Road on Grass however will be visible, as it blends into the surrounding tiles.
unknown5
Defines which blending mode should be used for this terrain. (0-7 are used by the game).
color
These are three indices and a zero and should not be taken has RGB values.
unknown6
Completely uncharted territory. All that is known is that it is 382 bytes in AOK and 406 bytes in SWGB. It has to do with tiles and which object (if any e.g. forest) should be placed in that terrain.
Technology effect data
See main article Genie technology
Technology Effect Data, also known as "CHUN4" data, is comprised of effects a technology may have on the game. Much more is known about this data, thanks to scenario_t_c's research.

