Feel free to ask me questions if you need to or send me your discoveries so I can add them to the database format document.
2005-03-14: Released TDB Write v0.2. Fixed the problem with file path location.
2005-03-14: Released TDB Write v0.1. This program is a batch editor for Madden NFL 2004 or 2005 franchise/roster files.
2005-03-04: Released Maddfixen v0.1. This will fix the CRC values in Madden NFL 2004/2005 franchise/roster files for the hex-editing people out there.
2004-10-03: Released Madden Scouter v2.2. Additions:
2004-09-18: Fixed the TABLE JOIN issue with my DBD::MaddenNFL Perl module and possibly made it decode faster.
2004-09-15: Madden NFL 2005 has the same database format as Madden NFL 2004 so the existing programs will work without issue on the new version. They'll say "Detected Madden NFL 2004" (which is technically correct since they're identical formats) but that's just cosmetic. Note that I said database format because I'm sure there were a lot of changes to fields in the tables.
The Scouter takes a Madden NFL 2003, 2004, or 2005 franchise file that has been saved in the off-season and creates a comma-separated value (CSV) file of all the draftees available with their actual statistics (Overall, Speed, Agility, etc.) The CSV file can be loaded into a standard spreadsheet program (such as Microsoft Excel) so you can sort the results by position or overall rating to pick the best rookie available for your team.
I originally wrote the program because the Madden NFL 2003 draft sequence was painfully tedious to the point I came to dread the off-season. With all the fun sucked out of the game during that period, I looked for a way around their awful interface while still being able to pick a decent team. You're still limited to the standard draft pick order and frequency, so while it may be perceived as an advantage I don't see it as cheating that ruins the game experience. It is also good for those people who get extremely upset when they use their #1 draft pick on someone who ends up a 60 overall somehow.
Through a lot of work with a hex-editor, I determined the format of the file that Madden NFL uses to store its tables. It helped somewhat that I saw ODBC SQL queries embedded in the program itself. Once I had written a program that printed the contents of all the tables in the franchise file it wasn't too much extra work to make a program that looked specifically for the "PLAY" (Player) table, team #1015 (the "draft team"), and printed their statistics.
The Madden NFL file format contains an (Adler32?) checksum on all the tables and the table index. Unfortunately, I have been unable to accurately reproduce that checksum so there's no way for me to modify the saved games at the moment. If you know how the Microsoft ODBC CHECKSUM() function works, over what it checksums, and how it might be used then perhaps I could figure something out.
It'd certainly be possible to write something like that if I knew how the checksum worked. It'd take a little extra to figure out how to extend a table when it runs of the room allocated for it but that shouldn't be too hard. Since I can dump the contents of the franchise files, I could look for the differences in a fresh 2003 franchise file versus a fresh 2004 franchise file and try to write a program to fill in the gaps. But all that is just wishful thinking until the checksum is known.
From the Windows Explorer, drag your "franchise.fra" file onto the Scouter program. That'll create a "franchise.fra.csv" file that you can then import into Excel. Alternatively, you can run the program from the command-line with the file name as the parameter. If you run it from the command-line, you can specify a second parameter as the number of the team you want printed. The real teams start at 0 and, from memory, go in order alphabetically from there. There are also special teams 1010 (AFC Pro Bowl) and 1011 (NFC Pro Bowl), 1009 (free agents), 1014 (retirees), and 1015 (draft).
Make sure you save your game after "Advance to Off-season" as that's when the game creates the draftees. If you do it while it isn't the off-season then there won't be any rookies in the pool.
Instructions:
MAKE A BACKUP OF YOUR FRANCHISE/ROSTER FILE BEFORE USING THIS. IF SOMETHING GOES WRONG, IT WILL CORRUPT THE FILE.
See the sample batch file for editing examples. The parser isn't very intelligent and is quite fragile. Use my Madden Scouter program to view the list of tables and fields.
There is a limit of 8 keys per search (or it'll corrupt memory and crash) and only a single word per key for text searches. No limit on number of writes per search. You must put "flush" before changing to a new "table" and also as the last line of the file.
Thanks to Suchy for help on the CRC algorithm that made this all possible.
Run the program by either dragging the text file with instructions on top of the program (see NOTE) or by opening the command-line, changing to the directory with the program, script, and franchise file, and typing: "tdbwriteXX yourscript.txt".
MAKE A BACKUP OF YOUR FRANCHISE/ROSTER FILE BEFORE USING THIS. IF SOMETHING GOES WRONG, IT WILL CORRUPT THE FILE.
It is used just like the Madden Scouter, by dragging the franchise/roster file on top of the executable in the Windows Explorer or by running it on the command-line with the file as the only argument.
Options are:
Display your expected salary requirements from contracts and bonuses over the course of the next 7 years.
NOTE: It is recommended that you use an exported team file instead of the franchise file. The franchise file will work but you will end up with a salary report for every player in the NFL.
This Perl module provides a DBI database interface to query franchise files as if they were an SQL database. Requires SQL::Statement and DBD::File (included with DBI). If you don't know what Perl is, you don't need this. Be sure to rename the file to MaddenNFL.pm and place it in a "DBD" directory, which should itself be in the same directory as your script (or you can put this file in /usr/lib/perl5/site_perl/$VERSION/DBD/).
Also useful will be lists of the tables and fields in each year: 2005, 2004, and 2003. There's also a simple Perl test script to try queries with.
I used it today and I must say it is freakin' AWESOME! You guys are going to love it, as it adds a whole new perspective to draft day.-- Mardagg
I simmed a season to test this out, and wow its almost like cheating.-- Croydo
This section for humor purposes, mostly.
Thanks to Jim O'Connell and Bob Hanson for sending me Madden NFL 2004 franchise files to determine how the file format changed.
Football Freaks utilities forum for being interested in such a program.
-- by George Greer (m-l.org, greerga@)
Last updated:
Sun Oct 3 17:32:22 EDT 2004
Web page created: March 24, 2004