Page 2 of 2
Re: Tutorials for hexediting EHM
Posted: Tue Oct 25, 2011 1:48 am
by nino33
Hmmm.....I was able to "delete" the Stanley Cup history with a long string of FF FF FF.....
Would this work with the club_records file? By using FF FF to "delete" the whole record string? Or just the Team ID?
In this way maybe I could delete NHL club records in the club_records file, and then use the record_config file to input the records? Because the record_config file would be much easier to deal with...
Re: Tutorials for hexediting EHM
Posted: Tue Oct 25, 2011 6:53 pm
by archibalduk
Riz, Graeme Kelly or mne2 would be better placed to give a definitive answer, but here's my guess:
A long string of FF FF FF FF is the equivalent of 4,294,967,295 (
this is a handy hex -> dec calculator). So if you change a record ID number to FF FF FF FF then I wonder if you're setting the ID to that value? The game presumably wouldn't pick it up because Index.dat will have the number of records listed for the club_records.dat file (or whichever .dat file you're editing) at a much lower number than the 4+ billion. Does the game pick up records listed after the record that you changed to FF FF FF FF?
I guess what I'm saying is that it's not the proper way of doing things.
But then if it works, who cares?! 
I'm guessing is that the only disadvantage is that it may result in larger saved game files (because the blank records might be incorporated into the saved game).
Re: Tutorials for hexediting EHM
Posted: Thu Nov 24, 2011 7:07 pm
by Isles22
archibalduk wrote:Yeah it would be a big task to edit. To be honest, the best way to edit it would be to first export the staff, names and team .dat files so that you can figure out what ID each player/team has (this is something I'm interested in doing once I have time).
I have an interest in doing this as well. I've been poking around in the club.dat file and I think I have figured a few things out, but some other things are slowing down progress.
Code: Select all
struct CLUBS
{
// original data
...
LONG ClubTacticTraining[ MAX_TACTIC_TRAINING ];
...
STAFF_PTR ClubDirectorList[ DIRECTOR_SIZE ];
...
STAFF_PTR ClubSquadList[ SQUAD_SIZE ];
STAFF_PTR ClubCoachList[ COACH_SIZE ];
STAFF_PTR ClubScoutList[ SCOUT_SIZE ];
STAFF_PTR ClubPhysioList[ PHYSIO_SIZE ];
...
};
My understanding at this point is that the above fields would lead to each club having a variable record length. (since not all clubs have the same amount of staff, players etc.)
Am I on the right path with that thinking?
Also, is there a list of all the clubs in the database?
Or does anybody even know how many clubs there are in total?
I was playing around with the info from club_records. dat and I came up with 2743 clubs, is that correct?
Thanks
Re: Tutorials for hexediting EHM
Posted: Thu Nov 24, 2011 7:29 pm
by Lazion
You should look into club.dat and scroll down to very last team and check team id.
In my DB there's total of 4756 teams.
Re: Tutorials for hexediting EHM
Posted: Thu Nov 24, 2011 8:57 pm
by archibalduk
I've been doing a lot of work with the database over the past month or two and have a much greater understanding than I did before.
Each field does have a variable length but you can calculate this according to the field type. All of this information can be found in the EHM 2007 database structure (you quoted a bit of it in your post). For example STAFF_PTR is a
long which is four bytes long (= four pairs of hex). Another thing to note is that the bytes are reversed. I posted a bit more detail here:
http://www.ehmtheblueline.com/forums/vi ... 59#p129959
With some reasonably simple C/C++ it is possible to extract and reimport the .dat files using the database structure.
Re: Tutorials for hexediting EHM
Posted: Thu Nov 24, 2011 11:52 pm
by Isles22
Yes, I understand the _PTR part. My concern is with the _SIZE portion.
For Example the STAFF_PTR ClubSquadList[ SQUAD_SIZE ]; SQUAD_SIZE can vary upto 75 but it may be less.
As I see it now the length is (4 x Squad size) but the squad size is variable, so the record length would be variable.
It would be the same for Coach, Scout and Physio.
Re: Tutorials for hexediting EHM
Posted: Fri Nov 25, 2011 6:43 pm
by archibalduk
Ok, I see your question now. I'm not really sure what the ClubSquadList is for because I haven't looked at that part of the database. However,
STAFF_PTR ClubSquadList[ SQUAD_SIZE ] means that that field will be 75 bytes long. If the data stored in that field is not 75 bytes then it'll be filled with blank bytes. So even if the data in that field is not long enough, blank bytes are added to make it 75 bytes long. So each field and each record will be of a consistent length.
If it helps, I can take a look at how long each record is in any of the tables if you like. It's just a quick
sizeof() function in C.
Re: Tutorials for hexediting EHM
Posted: Sun Feb 26, 2012 8:24 pm
by nino33
archibalduk wrote:I had a quick look in HxD and can see that each record is 257 bytes long. If you look at the top of the HxD window there are three drop down boxes / text boxes. If you enter 257 into the first one then you'll be able to see one record per row.
Can anyone tell me how long the staff_comp_history file is?...
I have the "structure" that Archi posted but I can't figure it out...
archibalduk wrote:The CHAR/SHORT/LONG/etc indicate the type of data stored and the number of bytes. For example, the ClubRecordsID field is a LONG field. A LONG field is 4 bytes long (i.e. four pairs of hex). Some of the other fields in that .dat file are SHORT (=2 bytes / two pairs of hex) and others are CHAR (=1 byte / one pair of hex). CHAR, SHORT and LONG are all fields that store numbers rather than text (IIRC).
I can see "LONG" and "SHORT" in the structure (below)....but most of the lines explaining the structure have nothing indicating how long it is...
struct STAFF_COMP_HISTORIES
{
LONG StaffCompHistoryID;
CLUBS_PTR StaffCompHistoryFirstPlacedClub;
CLUBS_PTR StaffCompHistorySecondPlacedClub;
CLUBS_PTR StaffCompHistoryThirdPlacedClub;
STAFF_COMPS_PTR StaffCompHistoryStaffComp;
STAFF_PTR StaffCompHistoryFirstPlacedIndex;
STAFF_PTR StaffCompHistorySecondPlacedIndex;
STAFF_PTR StaffCompHistoryThirdPlacedIndex;
CHAR_PTR StaffCompHistoryFirstPlacedFirstName;
CHAR_PTR StaffCompHistoryFirstPlacedSecondName;
CHAR_PTR StaffCompHistorySecondPlacedFirstName;
CHAR_PTR StaffCompHistorySecondPlacedSecondName;
CHAR_PTR StaffCompHistoryThirdPlacedFirstName;
CHAR_PTR StaffCompHistoryThirdPlacedSecondName;
SHORT StaffCompHistoryYear;
};
I was hoping/thinking if I can just figure out what I'm looking at I may be able to figure it out further...
Thanks!
Re: Tutorials for hexediting EHM
Posted: Mon Feb 27, 2012 12:56 pm
by archibalduk
I think it is 58 bytes per record. I'll double check when I get home.
All of those _PTR fields are 4 bytes each (because all the _PTR types are LONG) and so is LONG. SHORT is 2 bytes.
There are 14 LONGs / _PTRs and 1 SHORT, therefore:
14 x 4 bytes = 56
1 x 2 bytes = 2
TOTAL = 58 bytes
EDIT: I have now had opportunity to check and it is 58 bytes as previously mentioned
Re: Tutorials for hexediting EHM
Posted: Wed Sep 18, 2013 6:16 pm
by Primis
*bump*
Bumping this so it's easier to find and not buried on the second page of the forum. Good, good stuff in here on swapping league rules.
Re: Tutorials for hexediting EHM
Posted: Sun Mar 09, 2014 11:47 pm
by dougr
I have a request. I've read these threads and this coding stuff is really above my head. What I'm simply looking to do through either hex editor or artmoney is edit the AHL rules from the 5 vet dressed limit either up to like 20 people or remove the limit all together. Can someone tell me how to do that?
Re: Tutorials for hexediting EHM
Posted: Mon Mar 10, 2014 12:35 am
by Primis
dougr wrote:I have a request. I've read these threads and this coding stuff is really above my head. What I'm simply looking to do through either hex editor or artmoney is edit the AHL rules from the 5 vet dressed limit either up to like 20 people or remove the limit all together. Can someone tell me how to do that?
I've successfully removed the AHL vet limit altogether, but it's been a while so bear with me. My memory on what I did might not be 100%, but I'm pretty sure this is what I did.
Open the .EXE in a hex editor, and do a search for the string "40 5C 8F" (that's the AHL's current vet limit, and the AHL is the only league to use that string IIRC) and then replace it with "F0 20 8F" (which Austria and the NHL use to denote no such restrictions). Then
save the .EXE under a new filename, and run that .EXE instead when you want to use a game with AHL with no vet limits.
If you look back on Page 1 of this thread, there are lists of the different values and what they do/mean. If can be confusing because some of them are hex, and some are not (which I think are for ArtMoney memory addresses instead, and those are octets of 8 characters... ). I've never had luck in ArtMoney myself trying stuff, so I just edit straight in a hex editor.
For hex values, just remember you want the strings with six characters (hex=six).
A handy thing to do is to copy and paste the hex values from previous posts and paste them into a Google Doc you can always get to online. That's what I did.
And FWIW, I'm not a programmer or adept at this stuff either. It takes some persistence to get comfortable doing it, but after a while with those values, you can play around with rulesets quite a bit. Not only have I removed the AHL vet limit before, I also modified the NHL ruleset so that teams could only sign and play "domestic" players for the most part (ie, Jokerit can only use Finns, and non-Finns count against a 3-foreigner limit).
Re: Tutorials for hexediting EHM
Posted: Sat Jun 07, 2014 10:08 am
by MKoivuFan
my question is if i find the world U20 in the hexeding do i just hit enter and copy and past it for U18-17 and how do i go about setting which countries go..
Re: Tutorials for hexediting EHM
Posted: Sun Nov 30, 2014 2:55 am
by MillionDollarMan
Okay so I get how to edit some of the line up rules like how many foreigners dressed. What I'm having trouble with is editing the roster rules. For example, I want to set up the UHL into a custom league and want to get rid of the max 19 players on roster requirement. Any help?
Re: Tutorials for hexediting EHM
Posted: Sun Nov 30, 2014 5:37 pm
by archibalduk
MillionDollarMan wrote:Okay so I get how to edit some of the line up rules like how many foreigners dressed. What I'm having trouble with is editing the roster rules. For example, I want to set up the UHL into a custom league and want to get rid of the max 19 players on roster requirement. Any help?
You could try using the Hardcode Editor:
http://www.ehmtheblueline.com/forums/vi ... 10&t=12295