• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

Unity Compress badly compressed unity games (no install)

Darksshades

Member
Feb 7, 2020
127
411
I'm sure some of you have already seen those unity games that goes from 500 mb to 5GB when extracted from the .rar file.
And I can assure you it's not because winrar is doing some sort of magic there.
There are quite a few unity games that the devs either doesn't know how or refuses to compress the gamefiles even if there is no loss of data after decompressing(lossless compression).
You can easily identify that when the basic winrar compression does this magic resizing.

Unfortunatly unity does not make it easy to edit the game files like rpgmaker games.
There is a few installer options that compress the data for you to install but that doesn't solve the problem of size when the game is playable.

Here is an easy fix for those cases. This is a windows only workaround but I'm sure there must be similar alternative for linux and mac.
There are 2 ways to compress the files and being able to play the game at the same time.

  • First way (okay compression, a bit worst than winrar):
Right click the bigger file or folder -> at general tab click Advanced -> select "Compress contents to save disk space"

And you are done.
Windows explorer will still show the same size but if you right click the properties windows it'll show the "size in disk" size which is actually used to calculate the HD free space.
I prefer compressing only the files that have the image/audio which are the ones that usually will save most space. They are usually the 'resources.assets.resS' files.
In theory this will make the files load a bit slower when you run the game but I personally didn't see any difference at all. Maybe on a 3d AAA game this could be a problem.


  • Second way (great compression, same mpression you get from winrar):
This will use a windows tool named compact.exe (it already comes with windows 10)
The basic usage is: "compact.exe" /C /EXE:LZX PathToFileToCompress

The disadvantage of using compact instead of the windows properties one is that there is no indication the file is compressed unless you right click it and check the "size in disk"
The way to show the files compression is execute : "compact.exe" on a terminal.

I've made a few batch scripts to make it easier.
Just drag and drop the file you want into the batch file and it'll compress/decompress it.

Drag files to "compact LZX.bat" to compress
Drag files to "compact_decompress.bat" to decompress if the are
Execute "compact show.bat" will display a console listing all files inside and their compression status (which compression used and ratio)

---------------------
tl;dr
Use the batch script and drag&drop the big files onto "compact LZX.bat"
It might take a little bit depending on the size of the file.
 

mav99

Member
Jun 8, 2020
238
576
nice thought but how about using this----https://github.com/IridiumIO/CompactGUI/releases

It's a great gui that let's you use Win-10's built in compression on any file and can xpress4-16 should have no performance loss even on low end hardware and lzx brings usually small margin over but ran a few tests and saw no noticeable overhead on my 9900K