FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   Best Compression Methods for 'Specific' Games. Q&A (https://fileforums.com/showthread.php?t=99554)

Masquerade 16-07-2021 00:05

NieR:Automata™ [Game of the YoRHa Edition] [Build 7020666]
 
Start size: 40.3GB

Main game files:

Code:

xcrilayla+xzlib+srep+lolz
The z files inside the cpks are compressed with zlib, read more here: https://forum.xentax.com/viewtopic.php?f=10&t=16011

Videos:

Code:

srep+lzma
Ofc you can recode them to save space, but then lossy :)

Audio:

Code:

msc+srep+lzma
These .wsp files are just multiple audio files concatenated. You can use this BMS script to "extract" them, however it's imperfect. To "pack" the files again, you can use bincat by aluigi or copy /b. Not much point in trying oggre_wwise, I got better result with msc

Final size: 20.2GB

:( Sad8669 16-07-2021 02:21

panker1992

So if i want to rip an optional .wmv i have to use HeX to replace its values with 00 and then insert it back into the re_chunk_000.pak file?

I am afraid i am missing something big.

Masquerade 16-07-2021 03:30

Quote:

Originally Posted by :( Sad8669 (Post 493259)
panker1992

So if i want to rip an optional .wmv i have to use HeX to replace its values with 00 and then insert it back into the re_chunk_000.pak file?

I am afraid i am missing something big.

You are correct.

First, we start by extracting the pak file to see what's inside.

Next you find the video/file whatever you want to rip out.

Open HxD and drag into it your pak file - the "big file" - and your the file you want to rip.

Next we highlight the first few lines of the rip file on the hex side (do NOT select the decoded text side) and CTRL+C to copy the data to clipboard.

We move to the big file and CTRL+F and go to "Hex values" tab. We paste what we just copied and hit ENTER.

HxD will search the file for the matching hex values in the file. Depending on the size of the file + amount of data you selected, this can take quite long!

When HxD finds the data, it will show highlighted.

Next, we go to the top of the window and change where it says "hex" to "dec" (this is because SFK only supports decimal offsets).

Go to the start of the highlighted data that hxd presents you with, and you can right click and click Copy Offset (or ALT+INS on keyboard).

Open a notepad doc, nothing special, and paste the offset.

After copying the first offset, go back to the rip file and go right to the very bottom and copy from the bottom upwards some hex data (be careful, some videos such as binks can have repeating data at the end so you will need to copy until the data starts to differ).

Go to the big file and search again with this new hex values. Note that here, it's a good idea to set the search filter to forwards only since going backwards is useless and wastes our time!

Once you find the end offset, copy it again and paste it into the notepad.

I like to sort mine a little like this:

Code:

8476305309 - 8490311604 - example.mp4

7249864117 - 7615226644 - bonus.mp4

Now comes the patch out part. You right click in HxD in the big file and click Select Block (or CTRL+E).

Make sure your HxD is set to Dec and not hex otherwise this next step won't work (you will get an error saying "file does not contain offset")

In the first box, paste the first offset we copied. In the 2nd box, paste the second offset we copied. Ignore the length box, HxD determines it on it's own.

Now select the block and you now have the full ripped file selected within the big file.

Next, we right click, and click "Fill Selection". Choose to fill with 00s (this is selected by default, so you can just press ENTER in the window that appears). 00 is just empty space.

You will notice the hex data that was there previously now goes all to red 00s. The data has been removed. Now you can hit CTRL+S to save the file. HxD is very kind to you and makes a backup file with .bak extension of the unchanged file (again, can take a while depending on the size of the file). After done, the red 00s will become black. The file has saved. Congrats! You just ripped out a video from a big file.

To patch the video back in, we can use sfk - bat file:

Code:

sfk partcopy <ripped_file> -allfrom 0 <big_file> X -yes
Replace <ripped_file> and <big_file> with their names accordingly. Replace X with the first decimal offset we copied.

A completed bat would look something like this:

Code:

sfk partcopy example.mp4 -allfrom 0 mygame.pak 8476305309 -yes
-allfrom 0 tells SFK to copy data from the very start of the supplied file. -yes tells sfk to actually do the specified command, since otherwise it wouldn't do it.

:( Sad8669 16-07-2021 03:47

Can't thank you enough for taking your time out for me and the community.
I know how painful it is to demonstrate a Practical thing Theoretically.

This whole para, i am gonna read it carefully when i get to it.

L33THAK0R 16-07-2021 04:38

Quote:

Originally Posted by Masquerade (Post 493261)
You are correct.

First, we start by extracting the pak file to see what's inside.

Is there a public collection of file-lists for REEngine titles? Both the QuickBMS and RETool unpacking functions require a list to unpack the ".pak" archives and I can only seem to find such a list for "Devil May Cry 5".

:( Sad8669 16-07-2021 06:26

Ok so i read the whole process, everything went smoothly.

Lets talk about RE8 specifically. Ripping the video outta the big file using HxD doesn't reduce its actual size.

Then what is the point?

Or does it decreases upon compressing?

Also why patch files back once ripped? they are optional anyway, or was that a reference for universal use?

L33THAK0R 16-07-2021 06:41

Quote:

Originally Posted by :( Sad8669 (Post 493266)
Ok so i read the whole process, everything went smoothly.

Lets talk about RE8 specifically. Ripping the video outta the big file using HxD doesn't reduce its actual size.

Then what is the point?

Or does it decreases upon compressing?

Also why patch files back once ripped? they are optional anyway, or was that a reference for universal use?

I've tried and succeeded in encoding ripped videos with block information provided by panker with RE2 Remake (I don't have access to a database/list for RE2s archives), and I'm fairly confident the REEngine iteration used by RE8 also allows for this. Personally I'd offer the end-user the choice between lossless & lossy videos, which is where patching the original files back in would be beneficial. I'm fairly certain your final compressor of choice would be able to take advantage of the massive amount of blank data within the archive to achieve a smaller output.

Masquerade 16-07-2021 06:54

Quote:

Originally Posted by :( Sad8669 (Post 493266)
Ok so i read the whole process, everything went smoothly.

Lets talk about RE8 specifically. Ripping the video outta the big file using HxD doesn't reduce its actual size.

Then what is the point?

Or does it decreases upon compressing?

You're confusing replacing the space in the big file with empty space with removing the space altogether.

Imagine you have 5 different coloured squares, each compress to a varying level of goodness:

https://i.ibb.co/RjFhVnx/Untitled.png

Now, blue squares repesent videos, they don't compress well at all. So we use HxD to remove the blue square, leaving white empty space:

https://i.ibb.co/Jmkjpwd/Untitled.png

The big file size (represented by the black border around the squares) doesn't change. The space is still there, but nothing is occupying it, it's empty. Empty space compresses well, because there's nothing there to compress.

Since you took out a file that doesn't compress very well, you have just saved yourself loads of time when compressing under lolz, since lolz is slow. If you only use something like LZMA which is a bit faster, the speed gain becomes less prevalent.

Quote:

Also why patch files back once ripped? they are optional anyway, or was that a reference for universal use?
For more of a general thing, yes.

Repacks intended to be lossless, but when you remove data from a file, you break CRC perfection. So, you put the files back in and everything is fine. Ofc you can keep it out if you want, you get a smaller repack in the end.

Some games have completely unused files inside the big files - take Just Cause 4 as example, instead of fixing their videos, they just re-rendered new videos and just slapped them into the patched data folders. The old videos are still in the game, but the game just doesn't read them. IIRC there's over 3GB of unused videos in that game (including the credits video to Just Cause 3!) - so ripping them out of the archives saves you not only time in compression and final compressed size.

Other times it's useful to just patch data out in order to compress it differently. E.g. you can patch the bink videos out of Just Cause 4 and compress them with bpk, whereas if you used lolz without tampering with the archives, you'd get a larger size since lolz doesn't work on bink videos.

Hope that explanation wasn't too all over the place :D

Masquerade 16-07-2021 07:06

Quote:

Originally Posted by L33THAK0R (Post 493263)
Is there a public collection of file-lists for REEngine titles? Both the QuickBMS and RETool unpacking functions require a list to unpack the ".pak" archives and I can only seem to find such a list for "Devil May Cry 5".

https://residentevilmodding.boards.n...x-editing-tool

This may be useful to you

L33THAK0R 16-07-2021 07:22

Quote:

Originally Posted by Masquerade (Post 493269)

Thank you! This is quite the interesting list, I'll have to research how each entry is calculated (I'm guessing the process may be similar to the now abandoned, although fairly complete, "Mad Max" asset identification project that was started a while back, where each asset has to be called into memory and the resulting logs from Process Manager (windows) can be used to build a hash list), since it seems RE2 is only 2/3rds complete.

:( Sad8669 16-07-2021 07:55

Ahhh i see, that makes sense xD.

But as you said, when space is empty it compresses well, which means in the final compressed data, the size of the video will removed right?

and about the languages, panker1992 mentioned English Only and gave blocks of just ENG files but we are actually ripping languages other than English so how we get rid of other languages? or the ones mentioned were other than English?

Sorry for being a numbskull and Thanks!

panker1992 16-07-2021 08:12

hello people :D

There is a serious business here and i have created a lil bit of chaos :D

BTW my Final Size for RE8 = 16.1GB


I am explaining :D and i will take RE8 For example

This game has total of 5.9 GB of audio plus videos files
It has 9 languages which as audible not subs of anything totalling 2.25 GB
Movies Total 1.79GB
Rest is ambient Music Game Just generic Music

Why in sevel hells would anyone with a mind compress this title altogether with lolz??

What I did was simple Remove all Videos and all Audios and ambient music etc and compressed textures aka tex files from the game down to 15 GB

then i saw what video files are optional and removed them around 1GB of videos are optional how the game is made and what artist and directors did etc so all of those gone

then i took the videos the game uses for the game and re encode them making them 70% smaller.

Then i took 8 out of 9 spoken languages and completely removed them that is another 2 GB in final size.

Then i said why not re encode the audio to a mid range wem files and save another 50% on the audio size.

you separate them all pack them and patch in the files at the end.

:( Sad8669 16-07-2021 08:24

This kind of interesting chaos is always welcome.

What i asked was that, are these audio files other than English?

Code:

Block 1
721910965 807697466
731727462 em1000_v_dialogue.pck.3.x64.en

Block 2
2422899086 2493439908
2422899086 em1110_v_dialogue.pck.3.x64.en

Block 3
18114998188 18152135580
18119034210  em1150_v_dialogue.pck.3.x64.en

Block 4
20249490548 20294360582
20254537491 em1230_v_dialogue.pck.3.x64.en

Block 5
19302022331 19349746976
19302022331 em1260_v_dialogue.pck.3.x64.en

Block 6
5506437541 5556561515
5506437541 em1262_v_dialogue.pck.3.x64.en

Block 7
841520222 871463738
841520222 em1300_v_dialogue.pck.3.x64.en

Block 8
20294360583 20341650467
20294360583 em1302_v_dialogue.pck.3.x64.en

Block 9
18394439764 em1310_v_dialogue.pck.3.x64.en
18394439764 18438588281

Block 10 -- this one is 500mb
6100084475 6599324197
6100084475 pl1000_dialogue.pck.3.x64.en

Block 11 -- this one is also big 300mb
156083303 470684395
191024214 movie_chapter3_dialog.pck.3.x64.en

Block 12 
20354417983 20417554742
20361475021 em1320_v_dialogue.pck.3.x64.en

Block 13 
18251704719 em4070_v_dialogue.pck.3.x64.en
18251704719 18380860641

Block 14 
18454440446 18491950561
18454440446 em1330_v_dialogue.pck.3.x64.en

Block 15 
18217131131 18251704718
18220993113 em1370_v_dialogue.pck.3.x64.en

Block 16
20180356416 20241899672
20187235043 em4103_v_dialogue.pck.3.x64.en

Block 17
20079047866 20126111173
20079047866 em4105_v_dialogue.pck.3.x64.en

Block 18
975582092 1008712930
975582092 pl2000_dialogue.pck.3.x64.en

Block 19 Optional?
3261758961 3291738439
3265076495 movie_bonus_dialog.pck.3.x64.en

Block 20
18082008046 18103123619
18084365781 em4130_v_dialogue.pck.3.x64.en

Block 21
18606474237 18632973839
18606474237 em4104_v_dialogue.pck.3.x64.en

Block 22
18152135581 18171592518
18152135581 em4090_v_dialogue.pck.3.x64.en

Block 23
18171592519 18216296126
18171592519 em4000_v_dialogue.pck.3.x64.en

Block 24
20126111174 20144293480
20126111174 em4100_v_dialogue.pck.3.x64.en

Block 25
20144293481 20162068318
20144293481 em4101_v_dialogue.pck.3.x64.en

Block 26
20162068319 em4102_v_dialogue.pck.3.x64.en
20162068319 20180356415

Block 27
18438588282 18454440445
18440377385 em4110_v_dialogue.pck.3.x64.en

Block 28
6619741253 6630105302
6620935170 em4430_v_dialogue.pck.3.x64.en

Block 29
6601679701 6612262879
6602864723 em4400_v_dialogue.pck.3.x64.en

Block 30
956084055 967211189
956084055 em4122_v_dialogue.pck.3.x64.en

Block 31
945198973 956084054
945198973 em4121_v_dialogue.pck.3.x64.en

Block 32
937121945 em4120_v_dialogue.pck.3.x64.en
937121945 945198972

Block 33
18380860642 18394264859
18382352586 em4070_v.pck.3.x64.en

Block 34
5458135716 5506437540
5458135716 em1261_v_dialogue.pck.3.x64.en

and also why rip BGM? doesn't it make the game feel weird xD?

L33THAK0R 16-07-2021 08:28

Quote:

Originally Posted by panker1992 (Post 493275)

Then i said why not re encode the audio to a mid range wem files and save another 50% on the audio size.

Do you have a sample to listen to? I'm quite interested in how noticeable the quality loss is with ".wem" encoding!

panker1992 16-07-2021 08:43

Well,
The blocks Remove entire 9 languages at once and i chose to patch back only ENGLISH

i can show you how to patch another language instead of english if that is what you desire
GOD- i need a team chat so i can have a ncie talk with you guys

Leethakor sample is here
https://drive.google.com/file/d/1d86...ew?usp=sharing


If you find any difference i will give you my tricks and tools :D


PS Edit i forgot :D BGM = Background Music and it is patched back in after decompression :D it doesnt get lost

:( Sad8669 16-07-2021 08:46

Which Blocks are the English ones (those you patch back) lmao.

This shit is getting crazier.

Also if i extract a file and make it 00 with hex, and then patch it back, will it be the same as doing the offset process?

panker1992 16-07-2021 08:56

What you need isnt a block for language

Block = the area to cut with hex from and to from point A to point B offset 01 to offset 500 example given.

What you need to patch a file is the file to patch and the starting offset where it starts inside the gigantic file!!

it's practical usage have you seen my youtube videos where i explain how this works ?


You can pack a game Fitgirl Size if you master what i am showing here

:( Sad8669 16-07-2021 09:12

Please refer me toward the video.

panker1992 16-07-2021 09:27

Check Messages and you will find it

L33THAK0R 16-07-2021 09:47

Quote:

Originally Posted by panker1992 (Post 493279)

Wow that's pretty incredible how little the loss in quality is to the naked human ear! I'll have to start experimenting with encoded audio now! Thankfully ".wem" files are fairly easy to encode (save for titles that use some older (~2008 - 2009) Vorbis codecs).

panker1992 16-07-2021 09:52

what you saw is high quality 400kbps all the way to low quality 128kbps

i save many GB by doing this :P

L33THAK0R 16-07-2021 10:15

Quote:

Originally Posted by panker1992 (Post 493285)
what you saw is high quality 400kbps all the way to low quality 128kbps

i save many GB by doing this :P

I look forward to being able to share some similarly impressive results in the near future!

Masquerade 17-07-2021 10:34

Steel Division 2 [Build 7022650]
 
Start Size: 60.4GB

Code:

xreflate+srep+lolz
For bonus content:

Code:

precomp+srep+lolz
Final Size: 29.2GB (29.4GB with Bonus Content)

This took 18-19 hours for me in total.

L33THAK0R 17-07-2021 21:13

UPDATE: It seems it was an error on my end after-all.

Has anyone else had issues with reflate & preflate regarding "The Saboteur"? I ran reflate for a good 14hrs prior, as a first test, but alas it was still stuck at the same spot. Just want to know if it's something on my end or just the title itself, as the "Odin Engine" is a custom game-engine only used for this title (I don't know if its a fork of something like UE3 or Source, I couldn't find any documentation on it, after a brief searching period), and I'm not sure how its game-data archives function.

Masquerade 18-07-2021 02:12

Quote:

Originally Posted by L33THAK0R (Post 493295)
UPDATE: It seems it was an error on my end after-all.

Has anyone else had issues with reflate & preflate regarding "The Saboteur"? I ran reflate for a good 14hrs prior, as a first test, but alas it was still stuck at the same spot. Just want to know if it's something on my end or just the title itself, as the "Odin Engine" is a custom game-engine only used for this title (I don't know if its a fork of something like UE3 or Source, I couldn't find any documentation on it, after a brief searching period), and I'm not sure how its game-data archives function.

Try using old xtool. Also use stdio instead of using $$arc$$s, it's faster. Also, srep+lolz+bpk makes bpk useless since any bink data will be put through srep and lolz.

KaktoR 18-07-2021 03:22

Someone knows a good compressor for gif images? If possible.

L33THAK0R 18-07-2021 04:34

Quote:

Originally Posted by Masquerade (Post 493299)
Try using old xtool

Yeah ended up going with xtool 2019.

Quote:

Also use stdio instead of using $$arc$$s, it's faster
I'm still a massive newbie so got no clue what stdio is, I'll have to research this

Quote:

Also, srep+lolz+bpk makes bpk useless since any bink data will be put through srep and lolz.
I'm fully aware, the actual order of compressors for that preset is bpk + srep + lolz, but as its my own script I haven't seen the need to change that (I have ~40 copies of it on my system, spread across multiple drives to limit the impact of storage I/O limitations, making it a pain to update all of em since at least 7 instances are running at any given time). Now that I think about it I used to use a mask for the bpk compressor (srep+lolz/$BINK=bpk) until a few months back when I encountered bink video files under different extension names & within archives, and stopped using it as a mask (couldn't be bothered constantly updating the mask), which probably explains the label of the preset.

BKR-TN 18-07-2021 04:56

flexiGIF - Lossless GIF/LZW optimization
 
Quote:

Originally Posted by KaktoR (Post 493302)
Someone knows a good compressor for gif images? If possible.

You maybe want to take a look at this:
flexiGIF - Lossless GIF/LZW optimization
Quote:

Keep in mind that flexiGIF's compression is very (!) slow, magnitudes slower than a standard GIF encoder.

KaktoR 18-07-2021 05:54

Quote:

Originally Posted by BKR-TN (Post 493305)
You maybe want to take a look at this:
flexiGIF - Lossless GIF/LZW optimization

Very slow won't describe on how slow it actually is, not at all. Holy sh...

Masquerade 18-07-2021 06:31

Quote:

Originally Posted by KaktoR (Post 493306)
Very slow won't describe on how slow it actually is, not at all. Holy sh...

Precomp supports gifs, run precomp+srep+your choiceof compress

Masquerade 18-07-2021 06:34

Quote:

Originally Posted by L33THAK0R (Post 493304)
I'm still a massive newbie so got no clue what stdio is, I'll have to research this

Instead of $$arcdatafile$$.tmp $$arcpackedfile$$.tmp,you use - - <stdin> <stdout>

Example for old xtool:

Code:

packcmd = xtool e:precomp:t100p,c128m:zlib - - <stdin> <stdout>

L33THAK0R 18-07-2021 08:35

Quote:

Originally Posted by Masquerade (Post 493308)
Instead of $$arcdatafile$$.tmp $$arcpackedfile$$.tmp,you use - - <stdin> <stdout>

Example for old xtool:

Code:

packcmd = xtool e:precomp:t100p,c128m:zlib - - <stdin> <stdout>

Ah alright, I didn't think there was an actual performance difference between the two, I'll run some tests to see what the difference is!

panker1992 19-07-2021 04:28

packcmd = xtool e:precomp:t100p,c128m:zlib - <stdin> $$arcpackedfile$$.tmp

according to my endless debug with Zee this one is the best way to avoid some problems

the file will have to be copied only once before srep actually takes it in. but its best in terms of debuggery

:( Sad8669 20-07-2021 11:07

Muck
 
Code:

Method : srep:m3f:l512+lolz:dtb1:d128:mtt0:mt4:mc1023
Compression Time : 11 Minutes 4 Seconds.
Decompression Time : 6 Seconds.
Initial Size : 716.68 MB
Final Size : 109.81 MB


Masquerade 23-07-2021 03:38

The Sims 4 [v1.77.131.1030 + All DLCs]
 
Start size: 47.7GB

xzlib+srep+lolz

Soundtrack: mpz

Compressed size: 29.2GB

Takes around ~15 hours.

x86 ripped.

KaktoR 23-07-2021 03:40

Quote:

Originally Posted by Masquerade (Post 493381)
Start size: 47.7GB

xzlib+srep+lolz

Soundtrack: mpz

Compressed size: 29.2GB

Takes around ~15 hours.

xzlib+srep+4x4:lzma
30.4 GB

Takes around ~2 hours

PS: Ripped x86 stuff (Data_LE, Game_LE)

Masquerade 23-07-2021 03:45

Quote:

Originally Posted by KaktoR (Post 493382)
Takes around ~2 hours

https://i.ibb.co/Yk9gM3s/I8Iay5H.jpg
+13 hours for -1.2GB :p

:( Sad8669 23-07-2021 04:01

The pain.....

Although, two methods are appreciated in the INDEX :P.

KaktoR 23-07-2021 04:10

Quote:

Originally Posted by Masquerade (Post 493383)
https://i.ibb.co/Yk9gM3s/I8Iay5H.jpg
+13 hours for -1.2GB :p

Not a good time/output ratio if you ask me :D But I'm not a repacker who share his stuff :p

Therefore, for me 4x4:lzma is the best in time/output ratio in most cases. I just use lolz for testing stuff anyway.

:( Sad8669 24-07-2021 11:26

Is there a way to compress .awb audio files?

1:1 CRC Perfect.


All times are GMT -7. The time now is 08:57.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com