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
archibalduk
TBL Admin Team
Posts: 20373
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 »

Hobbit13 wrote:The really annoying thing about this is that in CM they don't have this problem. There, whatever you find in Olly, you also find it exactly the same in the exe so they can't help us.

So unless we figure out how EHM de-codes itself, we're gonna have to resort to using ArtMoney for these changes.
Perhaps a solution would be some sort of launcher file. You run the launcher and it loads EHM and makes the changes to the offsets in the memory. Probably something like this: http://www.d3scene.com/forum/developmen ... ogram.html

Unfortunately we'd need somebody with C++ programming skills to write the launcher. However, the tutorial I've linked to would be a very good starting point even for a novice... Maybe I'll even give it a go when I have some spare time! :dunno: :-k
User avatar
archibalduk
TBL Admin Team
Posts: 20373
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 »

Hey Marek. Would you mind posting what offsets you have found for the Czech Republic Extraliga and what they do? That would be really helpful because it'll help me find the same settings for other leagues (I'm guessing each offset is located relative to the <league name>.cpp string within Olly) - and maybe even for the World Championships. :-)
Midas
Minor League
Posts: 238
Joined: Sun Nov 07, 2010 5:57 am

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

Post by Midas »

Hobbit's the main man I learned from and explained it better than I ever could.
User avatar
archibalduk
TBL Admin Team
Posts: 20373
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 »

Midas wrote:Hobbit's the main man I learned from and explained it better than I ever could.
He's the man when it comes to editing leagues isn't he! :D :notworthy:

The reason I was asking (other than trying to understand the WC) is because I'm going to try and create an application using C++ that will adjust the start date and update the league rules/structures/etc with a simple click on a mouse button (rather than having to fiddle with ArtMoney each time). I'm new to C++ so I can't promise I'll pull it off, but I'll give it my best shot. I taught myself php, sql and css and so I'm hopeful I can create a simple C++ program...
AdamOates
Prospect
Posts: 83
Joined: Fri Nov 27, 2009 12:54 am
Location: St. Louis, MO / Los Angeles, CA

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

Post by AdamOates »

Any recent news with this project?
User avatar
archibalduk
TBL Admin Team
Posts: 20373
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 »

AdamOates wrote:Any recent news with this project?
Yes - I just happened to start a new thread asking for help researching: http://www.ehmtheblueline.com/forums/vi ... =13&t=8277
User avatar
Vapeteus
Junior League
Posts: 11
Joined: Tue Feb 14, 2006 12:30 pm
Location: Finland

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

Post by Vapeteus »

I was wondering, is it now possible to make NHL "National Hockey League". Like theres only international teams, FInland, USA etc and that those teams could only have players from that nation?
User avatar
YZG
Second Line
Posts: 682
Joined: Mon Aug 16, 2010 11:17 pm
Custom Rank: DHM Head Researcher
Location: Canada

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

Post by YZG »

It has always been possible with the pre-game editor.

EDIT: Except for the "only national players" part. But as soon as the league rules patch is released, you could make the league a zero-foreigner league and it'll work.

- YZG
User avatar
nino33
Mr. Goalie
Posts: 6088
Joined: Sat Aug 07, 2010 3:37 am
Custom Rank: Retro Rosters Specialist
Favourite Team: 1970s hockey

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

Post by nino33 »

Vapeteus wrote: theres only international teams, FInland, USA etc and that those teams could only have players from that nation?
YZG wrote:as soon as the league rules patch is released, you could make the league a zero-foreigner league and it'll work. - YZG
I'm not sure you could make each team (Finland, USA, etc) have players only from that nation, because I think the "zero-foreigners" would apply only to the single nation selected on the Club Competitions (Leagues) tab in the Editor
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 »

nino33 wrote:
Vapeteus wrote: theres only international teams, FInland, USA etc and that those teams could only have players from that nation?
YZG wrote:as soon as the league rules patch is released, you could make the league a zero-foreigner league and it'll work. - YZG
I'm not sure you could make each team (Finland, USA, etc) have players only from that nation, because I think the "zero-foreigners" would apply only to the single nation selected on the Club Competitions (Leagues) tab in the Editor
No, they are right, it will work.
User avatar
Vapeteus
Junior League
Posts: 11
Joined: Tue Feb 14, 2006 12:30 pm
Location: Finland

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

Post by Vapeteus »

That would be great, if those teams would even draft players from their nation only.
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 »

