@sailwhist
I will take your example for GTA4.
Sometimes you already see what a game file
could include just by file name or folder name.
For example the following file
Code:
GTAIV\pc\audio\sfx\ambient_streams.rpf
"
sfx" just means "
sound effects" in the audio terminology. This means, you already know what is inside this file or what the file will contain mostly - namely sound/audio files of some sorts.
I don't have the game so I have to check
steamdb depot for this game and sort the file list by type. What I can see is that literally all
*.rpf files contain sound/audio files, just by looking at the file name and/or folder where the files are located.
Another example for this type is
Code:
GTAIV\pc\audio\sfx\radio_*.rpf
Just looking at all the file names beginning with
radio_ I am pretty sure all these files contain all the music for the radio stations in game, just because I know the word "radio" and the name of the radio station in the file name.
But because I don't have the game nor any of the files, I can just guess that the files contain riff-wave files, mp3 files or raw files or whatever else, because I know
msc can handle them mostly. And the post creator you have quoted said "you can use
msc but i didn't see improve ratio...", so I think my guess is correct here lol.
Next one: movie files
For bink movies (BIK or BK2) you can mostly use BinkPack (bpk), which will compress this files lossless. Just note that sometimes it will not work, either because the bink files using some sort of
alpha channel, using a codec which bpk cannot handle correctly, or - which applies to BK2 files - have a newer codec which BinkPack cannot handle at all. If you have Bink video files, you can do the following:
- Use HxD and see how the beginning of the file looks like. If the file has a "KB2n" (image) or anything greater then the "n" letter, BinkPack will fail on these files (this is mostly the case in new games, especially games which are build with unreal engine 4/5).
- Copy all the Bink video files to a test folder and use bpk on them, testing compression and decompression. Or use bpk file-by-file instead of all at once. This way you can sort out faulty ones of the list and note them somewhere, so you know what files making trouble to exclude them from bpk compression.
Next one: zlib etc.
Again back to
steamdb depot for the game GTA4, I also see "*img" files, which are 6.91 GiB in size. I would guess that these files contain all sorts of other files and textures. So now, the post you quoted sais "rest of the file zlib:max:c32m+srep:m3f:a2+lolz... ", which is including this *.img files. In other words, it seems that these *.img files are
compressed with either zlib or deflate I would say. Devs simply do this to save space. To be sure,
you can follow this little guide (to be fair this is for oodle compression, but just ignoring oodle option and using zlib option isn't that complicated).
We always want to extract all the data/streams in the game files if possible, in other words we want to decompress them (xtool/other tools) to have fully possibility of deduplication (srep) and compression (lolz/lzma/whatever else) in order to compress them even better than the original.