RELEASE NSZ Title Compression Results

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by blawar, Oct 10, 2019.

  1. blawar
    OP

    blawar Developer

    pip Developer
    11
    Nov 21, 2016
    United States
    I updated the repo to support DLC and updates.
     
    gizmomelb likes this.
  2. duckbill007

    duckbill007 Advanced Member

    Newcomer
    5
    May 5, 2011
    Russia
    So, it was only PC side packer issue?
     
  3. blawar
    OP

    blawar Developer

    pip Developer
    11
    Nov 21, 2016
    United States
    Correct, Tinfoil does not require an update, nor was the spec changed.
     
  4. gunner007

    gunner007 GBAtemp Advanced Maniac

    Member
    4
    Dec 31, 2013
    United States
    Is there an easy way to script this in Windows? For now I've just been using the NSZ.PY --level 17 -C title.nsp command, but is there a way to script this so I don't need to do 1 by 1?

    Just mainly because i have 2 games with 15+ DLC and really long names.
     
  5. blawar
    OP

    blawar Developer

    pip Developer
    11
    Nov 21, 2016
    United States
    use powershell and run nsz.py --output outputdir --level 17 -C x:\nsps\*.nsp

    or you could use WSL
     
  6. gunner007

    gunner007 GBAtemp Advanced Maniac

    Member
    4
    Dec 31, 2013
    United States
    Ironically I use that folder and drive name, had tried that before but it ends up spitting out "OSError: [Errno 22] Invalid argument: 'x:\\nsps\\*.nsp'"

    Not sure where the double / is coming from.
     
  7. ShigoNaito

    ShigoNaito Member

    Newcomer
    3
    Mar 12, 2019
    Philippines
    Is there any cons to using compression lvl 22 rather then 17. Testing it on Astral Chain I found it took almost twice as long and i got another 200MB reduced from the original.
     
  8. blawar
    OP

    blawar Developer

    pip Developer
    11
    Nov 21, 2016
    United States
    only con is compression time
     
    ShigoNaito likes this.
  9. Mthodmn101

    Mthodmn101 GBAtemp Advanced Fan

    Member
    7
    Jan 31, 2008
    United States

    for %%i in (F:\*.nsp) do nsz.py --level 22 -C "%%i" --output "F:\nsz"

    add that to a text document and rename extension to .bat

    change my input directory (F:\) to where your nsps are located, and change output directory (F:\nsz) to where you want the nsz to go
     
  10. godreborn

    godreborn GBAtemp Guru

    Member
    12
    Oct 10, 2009
    United States
    is there any danger in doing this (i.e. games not decompressing or becoming corrupted)? I put compression level to 22 using @nicoboss nszip file manager. does the app verify that everything has compressed correctly or should I compress, decompress, then see if they're the same size? it's taken me a very long time to get everything named correctly, checking for corruption, checking for brickers, trimming, and renaming.
     
  11. blawar
    OP

    blawar Developer

    pip Developer
    11
    Nov 21, 2016
    United States
    nsz.py -D file.nsz

    it will decompress to nsp and verify

    also NSC_Builder has a verify function for NSZ files

    — Posts automatically merged - Please don't double post! —

    I added folder support, you can do this to compress all NSP in a directory:

    nsz.py --level 22 -C folder/to/nsps/
     
    wicksand420 likes this.
  12. JRoad

    JRoad Developer

    pip Developer
    8
    May 18, 2018
    Spain
    Only the signature verification would work for now. I have to fix the hashing one and the decryption one for them. Should be done over the weekend.
     
  13. gunner007

    gunner007 GBAtemp Advanced Maniac

    Member
    4
    Dec 31, 2013
    United States
    I'm pretty sure I downloaded the latest commits, but did --threads or -t command get removed? It was working last release, but now says invalid args.

    Edit: NVM... i just saw a recent commit where threading was removed.

    TY for the folder support!
     
    Last edited by gunner007, Oct 11, 2019
  14. godreborn

    godreborn GBAtemp Guru

    Member
    12
    Oct 10, 2009
    United States
    will nszip work for that as well? I think it's verifying the files after compression, but I'm not really sure. should I start over with your python script?
     
  15. JRoad

    JRoad Developer

    pip Developer
    8
    May 18, 2018
    Spain
    I don't think so. I think nszip compressed too much i would probably need to rewrite the verification fully. With nsz format i can adapt my verification checking if exefs decompress well then for the hash one should be fairly similar to what the decompressor does.
     
  16. OrGoN3

    OrGoN3 GBAtemp Addict

    Member
    9
    Apr 23, 2007
    United States
    Why is the install speed increased? I understand the transfer speed increasing, but don't you need to deflate the compression first?
     
  17. KirovAir

    KirovAir Dutch Alcoholic Programmer

    Member
    6
    Dec 7, 2006
    Netherlands
    Netherlands
    The switch CPU can decrypt the data faster then the wifi (or lan) chip can transfer data. Cpu power was not the bottleneck, bandwidth was.

    This is a great addition with almost no downsides imho. Awesome work @nicoboss (and @blawar for adopting it).
     
    OrGoN3 likes this.
  18. JRoad

    JRoad Developer

    pip Developer
    8
    May 18, 2018
    Spain
    Unlike compression it decompresses really fast.
     
  19. OrGoN3

    OrGoN3 GBAtemp Addict

    Member
    9
    Apr 23, 2007
    United States
    Ah. Thanks for the clarification! Neat idea!
     
  20. godreborn

    godreborn GBAtemp Guru

    Member
    12
    Oct 10, 2009
    United States
    I can't get this to work. here's what happens:

    Microsoft Windows [Version 10.0.17763.805]
    (c) 2018 Microsoft Corporation. All rights reserved.

    E:\Switch Games>nsz.py --level 22 - C "E:\Switch Games\Nsp DLC"
    Traceback (most recent call last):
    File "E:\Switch Games\nsz.py", line 17, in <module>
    import Fs
    File "E:\Switch Games\Fs\__init__.py", line 2, in <module>
    from nut import Print
    File "E:\Switch Games\nut\__init__.py", line 7
    <!DOCTYPE html>
    ^
    SyntaxError: invalid syntax

    E:\Switch Games>

    no matter what I do I can't execute the script.

    — Posts automatically merged - Please don't double post! —

    here's what the folder looks like:

    upload_2019-10-11_17-29-37.png
     
    Last edited by godreborn, Oct 11, 2019
Quick Reply
Draft saved Draft deleted
Loading...