Player growth tracker / saved game editor

Discuss all aspects of editing the data and databases in EHM here. Have a question about the EHM Editor, EHM Assistant, editing the .cfg files, hex editing the .dat or .db files? Want to tweak the EHM exe file to change league rules/structure, start date etc? This is the place!
Forum rules
This is the forum to discuss all aspects of editing the EHM data and tweaking the game.

Have a bug or feature request for the EHM Editor? Post them in the EHM Editor thread. Please start a new thread or post in another thread if you have a question about how to use the EHM Editor.

Given the large number of questions on similar topics, we ask that you start a new thread for a new question unless you can locate a similar question in an existing thread. This will hopefully ensure that similar questions do not get buried in large threads.

Useful links: EHM 1 Assistant (Download) | EHM 1 Editor (Download) | EHM 1 Editor Tutorials | Editing Rules & Structures Guide | Converting EHM 2004 / 2005 DBs to EHM 1 | Converting an EHM 2007 DB to EHM 1 | Extra_config.cfg | Import_config.cfg | Player Roles
Post Reply
User avatar
Kaner
Junior League
Posts: 7
Joined: Tue Nov 29, 2022 4:01 pm
Custom Rank: EHM Tracker
Favourite Team: Chicago Blackhawks

Player growth tracker / saved game editor

Post by Kaner »

Hi,

I would like to create an add-on to graphically follow the player ratings growth.

I already started doing V1, but as of now, I didn't find a way to access the database of a saved game to access current player ratings.

Does anyone know a way to access the database of a saved game? I'm trying to achieve what the EHM Assistant did with the "Load Game" button.

If you have any clue, feel free to give me some tips, thanks!

PS: I'm using C#.
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Players growth tracker.

Post by archibalduk »

It depends on how you want to access the saved game. Do you want to do it via the in-game memory like the Assistant or by accessing the .sav game file like the EHM Editor? I have never tried looking at memory editing, so can't really tell you much about that. But if you're looking at processing the .sav file, I can tell you some limited information based on what I've found from experimenting:

The saved game seems to consist of a number of sub-files contained within the .sav file and the overall structure seems to be like this:

The first 12 bytes of the file are as follows

Code: Select all

int compressed_flag (so 0 = uncompressed and 1 = compressed. I don't know how to de-compress a compressed saved game)
int header_flag (not sure what this does but I think it's always set as 22)
int file_count
The next part of the saved game is an index of the sub-files which is as follows (the number of index entries is equal to the file_count integer above):

Code: Select all

unsigned int file_pos (this tells you the offset within the .sav file where the sub-file is located)
unsigned int file_size (this is the size of the sub-file in bytes)
char[260] file_name (this is a 260 character array containing the name of the sub-file)
So with the information above you can then locate a sub-file within the .sav file. You'll find that one of the sub-files is called "database.zdb" and this is the database file. I can't tell you what the database structure is but you should be able to figure it out with some trial and error using the Editor and details of the EHM 2007 database structure HERE.

You may also want to try loading a saved game in the EHM Editor v1 and then click on File -> Unpack as this will extract all of the sub-files. There's also the Data -> Saved Game Index screen which sets out the index I mention above.
User avatar
Kaner
Junior League
Posts: 7
Joined: Tue Nov 29, 2022 4:01 pm
Custom Rank: EHM Tracker
Favourite Team: Chicago Blackhawks

Player growth tracker / saved game editor

Post by Kaner »

Sorry I completely missed your message...

It'd be cool to access the in-game memory for sure, so I can have the data updated all the time. But it must be a little more complicated than using the .sav game file.

I will try using your method first and see where it leads me.

Thanks!
Post Reply