Editing league structures & rules using a hex editor / ArtMoney

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
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Editing league structures & rules using a hex editor / A

Post by Alessandro »

archibalduk wrote:I will do my best to work on a new patch file as soon as I can.
You better :-D
How are you making these changes? Are you using ArtMoney, editing the exe or modifying the saved game data?
All through ArtMoney
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

Alessandro wrote:
archibalduk wrote:I will do my best to work on a new patch file as soon as I can.
You better :-D
I might even see if I can do it tomorrow! :-p
Alessandro wrote:All through ArtMoney
Perfect! This will make life for everybody so easy. 8-)
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Editing league structures & rules using a hex editor / A

Post by Alessandro »

Ok later today I will send you the latest copy
Hobbit13
Junior League
Posts: 37
Joined: Fri Jul 13, 2007 12:05 pm
Custom Rank: UUDB & Hex Man!

Re: Editing league structures & rules using a hex editor / A

Post by Hobbit13 »

archibalduk wrote:
Alessandro wrote:
archibalduk wrote:I will do my best to work on a new patch file as soon as I can.
You better :-D
I might even see if I can do it tomorrow! :-p
That would be great! Thanks. There's no big hurry though but it would be nice to have it when the new Manimal roster is released :-)
archibalduk wrote:
Alessandro wrote:All through ArtMoney
Perfect! This will make life for everybody so easy. 8-)
Yeah that's the one thing I forgot to mention. I mean it occurred to me that we can actually edit the exe using ArtMoney as well...


And about editing the leagues, when I first changed them by hexediting the exe, there were 4 parts that I borrowed from Slovakia to make Austria into a 10 team league. The 4 parts were for changing the number of teams in a league, changing the league structure (like OT rules, number of players dressed), changing the schedule and playoff format and the last part was needed to get the playoffs to start but otherwise I didn't know what its function was. Well I have had to borrow that last part from Slovakia (by editing the exe using ArtMoney) due to having changed the playoff format for Austria (instead of originally 4 teams qualifying, I changed it to 8). But otherwise I have modified the original Austrian schedule to accomodate for the 12 teams playing each other 5 times during the regular season. It turns out that, at least for leagues that aren't split into divisions, you don't actually put in how many games each team has to play. You change the schedule so that it has the correct number of games and then in another part you edit how many times the teams play against each other and the game then allocates the teams to play each other the correct amount of times. I'll post more about this, possibly a tutorial, some time later (probably once I sooner or later get stuck).

It means though that for leagues that are coded in a simple manner, such as Austria, that I could change the league size and schedule to whatever I want! However leagues split up into divisions and leagues such as the RSL, which contracts after the 1st season and where also the schedule is a bit complicated, as well as the Allsvenskan, where in the exe there are actually more games scheduled than played, will probably be much more difficult to edit. But hopefully sometime in the future I will figure these out as well!
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

Whilst I think of it, it would be really useful if my League Patch exe file could simply load the AMT file. It would actually be really easy to do this (it is very similar to a csv file). The difficulty I will have (and this is the difficulty I have been having with loading a csv file containing offsets) is that I haven't been able to yet figure out how to use the offsets listed in an external file. Essentially, my attempts so far have truncated/mis-calculated the offsets from the file. If I can figure this out then I can make the League Patch (and the Custom Start Date Patch) compatible with the ArtMoney AMT files.
Hobbit13 wrote:But otherwise I have modified the original Austrian schedule to accomodate for the 12 teams playing each other 5 times during the regular season. It turns out that, at least for leagues that aren't split into divisions, you don't actually put in how many games each team has to play. You change the schedule so that it has the correct number of games and then in another part you edit how many times the teams play against each other and the game then allocates the teams to play each other the correct amount of times. I'll post more about this, possibly a tutorial, some time later (probably once I sooner or later get stuck).
I didn't realise it would be that simple. That really is good news. I had assumed that you would have to write out every and each game that is to take place.
Hobbit13 wrote:I'll post more about this, possibly a tutorial, some time later (probably once I sooner or later get stuck).
Thank you. That would be great. :thup:
Hobbit13 wrote:It means though that for leagues that are coded in a simple manner, such as Austria, that I could change the league size and schedule to whatever I want! However leagues split up into divisions and leagues such as the RSL, which contracts after the 1st season and where also the schedule is a bit complicated, as well as the Allsvenskan, where in the exe there are actually more games scheduled than played, will probably be much more difficult to edit. But hopefully sometime in the future I will figure these out as well!
I think it's just a matter of time until you solve it. Even for the conference system, I bet it is just a case of finding the correct settings to change the number of games/teams in each conference/division, etc.
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

I have made a start on the new League Patch (I think it should probably be called a Super Patch now!!). I won't have much spare time tomorrow, but I promise I will have it ready and uploaded by Thursday.

If you tell me what teams need to be added/removed from leagues then I can write a simple additional patch so that any database can be made compatible with League Patch. I think it is really important that the Manimal Rosters continue to be designed and set up for the unmodified EHM league structure because it is possible that not everybody will be able to use the League Patch (I know a very small number of users cannot get the CSD Patch to work without also using ArtMoney - and there are also people who have Macs). If I write an additional DB patch then it will allow those users to convert any DB for use with the League Patch.
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Editing league structures & rules using a hex editor / A

Post by Alessandro »

Me and Marek already call it superpatch :-D For now we just need to add 4 teams to the Austrian league. Automatic editing could be a problem, because if you take a team from a league, you get a hole, and you need to fill that hole... what do you think
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

