Home

Decoding .REC Files (Emu, 2k11)

This is a discussion on Decoding .REC Files (Emu, 2k11) within the NHL 2K forums.

Go Back   Operation Sports Forums > Hockey > Other Hockey Games > NHL 2K
Replicating the Playoffs Experience in NBA 2K24
TopSpin 2K25 Review - A Winning Return for the Series
Out Of The Park Baseball 25 Review: An Impressively Deep Managerial Experience
Reply
 
Thread Tools
Old 07-04-2023, 01:10 AM   #1
Rookie
 
SQNNET's Arena
 
OVR: 0
Join Date: Jun 2023
Decoding .REC Files (Emu, 2k11)

Hey all, recently have started messing around with emulated 2K11 with intention to get an old sim league of mine back up and running. I have the roster editing CLI tool up and running, which saves SO much time when it comes to updating attributes while also making it feasible to do so programmatically.

One of the other huge headaches that comes with running the league is recording stats, which child me did by hand. Be it on sheets of paper or Excel spreadsheets, I would literally just write down the stats I wanted to keep and call it a day.

I know that 2k11 actually keeps box score records under the Features section of the menu, where you can browse games previously played in Quick Play and see how they turned out. I've noticed the presence of a "Game Re1.REC" file in the same location as the Roster and Settings files, and I'm wondering if that would have everything I need in order to parse through games programmatically.

So all of that to pose two questions: what do we know about .REC files, and how did we go about decoding the .ROS files when that CLI tool was made? If .REC files work in a similar fashion, it would be pretty easy to just decode the .REC files and parse whatever information I want to keep.
SQNNET is offline  
Reply With Quote
Advertisements - Register to remove
Old 07-05-2023, 04:52 PM   #2
MVP
 
OVR: 0
Join Date: Aug 2007
Blog Entries: 1
Re: Decoding .REC Files (Emu, 2k11)

I figured out that the first four bytes in the roster file is a checksum calculated on the rest of the file (not the checksum itself ofcourse).
Here is python code used to calculate and write it. I hope you can figure out the blanks.

Code:
    #############################################
    # Calculates checksum of a file except beginning checksum
    def calculateChecksum(self):
        buffersize = 65536
        with open(self.absPathToFile, 'rb') as afile:
            afile.read(4) #do not read the old checksum value
            buffr = afile.read(buffersize)
            crcvalue = 0
            while len(buffr) > 0:
                crcvalue = zlib.crc32(buffr, crcvalue)
                buffr = afile.read(buffersize)
        return crcvalue
    
    #############################################
    # Calculates and stores checksum at the beginning of a file
    def writeChecksum(self):
        checksum = self.calculateChecksum()
        valueAsBytes = checksum.to_bytes(4, "big", signed=False)
        self.writeAt(0, valueAsBytes)
__________________
Now go play NHL Two K!

Download the NHL2K20 roster at:
http://PlayNHL.TK

Discussion: https://forums.operationsports.com/f...s-nhl2k11.html

Last edited by nikethebike; 07-05-2023 at 04:55 PM.
nikethebike is offline  
Reply With Quote
Old 07-06-2023, 04:26 AM   #3
Rookie
 
SQNNET's Arena
 
OVR: 0
Join Date: Jun 2023
Re: Decoding .REC Files (Emu, 2k11)

So I should have known this before rushing to a .REC conclusion-- the "box scores" under the Features tab that I'm looking for are actually stored in the corresponding .ROS file. Which means the information I'm after is somewhere in that file, as well.

Is there a TL;DR of how the roster CSV extraction works? Do we just know exactly which bytes contain player information and look only at those? Somewhere within that file is the information I'm looking to extract, which should be a good thing since there's already some knowledge surrounding it.
__________________
I'd love if this site was updated enough to let me use a VGK logo as my avatar.
SQNNET is offline  
Reply With Quote
Old 07-24-2023, 02:25 PM   #4
Rookie
 
OVR: 0
Join Date: Dec 2016
Location: UK
Re: Decoding .REC Files (Emu, 2k11)

DJ Neo who made the NHL 2K11 mod 2KHS and 2KHS lite might be worth having a chat with he knows the game very well.
__________________
https://discord.gg/BeCHnu86 Project 20s 2K10 MOD
MuzzUK is offline  
Reply With Quote
Reply


« Previous Thread | Next Thread »

« Operation Sports Forums > Hockey > Other Hockey Games > NHL 2K »



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 08:03 AM.
Top -