I doubt it can be done frankly
User avatar
nino33
Mr. Goalie
Posts: 6088
Joined: Sat Aug 07, 2010 3:37 am
Custom Rank: Retro Rosters Specialist
Favourite Team: 1970s hockey

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

Post by nino33 »

Alessandro wrote:No, they are right, it will work.
Alessandro wrote:I doubt it can be done frankly
So you’re saying an “international NHL” with a zero-foreigner rule would work (Finland would dress only Finish players, USA would dress only Americans, etc) but these same teams would draft players from all nations?
User avatar
Vapeteus
Junior League
Posts: 11
Joined: Tue Feb 14, 2006 12:30 pm
Location: Finland

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

Post by Vapeteus »

Just wondering, how is this coming? Can't wait to start SM-League with current EU and non-EU players rules.
User avatar
archibalduk
TBL Admin Team
Posts: 20373
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'm not sure where Alessandro and Marek are with regards to this and so cannot reply on their behalf. From my point of view, I've written a patch that allows you to put the changes into a CSV file (Excel spreadsheet) and then applies them. Unfortunately it's not perfect yet because, although it makes the changes, it crashes. I'm reading up on what the cause of the issue is and will hopefully solve it sooner or later.
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 »

Unfortunately this project is for now halted due to lack of time. We did send some changes to Archi, but unfortunately we got only crashes so far. However, we can release something as compromise once our UUDB 2012 version will be out, but I doubt it will be before Q3 2012.
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 »

nino33 wrote:
Alessandro wrote:No, they are right, it will work.
Alessandro wrote:I doubt it can be done frankly
So you’re saying an “international NHL” with a zero-foreigner rule would work (Finland would dress only Finish players, USA would dress only Americans, etc) but these same teams would draft players from all nations?
Exactly.
User avatar
Tonait
Junior League
Posts: 24
Joined: Mon Sep 19, 2011 9:15 pm
Location: Turku, Finland

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

Post by Tonait »

Hopefully somebody understand my bad english.
I just wondering can i change league rules? for example i want update Finland SM-liiga foreign players rule. 4 foreign player --> Unlimited EU- players and 3 Non-eu players.
Is it possible somehow?
User avatar
archibalduk
TBL Admin Team
Posts: 20373
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Editing the hardcoded league names (ArtMoney / Hex Editing)

Post by archibalduk »

I have set myself the challenge of renaming some of the hardcoded leagues names. In particular, I want to rename the United Hockey League the Southern Professional Hockey League and the Russian Superleague the Kontinental Hockey League.

The first method I tried was to use ArtMoney. It is pretty simple to rename any of the leagues in a saved game using this method. For example, here is the KHL:

Image

It seems that when I save the game, it saves the league name changes to the game. However, if I try to reload the game, the game crashes. Presumably this is because the game checks to ensure that the hardcoded league names are present. I managed to circumvent this by clicking on New Game -> Search and rename the league names using ArtMoney -> Press cancel in EHM to return to the main menu and then loading the saved game. This presumably works because I have renamed the hardcoded league names to match those in the saved game. However it is pretty messy because you would have to go through the New Game screen and manually change the league names each time you reload.

When changing the league names via the New Game screen, if you create the new game from this screen, the leagues will show up in game with their modified names. So this method works both for existing saved games and when starting a new game.

The additional difficulty I found with the ArtMoney method is that the offsets where the league names are located seems to change each time you load EHM (i.e. it is dynamic). There are a couple of static locations, but these aren't present or editable until you go to the New Game screen. Thus it looks unlikely I that I would be able to implement league name changes into something like the CSD Patch.

