[nation.dat] Nation Extractor / IIHF Team Rankings

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
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:

[nation.dat] Nation Extractor / IIHF Team Rankings

Post by archibalduk »

Today I've been taking a look at the IIHF Ranking Scores stored in the nation.dat file.

EDIT: The Nation Extractor can be downloaded here - http://www.ehmtheblueline.com/forums/vi ... =88&t=9171

I've exported the data to Excel as can be seen below (click here to see a larger screenshot):

Image

As you can see, there are four categories of data:
  • IIHF Ranking Score
  • IIHF Ranking Scores 1998 - 2003
  • Men Final Position 2001 - 2003
  • Junior Final Position 2001 - 2003
Interestingly, it seems only the IIHF Ranking Score is actually used in the database. All of the other fields are set to zero. Given that the previous IIHF Ranking Scores only cover the period 1998 until 2003, it looks as though these fields may have become defunct after EHM 2004. An alternative explanation might be that the field names/titles have simply been kept the same since EHM 2004 (it may well be a pain going through the game's code and updating the names of those fields with each yearly release of EHM).

I've tried updating the IIHF Ranking Scores for all nations according to the latest IIHF rankings. Sure enough the updated ranking scores appear in game without a problem (except for the UAE which doesn't appear in the game's ranking list - perhaps they're an inactive team/nation). However, the updated scores have no bearing on the teams selected for the World Championships or WC Division 1.

I'll experiment with the other three categories of information to see if these have any bearing on the teams selected for the WC and WC Div 1... :tiptap:
User avatar
Lazion
Second Line
Posts: 661
Joined: Tue Oct 23, 2007 5:34 pm
Favourite Team: Flyers

Re: [nation.dat] IIHF Team Rankings

Post by Lazion »