How exactly do we want to modify the DB in order to be compatible with the SuperPatch? If it is simply a case of moving and/or creating teams, I can easily implement this into a patch.
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Editing league structures & rules using a hex editor / A

Post by Alessandro »

Would it be possible for you to create a command or smth like that which moves teams between leagues?
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

Alessandro wrote:Would it be possible for you to create a command or smth like that which moves teams between leagues?
Yeah, that would be easy to do. Just tell me what teams need to move where and I will do it.
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Editing league structures & rules using a hex editor / A

Post by Alessandro »

Ok great, let me know when the SP is ready to be published and I'll write a list down
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

It'll be ready tonight - for testing purposes at least.
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Editing league structures & rules using a hex editor / A

Post by Alessandro »

Ok excellent. Then do this:
HDD Olimpija Ljubljana > to Austrian EBEL
EC Dornbirn Bulldogs > to Austrian EBEL
HC Tiroler Wasserkraft Innsbruck > to Austrian EBEL
Orli Znojmo > to Austrian EBEL
HK Partizan Beograd > to Slovenian Elite League
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

Here's a first version of the SuperPatch: http://sdrv.ms/O6NszK

There's an issue with three of the offsets relating to league to 12 teams. Although the patch can read the values at those offsets, it is unable to write to them. I haven't figured out the cause of this yet. There's no reason why it shouldn't work. The only thing that makes those offsets unique is that whereas the others are located at 09xxxxxx, those three are located at 0BBxxxxx. This shouldn't make a difference however. I need to have a further look at this.

I'll get the DB converter done this weekend.
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Editing league structures & rules using a hex editor / A

Post by Alessandro »

So this is like the other one? Just a click to apply it? Should we update the db manually?
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

Alessandro wrote:So this is like the other one? Just a click to apply it? Should we update the db manually?
Yeah, just load it once you have loaded EHM. You need to load the CSD Patch too if you want the custom start date.

You'll need to update the DB manually for the time being. I'll get the DB patching bit done this weekend. At the moment, this is really just a beta for testing. The final thing will be tidier.

When the patch loads, take a look at the bottom three values listed. When I load it on mine, I get "Error" for those final three values. I've no idea why I can't modify those offsets, but I'll see what I can do.
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Editing league structures & rules using a hex editor / A

Post by Alessandro »

Nah, it doesn't work. I get a .cpp error during the game creation and the Austrian league shows just 8 teams in the standings. You need to investigate further.
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

So I take it in that case you get "error" listed for the bottom three offsets listed in the patch window too.
Hobbit13
Junior League
Posts: 37
Joined: Fri Jul 13, 2007 12:05 pm
Custom Rank: UUDB & Hex Man!

Re: Editing league structures & rules using a hex editor / A

Post by Hobbit13 »

The three offsets relating to changing the EBEL league size to 12 are located in the actual .exe file but if you open the game with ArtMoney, the offsets are at 0BBxxxxx. The reason that I couldn't change the offset that the 0BBxxxxx offset links to is because the Slovenian league (also originally with 8 teams) links to the same offset. If that offset would be changed then the game would try to load 12 teams for the Slovenian league as well...
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

It's not a problem. I just need to figure out why my patch cannot write new values to the 0BBxxxxx offsets. It can read them okay, but writing is problematic. I'll work on it this weekend.
fredriklarsson41
Junior League
Posts: 13
Joined: Sun Oct 02, 2011 6:09 pm

Re: Editing league structures & rules using a hex editor / A

Post by fredriklarsson41 »

Is the swedish allsvenskan changed in the superpatch? So teams 1-3 goes to qualification league and 4-7 playoff?
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

I have found the cause of the SuperPatch error. The area where the the 00BBxxxx values are located is read only memory:

Image

Thus I need to figure out how to unprotect that area of memory (ArtMoney must do this automatically when you edit this area of memory). Unfortunately it involves more .NET coding - I hate .NET!! :D
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:

Re: Editing league structures & rules using a hex editor / A

Post by archibalduk »

Here is version 0.2: http://sdrv.ms/T9Gspo

I have fixed the issue about the protected memory. The patch unprotects the memory, applies the changes and then protects it again. It seems to work fine now in that it applies the changes, but I don't have time to properly test it today (nor write the DB patcher yet) and so I'm simply releasing as-is.

Please note that you must close ArtMoney whilst you apply the Patch. It seems ArtMoney interferes with my patch in that it prevents it from modifying the memory access. You can re-load ArtMoney once you have run the patch, if you like.
User avatar
Lazion
Second Line
Posts: 661
Joined: Tue Oct 23, 2007 5:34 pm
Favourite Team: Flyers

Re: Editing league structures & rules using a hex editor / A

Post by Lazion »

Is it required to run superpatch when loading game?

Also is it possible to change league point system via ArtMoney? I know where this is located in temp files, but it would be cool to get 3 points from game win in Mestis and Suomi Division instead of 2 using this awesome superpatch.
Hobbit13
Junior League
Posts: 37
Joined: Fri Jul 13, 2007 12:05 pm
Custom Rank: UUDB & Hex Man!

Re: Editing league structures & rules using a hex editor / A

Post by Hobbit13 »

You're gonna have to run the superpatch file every time you load up EHM if you want to play with the updated rules. Also your DB has to have 12 teams in the EBEL.

If I remember correctly, then the point system is edited by the same part that changes other league rules for the regular season, like OT and shootout, two-line passes, icing, etc. So if there is another league with similar other league rules then I could change it. But as I said I'm not sure if it actually is edited in that place. I'll probably only have time to check it out in a few weeks time though...
Post Reply