And we're back! Can you smell it in the air? It's almost football time!
Editor Progress
Link to new editor:
https://github.com/bep713/madden-fra...s/tag/3.0-beta
Alright so a lot of stuff has changed since my last update on here. The editor should be able to read/write M20 franchise files now, but I can't test the write functionality since I can't play the game yet. Back when the schedule editor released, I built the app to only read 1 specific table with hard-coded offsets. Since then, we've found a way to read and write every table in the file (probably...I don't have time to test every single thing - if you find something please let me know). This is accomplished by using the franchise schema file which you can get either by my source code on github (in the data folder) or in Frosty under Legacy explorer -> franchise -> franchise-schemas.ftx.
The new version of my editor includes a table editor which is
very raw. It's real easy to break things so
please make a backup. You'll know if you mess something up because the save won't load and/or the game will crash to desktop.
That said, you can edit most things! I'll be working on easier to use editors for common things like Player editing or Team editing. For now though, the table editor will work.
I'm going to mention this each time - Stingray68 is awesome and has helped so much.
Madden 20!
I'll be able to play M20 on August 2nd, but I was able to pre-load the data. This will be a great way to ensure the editor is backwards and forwards-compatible. There are a few things that we'll have to do each year that Madden releases:
- Get the schema XML file. - Frosty accomplished this for M19, but we don't have Frosty for M20 just yet. That won't stop us, though! I'll talk about this later.
- Add any custom schema entries to the new file (UserEntity)
- Save a franchise in the new game and open it. - Thank you Seeman22 for providing this on Discord!
- Open up a few common tables to see if everything looks right. This is the hardest part because the franchise file structure may change from year-to-year. Good tables to test: SeasonGame, Player, Team, any array table.
- Change a value and save the file. Open in the game to see if everything worked. <- WE ARE HERE but we won't get past it until I can get the game to test things out.
Reverse Engineering
NOTE - this gets pretty technical. The main point is that we have the schema file. I'm going to ramble a bit here how I got it in case anyone else is interested in reverse engineering the game's compressed data.
Alright, so as mentioned, I was able to pre-load the M20 data to my PC, which means I do have access to the game's archive (Program Files (x86)/Origin Games/Madden NFL 20/Data/). Pretty much everything you can access in Frosty exists in these directories and sub-directories...it's just a matter of extracting and replacing them (and that takes a long time to do!) Luckily for us, we just need the Franchise schema file and we don't need to replace anything either, so we really don't need Frosty for this.
The schema file for M19 was located in Data/Win32/superbundlelayout/madden_installpackage_00/cas_03.cas and it is located in that same place in M20. How do I know? Look at the schema file from M19. It starts with <FranTkData ....><!--INCLUDES--><Includes />. Open up the M20 cas_03.cas in HxD and search for <!--INCLUDES. You'll find the schema file in its compressed glory. Now we need to decompress it.
Last year, we used frostbite.bms to extract all the files from the cas.cat files....but this year there are no cas.cat files (yay). So, we can't use frostbite.bms to extract the data...but we can use it to figure out what the heck it's doing in the first place.
The frostbite.bms file is really meant to look at the layout.toc file (in Data/) and find all files and give them names that will look familiar if you use Frosty. But we have another problem. In M19, each .toc had a matching .sb file. This year, there are no .sb files.
Anyway, I went down a huge rabbit hole trying to figure out how the script retrieves the data but I actually found an unrelated helpful answer - the compression algorithm. I'm not experienced in reverse engineering, but now I'll know that once you have the compression algorithm you're pretty much golden. Well, M19 uses 'zstd' compression and
M20 uses 'lz4'. Knowing that, we can start decompressing the data. We also know when the compressed data ends because the XML will end with </FranTkData>, which we can see in the compressed section too.
The only other thing to understand here is that the data is in 'chunks' of 0x10000 bytes. Every 0x10000 bytes, there's a new lz4 header block or whatever ya call it.
In the end, I was able to get the schema! Awesome!
Next Steps
I really want to work on a stat tracker where you can keep track of historical records, stats, and schedules. Plus the ability to view player progression history by year and which team they were on that year.