Page 1 of 1

Player growth tracker / saved game editor

Posted: Tue Nov 29, 2022 4:10 pm
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#.

Players growth tracker.

Posted: Wed Nov 30, 2022 11:16 pm
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.

Player growth tracker / saved game editor

Posted: Mon Jan 23, 2023 9:51 pm
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!