(except for the UAE which doesn't appear in the game's ranking list - perhaps they're an inactive team/nation)
Just a note.. You need to edit UAE nation Game Importance to 1-3 instead of 4 to make UAE shown in ranking list.
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: [nation.dat] IIHF Team Rankings

Post by archibalduk »

Lazion wrote:
(except for the UAE which doesn't appear in the game's ranking list - perhaps they're an inactive team/nation)
Just a note.. You need to edit UAE nation Game Importance to 1-3 instead of 4 to make UAE shown in ranking list.
Thanks. I'll set them to a three. :thup:
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: [nation.dat] IIHF Team Rankings

Post by archibalduk »

archibalduk wrote:I'll experiment with the other three categories of information to see if these have any bearing on the teams selected for the WC and WC Div 1... :tiptap:
They don't seem to make any difference.

The update IIHF Ranking Scores don't make any difference to the first season of the WC and WC Div 1, but it does affect team selection for season two onwards. Presumably the first season is hardcoded.
Midas
Minor League
Posts: 238
Joined: Sun Nov 07, 2010 5:57 am

Re: [nation.dat] IIHF Team Rankings

Post by Midas »

As I'm sure you know, that's quite a common occurance within the game as well! But incredibly cool... and, the game importance value... hmm, I will go about testing this later. There are some hardcore "defunct" nations in game (like the Soviet Union) that I should try adjusting the game values on, to see if I can revive them in game :D (as I have long desired to do!).
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: [nation.dat] IIHF Team Rankings

Post by archibalduk »

Midas wrote:There are some hardcore "defunct" nations in game (like the Soviet Union) that I should try adjusting the game values on, to see if I can revive them in game :D (as I have long desired to do!).
Heh I'm way ahead of you! :-D I tried setting the Soviet Union to Importance of 1 but it didn't make them appear in game (presumably more hardcoded things going on here). :cry: However, I got the UAE in the game by setting their importance above 4 so that they appear in the updated IIHF Rankings.

I will upload a copy of my IIHF Rankings / Reputation / Importance Editor once I've tidied it up a bit. I'm crazy busy at work at the moment, but I'll be able to find time quite soon.
User avatar
CM0304
Prospect
Posts: 82
Joined: Mon Nov 21, 2011 2:55 am

Re: [nation.dat] IIHF Team Rankings

Post by CM0304 »

NIce work archi :joy:
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: [nation.dat] IIHF Team Rankings

Post by Alessandro »

Archi, by any chance you'd manage to get where it's stored the fact that a nation is counted as EU nation? We'd need to update that 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: [nation.dat] IIHF Team Rankings

Post by archibalduk »

Alessandro wrote:Archi, by any chance you'd manage to get where it's stored the fact that a nation is counted as EU nation? We'd need to update that as well.
That's a very good point. :thup:

It looks like there is a setting for this in the Nations dat file. I can add this to my Extractor so you can edit this in Excel. I plan on finishing off this tool (and a couple of others) and getting it uploaded either today or within the next week. :-)
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: [nation.dat] IIHF Team Rankings

Post by Alessandro »

Excellent. Yah it should be pretty easy, all the old CM editors had this option. Thanks
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: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by archibalduk »

I have completed the first version of the Nation Extractor and it can be downloaded here: http://www.ehmtheblueline.com/forums/vi ... =88&t=9171

I added the ability to edit EU membership (but I haven't given it any testing). :thup:
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: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by Alessandro »

I'll test this tonight/tomorrow. Great job
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: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by Alessandro »

Working with the xpoted csv file is a huge pain in the neck. Isn't it possible to get a better-looking output file?
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: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by archibalduk »

Alessandro wrote:Working with the xpoted csv file is a huge pain in the neck. Isn't it possible to get a better-looking output file?
What are you using to edit it? If you use Excel then I think it's fine (a spreadsheet layout seems the best way to edit it all IMHO). Unfortunately csv doesn't allow for formatting, but you could save it as an XLS file with formatting and, once you have finished editing, save it back as csv (this is how I did it - as per the screenshot in the first post of this thread).
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: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by Alessandro »

How do you get it to look like the 1st post screenshot? All I get is 1 cell for any value, which is truly terrible to work with. I tried saving it as xlsx, but it stays the same
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: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by Alessandro »

Ok, NVM I got it to work

EDIT: I probably made some mistake in saving the xlsx back to csv and I can't seem to get it work. I used the import data function to get excel to visualize the file in the way I wanted to. But when I import the file it stays on "processing and importing" forever.
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: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by archibalduk »

Alessandro wrote:How do you get it to look like the 1st post screenshot? All I get is 1 cell for any value, which is truly terrible to work with. I tried saving it as xlsx, but it stays the same
Alessandro wrote:EDIT: I probably made some mistake in saving the xlsx back to csv and I can't seem to get it work. I used the import data function to get excel to visualize the file in the way I wanted to. But when I import the file it stays on "processing and importing" forever.
It sounds like you're using a different format of csv. I know some countries use ';' semi-colons instead of commas. Open up your new csv file (the one you converted from xlsx) in Notepad. What are the numbers separated by? They should be separated by commas. If not, use the find and replace function to replace them with commas. There shouldn't be anything after the final number of each row. It'll look a bit like this:

Code: Select all

0,Afghanistan,0,0,0,0,0,0,0,0,0,0,0,0,0,500,1,4
1,Albania,0,0,0,0,0,0,0,0,0,0,0,0,0,500,1,4
If you can load the csv without any problem then keep it as csv. If your Excel is having difficulties with saving to csv natively then just stick with csv and don't save as xlsx.
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: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by Alessandro »

The EU-nations stuff works :notworthy:
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: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by archibalduk »

Excellent! Maybe this is something Manimal will be interested in for his rosters.
User avatar
Manimal
TBL Admin Team
Posts: 6344
Joined: Thu Apr 24, 2008 4:01 am
Custom Rank: EHM Rosters Man
Favourite Team: Djurgårdens IF
Location: Karlstad, Sweden

Re: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by Manimal »

archibalduk wrote:Excellent! Maybe this is something Manimal will be interested in for his rosters.
Definately interested! Good work everyone!
User avatar
YZG
Second Line
Posts: 682
Joined: Mon Aug 16, 2010 11:17 pm
Custom Rank: DHM Head Researcher
Location: Canada

Re: [nation.dat] IIHF Team Rankings

Post by YZG »

archibalduk wrote:
archibalduk wrote:I'll experiment with the other three categories of information to see if these have any bearing on the teams selected for the WC and WC Div 1... :tiptap:
They don't seem to make any difference.

The update IIHF Ranking Scores don't make any difference to the first season of the WC and WC Div 1, but it does affect team selection for season two onwards. Presumably the first season is hardcoded.
Dang, too bad I missed this thread back then when it appeared... adding national teams to the game is something I played a whole lot with in my countless hours of db editing. You can actually have newly added national teams climb a lot in the IIHF rankings over the years from 0 if they have sufficiently good players, reaching even the points levels of teams in Division II and Division I (they can possibly do even better, but the Uzbek players were not good enough in my test to climb this high and they were indeed ranked at most realistic place in the rankings for their skill level). I have not, however, seen any of the better ones actually appear in Division I or Elite division World Championships, no matter if their points total ranked them consistently among mid-table division I teams. I've been afraid that the identity of the teams that promote and relegate between division I and the (unfortunately) invisible division II might be hardcoded, making it so that it's always the same bunch of teams that will yo-yo between division I and II... more testing/dat file-sneaking will be needed. I'm considering trying my hand at C++ coding and hex editing, but I'm starting at 0 and it seems like there's quite learning curve.

Actually, the current IIHF ranking depends directly on the NT's performance at the last 4 world championships and the Olympic tournament over the last 4 years, with a coefficient applied so that older results are worth less than more recent ones. Therefore, the final standings or last point totals in the rankings should not have any effect; however, the nation's history, or perhaps the competitions', if any, should.

- YZG
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: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by archibalduk »

It seems that you can affect which teams can potentially be promoted from Div II by editing both the IIHF scores and Importance. I haven't given it all that much testing because all I was looking at was to make the rankings up to date. However IIRC I was able to get the UAE into Div I for season two by stacking their IIHF score.

With regards to editing with C++, it's really not that hard at all. I knew zero about C++ until I started looking into the CSD Patch. With regards to editing the database, it is very simple and formulaic (it only gets more complex when you're doing things such as the Player Info Generator and EHM Updater - and even then it's not all that bad). I have posted a few examples in the Code Snippets Thread which might help get you started. I'm also happy to talk you through things and post code to help you, etc. I really think that the more of us who look into tweaking the database, the more we'll unlock in terms of customisation.
User avatar
YZG
Second Line
Posts: 682
Joined: Mon Aug 16, 2010 11:17 pm
Custom Rank: DHM Head Researcher
Location: Canada

Re: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by YZG »

Thanks Archi, chances are I'll be needing you at some point! I took some time to copy/paste your code to convert index.dat into csv and played with it a bit to get familiar with it. I tried to replace it by another dat file, and after a little trial and error, got it working :thup:

One interesting thing I noticed is that nation_comp.dat is not to be found anywhere into database_types.h in any way. Makes me wonder where it is defined and why it's "hidden"... that's the first one I wanted to look at! :-k

- YZG
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: [nation.dat] Nation Extractor / IIHF Team Rankings

Post by archibalduk »

Glad to hear it! :) I'm happy to post tutorials/code should you need anything - just post any requests in the C++ thread and I'll see what I can do.

IIRC the nation_comp.dat file uses the CLUB_COMPS struct just like club_comp.dat. In a similar way, both club.dat and nat_club.dat both use CLUBS. With the nat_club.dat file, the Club ID numbers follow on from club.dat (e.g. if the final club in club.dat has ID 1000 then the first club in nat_club.dat will be 1001) - the same principal might follow with the _comp.dat files.
User avatar
Lazion
Second Line
Posts: 661
Joined: Tue Oct 23, 2007 5:34 pm
Favourite Team: Flyers

Re: [nation.dat] IIHF Team Rankings

Post by Lazion »

archibalduk wrote:
Midas wrote:There are some hardcore "defunct" nations in game (like the Soviet Union) that I should try adjusting the game values on, to see if I can revive them in game :D (as I have long desired to do!).
Heh I'm way ahead of you! :-D I tried setting the Soviet Union to Importance of 1 but it didn't make them appear in game (presumably more hardcoded things going on here). :cry:
Luckily it wasn't that hardcoded. :joy:

Image
Image
Post Reply