Reverse engineering from scratch

ethan on 2004-04-22T19:14:30

For some reason I am a huge fan of a very old DOS game, namely EASPORT's NHL93. As WindowsME is the last Windows version which can run the game without emulators, I'll keep it around for another few years.

There are a number of things however that aren't quite right with this game. For instance, players hardly get any penalties. And when they do, the difference between aggressive and not so aggressive players is too small (Tie Domi simply must sit on the bench far more often than, say, Pierre Turgeon).

Each player has 15 attributes attached to himself (shoothand and 14 numeric values describing his strong and weak points in the range of 0 and 100). I know that these values can be higher than 100 because there is one player (it must be a bug in the program), that has an endurance of 370 and indeed, the line he's playing on hardly fatigues at all. Now my idea was to figure out where and how the player ratings are saved among the many data files that belong to a season.

My first attempt was running the game on Linux under dosbox and do a strace on it. That showed me which files are read but the signal-to-noise ratio rendered this approach pretty useless.

Instead I am now opening the files in a hex-editor, change a few bytes and see what changes in the game. As I have never done such a thing before, it is a bit of a tedious work. But with that and Perl (which I use to read and unpack a file when I think I have identified something) I was able to decipher the way the game stores the teams's schedules. It's an easy 6-byte record per game (first two bytes are month/day, third byte home team, forth byte away team and two bytes (0xFF 0xFF) used as record separators). Figuring out that took me around half an hour.

Too bad that this was not the information I was looking for so my search continues now.


Come to the 2000s

pudge on 2004-04-28T05:24:10

Get EA's NHL 2004 or something. :)

Re:Come to the 2000s

ethan on 2004-04-28T05:48:12

I also have NHL 2003 which was alright (besides 1997, 1998, 1999 and 2000). 2004...well, maybe I'll get hold on that unexpectedly. ;-)

The recent EASPORT games certainly look awesome and are fun to play. But oddly enough, for me they are still no match for NHL93. I am playing this game in a rather odd way, I have to say. I am controlling all teams in my league, playing one third of each two teams in a game myself and have the last third be played by the computer.

This (and some other of my beloved rules) is something that cannot be done with the more recent games. The downside is that an NHL93 league is only always one year. This is much better in the recent games. But now that I have deciphered the various binary files (I am almost done with that), I can overcome this shortcoming by writing Perl scripts that parse the old league data and create a new league where the strength of the players is modified accordingly with their stats, where I can calculate players that will become free agents etc. I will also be able to have players retire and replace them with the rookies that really entered the NHL in 1994.

With that I admit that I am guilty of hyper-hubris. But happily so. ;-)

As a side issue, I wonder whether EA would possibly release the source code of this old game. After all, it's 13 years old by now and there is hardly any corporate secret in the source any longer. It would be so cool if one could modify and adopt the source to one's personal needs (and my needs are not covered by any existing game, unfortunately).