Page 1 of 2
[nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Sat Feb 18, 2012 6:05 pm
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):
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...

Re: [nation.dat] IIHF Team Rankings
Posted: Sat Feb 18, 2012 8:04 pm
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.
Re: [nation.dat] IIHF Team Rankings
Posted: Sat Feb 18, 2012 8:50 pm
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.

Re: [nation.dat] IIHF Team Rankings
Posted: Sun Feb 19, 2012 6:37 pm
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...

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.
Re: [nation.dat] IIHF Team Rankings
Posted: Tue Feb 28, 2012 11:31 am
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

(as I have long desired to do!).
Re: [nation.dat] IIHF Team Rankings
Posted: Tue Feb 28, 2012 7:14 pm
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

(as I have long desired to do!).
Heh I'm way ahead of you!

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).

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.
Re: [nation.dat] IIHF Team Rankings
Posted: Thu Mar 08, 2012 2:59 am
by CM0304
NIce work archi

Re: [nation.dat] IIHF Team Rankings
Posted: Sun Mar 11, 2012 9:30 am
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.
Re: [nation.dat] IIHF Team Rankings
Posted: Sun Mar 11, 2012 10:23 am
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.
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.

Re: [nation.dat] IIHF Team Rankings
Posted: Sun Mar 11, 2012 11:36 am
by Alessandro
Excellent. Yah it should be pretty easy, all the old CM editors had this option. Thanks
Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Sun Mar 11, 2012 4:27 pm
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).

Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Sun Mar 11, 2012 8:39 pm
by Alessandro
I'll test this tonight/tomorrow. Great job
Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Mon Mar 12, 2012 6:22 pm
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?
Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Mon Mar 12, 2012 7:19 pm
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).
Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Mon Mar 12, 2012 7:58 pm
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
Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Mon Mar 12, 2012 8:04 pm
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.
Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Mon Mar 12, 2012 9:29 pm
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.
Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Mon Mar 12, 2012 9:44 pm
by Alessandro
The EU-nations stuff works

Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Mon Mar 12, 2012 9:47 pm
by archibalduk
Excellent! Maybe this is something Manimal will be interested in for his rosters.
Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Mon Mar 12, 2012 9:48 pm
by Manimal
archibalduk wrote:Excellent! Maybe this is something Manimal will be interested in for his rosters.
Definately interested! Good work everyone!
Re: [nation.dat] IIHF Team Rankings
Posted: Wed May 02, 2012 3:08 am
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...

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
Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Wed May 02, 2012 8:51 am
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.
Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Thu May 03, 2012 2:45 am
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
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!
- YZG
Re: [nation.dat] Nation Extractor / IIHF Team Rankings
Posted: Thu May 03, 2012 7:25 pm
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.
Re: [nation.dat] IIHF Team Rankings
Posted: Tue Dec 11, 2012 2:33 pm
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

(as I have long desired to do!).
Heh I'm way ahead of you!

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).
Luckily it wasn't that hardcoded.
