Nioh: Complete Edition

Nioh: Complete Edition

View Stats:
Schiller Nov 8, 2017 @ 10:08am
Protipp: Reduce Nioh filesize from ~70 GB to ~20 GB
Get CompactGUI: https://github.com/ImminentFate/CompactGUI/releases/tag/v2.0.0.39

It will compress Nioh from ~70 GB to ~20 GB without any performance hit whatsoever. Thank me later.


Edit: Windows 10 only!
Last edited by Schiller; Nov 8, 2017 @ 9:02pm
< >
Showing 1-15 of 32 comments
Doggo Rosso Nov 8, 2017 @ 11:12am 
Just gave it a try... It compressed my folder from 74GB to 73,9GB. Amazing!

How about some more info? What compression method to use, etc.? Most people are probably not comfortable using some shady tool on their game install with no info whatsoever.
Kiactus Nov 8, 2017 @ 11:18am 
Interesting! Thanks :D
Juicy Nov 8, 2017 @ 11:20am 
installing through steam my download was 20gb.. so i don't see a relavant reason for this post..
SkacikPL Nov 8, 2017 @ 11:28am 
Originally posted by DerDingobaron:
Just gave it a try... It compressed my folder from 74GB to 73,9GB. Amazing!

How about some more info? What compression method to use, etc.? Most people are probably not comfortable using some shady tool on their game install with no info whatsoever.
Compact is actually a windows feature since around XP times.
This "tool" is just an user interface for it.

And it's options are pretty self explanatory.
RiO Nov 8, 2017 @ 11:49am 
Originally posted by DerDingobaron:
Just gave it a try... It compressed my folder from 74GB to 73,9GB. Amazing!

How about some more info? What compression method to use, etc.? Most people are probably not comfortable using some shady tool on their game install with no info whatsoever.

It's literally a front-end UI for Windows 10's compact.exe commandline tool -- and an incredibly badly written one, at that. (I would personally not be caught dead trying to use it...)

So... let's see what compact.exe has to say...

C:\>compact /? Displays or alters the compression of files on NTFS partitions. COMPACT [/c] [/s[:dir]] [/a] [/i] [/f] [/q] [/exe[:algorithm]] [/compactos[:option] [/windir:dir]] [filename [...]] /C Compresses the specified files. Directories will be marked so that files added afterward will be compressed unless /EXE is specified. /U Uncompresses the specified files. Directories will be marked so that files added afterward will not be compressed. If /EXE is specified, only files compressed as executables will be uncompressed; if this is omitted, only NTFS compressed files will be uncompressed. /S Performs the specified operation on files in the given directory and all subdirectories. Default "dir" is the current directory. /A Displays files with the hidden or system attributes. These files are omitted by default. /I Continues performing the specified operation even after errors have occurred. By default, COMPACT stops when an error is encountered. /F Forces the compress operation on all specified files, even those which are already compressed. Already-compressed files are skipped by default. /Q Reports only the most essential information. /EXE Use compression optimized for executable files which are read frequently and not modified. Supported algorithms are: XPRESS4K (fastest) (default) XPRESS8K XPRESS16K LZX (most compact) /CompactOs Set or query the system's compression state. Supported options are: query - Query the system's Compact state. always - Compress all OS binaries and set the system state to Compact which remains unless administrator changes it. never - Uncompress all OS binaries and set the system state to non Compact which remains unless administrator changes it. /WinDir Used with /CompactOs:query, when querying the offline OS. Specifies the directory where Windows is installed. filename Specifies a pattern, file, or directory. Used without parameters, COMPACT displays the compression state of the current directory and any files it contains. You may use multiple filenames and wildcards. You must put spaces between multiple parameters.



How badly written is this front-end then?
Well...

Rather than using the Process class in .NET to call compact.exe directly, it starts up a new instance of cmd.exe -- you know; the standard command prompt -- and then instruments that by pushing WriteLine commands to it via the standard input stream.

It actually spawns 2 cmd.exe instances; first it attempts to detect the system codepage using the chcp command. Then it closes that command prompt and starts up a new one with the encoding settings matching what was read by chcp, so that output from cmd.exe can be read back correctly and doesn't end up garbled, on e.g. Russian systems.

The chchp detection is unnecessary. There's a built-in way in .NET to grab the default console encoding used on the local system. You can simply access the public static Console.OutputEncoding[msdn.microsoft.com] property to get it.

Ofcourse; this detection and setting of encoding is unnecessary in general. If you would just call compact.exe directly, instead of going through cmd.exe, you could set the input and output encodings to UTF-8 and compact.exe should happily work and send you back readably data for practically any language known to man -- and then some.




Moving on, the way the program reads from and writes to its first cmd.exe instance -- the one that does the dumb chcp detection -- is prone to deadlock because it uses a synchronous read of output, which may block on the error stream not having been read.

(Always, always use async reads for both the standard output and standard error streams if you redirect and hook them. Or you will have users ending up in deadlock states. This is not a matter of 'if', but a matter of 'when'.)




