Mr. Leisurewear Posted March 11, 2018 Share Posted March 11, 2018 (edited) RDR knowledge base - Path to Rage(n)lightment Who am i ? Hello i identify myself with the nickname "Mr Leisurewear" (from the nickname that Trevor gave Steve haines in one of the mission), and in my spare time i hold myself busy with graphics programming and game programming , as this is also my profession it interests me a lot. 3 years ago i started to look into the file formats from Red Dead Redemption, because i have little time available it took me some time to gather enough info about the game. Soon a small group of people gathered around me and we started converting the whole map of RDR inside V PC which you may have known from the hyped "high profile mod Red Dead Redemption V" Link to the forum thread Shortly after i was contacted by Take Two to cease my activities , as to why you can look that up in the thread. So one year goes by and nothing changed on RDR's front , and we are nearing 1 year after the alleged C&D of our project so i decided to share my knowledge to the gta community. What the community does with this info is entirely up to them, i hope by dropping this quite large knowledge it creates some momentum towards more Redemption stuff I will be dividing the info up into sections of interest like -> META (Text , xml , tune , etc...), GFX (Graphics), SYSTEMS (Anims , sound, cutscene etc...) I will be adding info more and more by the day as i continue to find more stuff as i'm constantly researching RDR expect more to come. I can only do some pieces per day because of time limitations so if it seems a little bit too little of information please wait a few days You can always hit me up on PM for more info ! All of this info will aply to both platforms , CELL and XENON are mostly interchangeable - Standard information -Rage Package Files [xenon, cell] .RPF Version 6 Big Endian Encryption: for the Table Of Contents : AES Rijndael16 , key is inside the XEX or ELF executables of each platform , which is 32 bytes long, sometimes key of certain paltform is interchangeable with other platform Encryption: Blocksize = 128 Encryption: Key size = 256 Encryption: Ciphermode = ECB , no padding Get the Table of Contents data block size by doing -> Rpf6Header::entryCount * 20 Directory and filenames are Hashed using the Jenkins One At A time (JOAAT) Hashing algorithm The name table containing the names of each directory and file (hash) is located inside the TOC after all the entries Header: (size = 0x10) magic : int32 : 4b entrycount : int32 : 4b unknown : int32 : 4b encrypted : int32 : 4bToc: (starts right behind header block) (tocentry size = 0x20)Direntry: nameoffset : int32 : 4b flags : int32 : 4b contententryindex : uint32 : 4b contententrycount : uint32 : 4bFilentry: nameoffset : int32 : 4b size : int32 : 4b offset : unt24 : 3b Resource Type : byte : 1b flags : uint32 : 4bData block -Rage Package Files [cell] .RPF inside an .SDAT file On the PS3 the game downloads a certain amount of files inside the blu ray rpf to the internal hdd , these files are again packaged into an rpf but contained inside a Secure Data pack file (.sdat) , the file is entirely encrypted and can be decrypted using the "make_npdata" tool (google is your friend). Simply feeding this file inside the command line tool will give you the RPF and can be opened with the information above. -Reading RPF files (Pseudo code) coming in the next edits -Magnificent streaming AKA RSC's (ReSource Container files) -Before you read everything else ! In order to accomodate the insanely (by today's standards) small memory sizes of both the 360 and ps3 Rockstar decided to make everything streamable from a certain device. If a certain resource isn't needed anymore it can be unloaded from both the system and graphics memory. PS3 uses 2 seperate memory pools , the system memory which is accessible by the cell processor and the graphics memory which is accessible by the RSX graphics processor. Both are 256MB large. The 360 does it differently it uses a unified memory environment of 512MB large which both the cpu and the gpu can access. Therefore the RSC exists; which is a streamable file who's internal format is divided up into memory pages which can be easily relocated to find a suitable place inside the ram to fill up every piece of memory available efficiently. -Dissecting a Resource container The real RSC data is contained inside the 16 byte size header (0x10) Resource Container example>The header of an RSC (size = 0x10) (not always !!) magic : int32 : 4b version : uint32: 4b SysBitfield : uint32: 4b GfxBitfield : uint32: 4b Not all the RSC's used in the game contain two bitfields however all of the RSC's use at least the Sys bitfield , the Gfx bitfield is only added if the RSC also contains a Graphics segment more on that later. Notice that the magic "RSC" is actualy backwards ? , this is because both system's processors work in the Big endian order which is the least signifcant byte is first , in V / IV / Payne this will be RSC on the pc versions because intel chips use Little Endian. Therefore in C# tools you need to have a adapted Bianry reader that swaps the bytes on the fly in the stream. After these 16 bytes the actual file begins where the game data is stored. -What kind of gibberish is underneath there ? To save space on certain media devices these RSC files are compressed. Xenon rsc's use the proprietary LZX compression method which is exposed as a framework inside the Xbox development kit which only licensee's can get. Unfortunatly the method is entirely known and i will post info about that too. Cell rsc's are much simpler , just like the PC streamables for every other rage game they use the commonly used ZLIB Deflate algorithm You can identify ZLIB compressed files by this ZLIB header bytes ZLIB has multiple compression types which generate slightly different header each time , but rockstar uses only compression type which is the BEST COMPRESSION type Identifying an LZX header LZX header actually has some 2 byte header trailer , which can vary based on the file. After these headers the file begins. -Decompressing both platform RSC's Coming in next edits -GFX Coming in the next edits ! Loading more data.... Edited March 11, 2018 by Mr. Leisurewear uNi, Spider-Vice, Quant and 14 others 16 1 Link to comment Share on other sites More sharing options...
Smallo92 Posted May 5, 2018 Share Posted May 5, 2018 Do you still plan to update this? MOROCCAN MEDO 1 Link to comment Share on other sites More sharing options...
Mr. Leisurewear Posted June 6, 2018 Author Share Posted June 6, 2018 Hi there , i ghave been been really busy with work , so i couldn't post anything more. i plan todo some more updates this summer tho , but i can't really promise anything sadly ,as my time schedule is pretty variable fbiBr and CyberRock 2 Link to comment Share on other sites More sharing options...
fbiBr Posted December 9, 2020 Share Posted December 9, 2020 Hello, how do I repack the X-360 .xst files on Red Dead Redemption? I want to translate for Brazil. Could you make the tools to repack .xst files? It looks like ReSource Container files. MOROCCAN MEDO 1 Link to comment Share on other sites More sharing options...
AnymYo Posted June 26 Share Posted June 26 Is there anyone who knows how to take a look at the physics configuration from RDR1? I know a bit about how to configure the euphoria physics. I want to understand how it worked in RDR1 to create that classic western ragdoll motions in RDR2 as well. If someone with that kind of knowledge is willed to help me, please send me a PM or add me on Discord leckeres_bratgut#8804 . I know that the chances for a response are not good but I would really appreciate any help or tips! Thanks! MOROCCAN MEDO 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now