The second method is to hex edit the ehm2007.exe itself. This is much more successful because all you have to do is make the league name changes once to the exe (and also to the database) and that is it. The drawback is that you are restricted with regards to the length of the names. In most cases, the new league name cannot be any longer than the existing league name - although some league names have space for an additional one or two letters. However, I was able to circumvent this for the UHL and effectively double the space available for the league name - thereby allowing me to rename it to the SPHL (note in the screenshots that I haven't yet renamed the All-Star team names):

Image

Image

This method seems to work fine when creating new games. However it doesn't work with saved games that were saved using the old league names.
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 the hardcoded league names (ArtMoney / Hex Editi

Post by Alessandro »

Excellent. Are you going to try and circunvent the limit for the KHL too? And please have a look at my problem as Manimal DB needs me :-p
User avatar
Primis
Freeware Moderator
Posts: 1698
Joined: Tue Aug 03, 2010 7:46 pm
Location: Michigan, USA

Re: Editing the hardcoded league names (ArtMoney / Hex Editi

Post by Primis »

archibalduk wrote:I have set myself the challenge of renaming some of the hardcoded leagues names. In particular, I want to rename the United Hockey League the Southern Professional Hockey League and the Russian Superleague the Kontinental Hockey League.

It seems that when I save the game, it saves the league name changes to the game. However, if I try to reload the game, the game crashes. Presumably this is because the game checks to ensure that the hardcoded league names are present.
Is there a way to swap league/competition names, kinda' like we already have to do with teams in the editor? Essentially, can't you rename the UHL to SPHL and then use ArtMoney to rename some other defunct league/competition to the UHL so that the name is still present in the DB/savegame when the game does its check? To the point you could even create a new League/Competition that exists solely so its name can be changed to the UHL, so no other leagues/comps are compromised? Just an idea.

I really like what you're trying to do, Archi. In a perfect scenario, someone figures out a good way to rename league and change their alignment/team numbers so we can have the AHL at its proper 30 teams and get rid of the aggravating "AHL team in the ECHL" thing and scenarios like that. That's the one thing I really want is a fixed AHL and ECHL. A bonus of course would be updated rules to go along with those leagues...
User avatar
archibalduk
TBL Admin Team
Posts: 20373
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 the hardcoded league names (ArtMoney / Hex Editi

Post by archibalduk »

Alessandro wrote:And please have a look at my problem as Manimal DB needs me :-p
Haha! Patience, my friend! :D I've been taking a couple of days off from the Updater to work on the UK EIHL research for Manimal as well as some OOTP stuff. I think I've fixed the problem with the semicolon delimiters and I should have something for you this evening or tomorrow.
Alessandro wrote:Are you going to try and circunvent the limit for the KHL too?
It's not looking possible I'm afraid... but I haven't given up quite yet. The best I've been able to do so far is rename it Kontinental League (which isn't too bad, really).
Primis wrote:Is there a way to swap league/competition names, kinda' like we already have to do with teams in the editor? Essentially, can't you rename the UHL to SPHL and then use ArtMoney to rename some other defunct league/competition to the UHL so that the name is still present in the DB/savegame when the game does its check? To the point you could even create a new League/Competition that exists solely so its name can be changed to the UHL, so no other leagues/comps are compromised? Just an idea.
This is what I was initially trying, but I couldn't get it to work. I think the reason for this is as follows:

Each competition in the database has an ID number. For example, the NHL is ID# 0 and the UHL is 17. It seems, for example, that the league with ID# 17 in the database has to be named the United Hockey League. If you rename it, EHM will crash. It will crash even if you swap names with another league. However, I can get around this by using a hex editor to rename the league name stored in the exe and also making the same name change in the database. This way, I can change the name of the league that EHM expects to have ID# 17, etc. This is how I can rename the UHL to the SPHL and the original SPHL to UHL.

I'm going to see if I can swap the Norwegian League with the Italian Serie A as an extension of the above. It's a bit of a long-winded way of doing things, but it's a start. If I can find the location of the ID numbers within the exe then I might be able to do some serious swapping without having to make any changes to the database.
Primis wrote:That's the one thing I really want is a fixed AHL and ECHL.
I completely agree! I want to look at this. Whether I'll have any luck is doubtful however. It's a shame Lazion is around so much at the moment - he seemed to know quite a lot about editing rules and structures.
User avatar
archibalduk
TBL Admin Team
Posts: 20373
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 the hardcoded league names (ArtMoney / Hex Editi

Post by archibalduk »

Well, I've been trying to use Lazion's guide to league sizes (here) but no luck so far with the AHL. I guess perhaps this is because of the additional complication with regards to the league being divided into conferences and divisions...
User avatar
archibalduk
TBL Admin Team
Posts: 20373
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 - are you able to explain how you edited the exe in order to change the Austrian league to ten teams please? As an experiment, I have been trying to change the number of teams in the Danish league but without success.
User avatar
Primis
Freeware Moderator
Posts: 1698
Joined: Tue Aug 03, 2010 7:46 pm
Location: Michigan, USA

Re: Editing the hardcoded league names (ArtMoney / Hex Editi

Post by Primis »

archibalduk wrote:Well, I've been trying to use Lazion's guide to league sizes (here) but no luck so far with the AHL. I guess perhaps this is because of the additional complication with regards to the league being divided into conferences and divisions...
Ugh. Do you have to then set each Conference and Division sizes as well? That sounds ugly. That does not inspire confidence in finding a simple way to fix league sizes for the AHL and ECHL...
Post Reply