[EHM 2005] EHM pre-game database format

Utilities and roster editors for Eastside Hockey Manager 2004 and 2005.
User avatar
I'm Just a Bot
Posts: 55
Joined: Mon Oct 24, 2005 10:45 pm
Custom Rank: TBL Test Account
Location: The Blue Line

[EHM 2005] EHM pre-game database format

Post by The_Blue_Line » Mon Aug 29, 2011 9:02 pm

The attached zip contains details with regards to the EHM 2005 pre-game database format. This is useful if you wish to create any utilities that edit the EHM 2005 database. This was previously posted in the SI Games forum but seeing as EHM is no longer on sale, there is every chance that this may be lost for all time if not backed up on TBL. The original thread by Graeme Kelly can be found here on SI Games' forum: http://community.sigames.com/showthread ... ase-format

Any questions regarding the EHM 2005 database format should be asked in this forum: http://www.ehmtheblueline.com/forums/viewforum.php?f=13

Download: http://1drv.ms/1AbmGwp

Here is Graeme's original post:
Graeme Kelly wrote:Hi,

I've managed to get permission to release details on the pre-game database format for NHL Eastside Hockey Manager 2005 for those of you who are interested in looking into the possibility of making an editor.

Attachments seem to be broken on this forum, so I'll post the necessary files in text format, in separate posts below. There are 2 files:

#1) database_flags.h; some defines and enums for database field values
#2) database_types.h; structure definitions of the database fields

The date format is defined as

Code: Select all

struct DATE
SHORT year
CBOOL leap_year;
In additions to what is defined in these files, the language files (*.lng in the data/database folder) are also part of the database. If you add/delete a team, nation, comp, award, city, state or injury then you'll need to update (reproduce) these files. The language structure(s) will follow too.

To round things off, you'll need the format of index.dat. This is the index to the database, and you'll need to read/write this when changing the data. It contains a quick overview of each of the *.dat files used in the game. Each of these correspond to one of the structures inside database_types.h, except staff.dat which contains staff, then nonplayer, then player data. Index entry is as follows:
<pre class="ip-ubbcode-code-pre">
typedef struct
LONG file_id;
LONG table_sz;
LONG offset;
LONG version;
The table size is the count of records. In the case of staff.dat, the first 4 bytes is the count of overall staff, and the first offset is 0. The second 4 bytes is the count of staff records, and then the offset is this * sizeof( STAFF ). Then there's the next 4 bytes which is the count of nonplayers, and so on. The others are simpler, because there is only one type of structure within the file, so all the offsets are 0.

Record IDs are generally the same as the index in the corresponding table. nat_club.dat is an exception, as this contains CLUBS records for national teams. The ID for the first one, instead of being 0, should be the number of club teams, and from there on it's incremented as normal.

The table versions can be ignored, this is when we add a field during development and don't want to break old version saved games. The table IDs can be ignored as they are used internally when loading/saving the database files. You shouldn't change these. At the start of index.dat, there are 2 (unused) LONGs which you'll need to read in too. Don't change the values.

I hope this is useful - it's all off the top of my head so there might be things missing or slightly innaccurate. I should be able to help out if anything is missing, spo just post here. There are some things which I cannot answer, but it doesn't hurt to ask. If I've forgotten anything, then just let me know and I can post them. Most of the value ranges for the various fields can be found in the posts below.

Also, the structure member alignment setting is set to 1 byte in our project settings (which is the same effect as #pragma pack(1) in the header file) so you might want to check that, if you're reading the data in blocks.

And finally....we can't release any information on the structure of the saved game. If you dig around this forum you can find that the saved game is just a bunch of files added onto each other. So, there is a header which points to each file. I can't go into more detail than that, but perhaps someone who already has worked it out can share it. Or, if you do work it out, then please do share it with others. In addition, staff.dat is different in the saved game. If you get that far, then I might be able to help out. May the force be with you.

EDIT: I've re-uploaded the file because the previous version included some SI forum tags/code in them. Just for keeping track, the previous file was downloaded 108 times.


Return to “Utilities”