Because the program executes compact.exe through the 2nd cmd.exe instance it spawns, it has no way to know when all data has been passed through the standard output and/or error streams. It cannot wait for the process to exit, because the process it is actually listening to is cmd.exe, and not compact.exe

It would have to make an educated guess, at best. And actually it doesn't even do that.

It literally has a method called "LetsKillStuff", which is run on exit of the GUI. And yes; that does more or less exactly what its name suggests.

Said method uses the .NET Process class to create a powershell instance, much like the same extra hoop of using cmd.exe instances, and then uses taskkill.exe to force close any compact.exe instances that are in mid-flight. I hope I do not need to explain why THIS IS AN EXTREMELY BAD IDEA.
Last edited by RiO; Nov 8, 2017 @ 12:26pm
Doggo Rosso Nov 8, 2017 @ 12:08pm 
Still... I've given it several tries and it always says it only compressed 10 of like 500 files. Tried running it as an admin, same problem. And the "compress subfolders" option is enabled, obviously.
MurmUrren Nov 8, 2017 @ 12:15pm 
So why you don't make a video tutorial?
Souldrainr Nov 8, 2017 @ 12:23pm 
Originally posted by Juicy:
installing through steam my download was 20gb.. so i don't see a relavant reason for this post..
Hannibal Nov 8, 2017 @ 12:41pm 
Old.. You can right click your entire steam folder and compress it without any noticeable impact on performance and in some cases gain small amounts of performance. It's a very old gamers trick to save space. Goes something like this, windows can read a compressed file slightly faster than reading it from its uncompressed state. Some games actually pick up a 1% to 3% speed boost. It's primarily a nice way of gaining some space. I've an older laptop and the entire c and d drives are compressed. Eventually I'll end up compressing all the drives on my main system. Been doing this 15 years, never seen a slight hiccup doing it.
Last edited by Hannibal; Nov 8, 2017 @ 12:42pm
RiO Nov 8, 2017 @ 12:48pm 
Originally posted by ӇƛƝƝƖƁƛԼ:
Old.. You can right click your entire steam folder and compress it without any noticeable impact on performance and in some cases gain small amounts of performance. It's a very old gamers trick to save space. Goes something like this, windows can read a compressed file slightly faster than reading it from its uncompressed state. Some games actually pick up a 1% to 3% speed boost. It's primarily a nice way of gaining some space. I've an older laptop and the entire c and d drives are compressed. Eventually I'll end up compressing all the drives on my main system. Been doing this 15 years, never seen a slight hiccup doing it.

Regular NTFS compression is not exactly the same as the advanced settings for compact.exe in Windows 10.

You can achieve higher compression ratios with the latter, but there are some trade-offs. E.g. higher CPU usage -- also during decompression. Also, compressed state is not maintained. If a file undergoes any operation other than a plain read, it ends up back in its decompressed state.


The tool mentioned in the opening post of this thread is plain awful though. Nobody should use that junk. Just call compact.exe yourself from the commandline.
Last edited by RiO; Nov 8, 2017 @ 12:48pm
mcc Nov 8, 2017 @ 1:10pm 
Originally posted by Juicy:
installing through steam my download was 20gb.. so i don't see a relavant reason for this post..
Steam DL is the compressed file size only.
Kiactus Nov 8, 2017 @ 1:25pm 
Originally posted by Juicy:
installing through steam my download was 20gb.. so i don't see a relavant reason for this post..
The final size of Nioh is 70 GB :)
Sustain Nov 8, 2017 @ 1:32pm 
Originally posted by DerDingobaron:
Just gave it a try... It compressed my folder from 74GB to 73,9GB. Amazing!

How about some more info? What compression method to use, etc.? Most people are probably not comfortable using some shady tool on their game install with no info whatsoever.

It's just a gui for a built in tool in Windows 10, are you even on Windows 10?
It will not work on any other OS. Works perfectly fine for me and compresses Nioh to 22gb disk space with XPRESS8K Compression Algorithm.
Last edited by Sustain; Nov 8, 2017 @ 1:32pm
Schiller Nov 8, 2017 @ 9:03pm 
Originally posted by DerDingobaron:
Just gave it a try... It compressed my folder from 74GB to 73,9GB. Amazing!

How about some more info? What compression method to use, etc.? Most people are probably not comfortable using some shady tool on their game install with no info whatsoever.

I used the XPRESS16K. You also need to be on Windows 10 since it uses a Win10 feature.
TheRealPuckMain Nov 9, 2017 @ 7:53pm 
Originally posted by RiO:

How badly written is this front-end then?
Well...

You're completely right, of course - so I've patched it up hopefully. Would you mind checking v2.1's code to see if I've got any major screwups left?
Last edited by TheRealPuckMain; Nov 9, 2017 @ 9:05pm
< >
Showing 1-15 of 32 comments
Per page: 1530 50

Date Posted: Nov 8, 2017 @ 10:08am
Posts: 32