CREATE and FUCK your own AI GIRLFRIEND TRY FOR FREE
x

Tool Others HTML Ren'Py YAC - Yet Another Cruncher (A Game Compactor) [V3.5]

What do you think?

  • Haven't tried it yet...

    Votes: 44 38.3%
  • It's great!

    Votes: 48 41.7%
  • Needs more features.

    Votes: 15 13.0%
  • Too hard to use.

    Votes: 4 3.5%
  • This thing ate my dog.

    Votes: 20 17.4%

  • Total voters
    115
  • Poll closed .

V4mpire

Member
Game Developer
Dec 20, 2020
147
269
Please try replacing the main bat file with the one I've attached to this post. Then, try running with the CMD window again. It won't fix anything, but it won't hide as much stuff and might give us a better idea of where things are failing.
This is the output of that bat file.

E:\yac>setlocal enableextensions

E:\yac>set "app_name=Yet Another Cruncher"

E:\yac>set "version_number=V3.2"

E:\yac>SETLOCAL EnableDelayedExpansion

E:\yac>md YAC_Tools\YAC_Current_Session\ 1>nul 2>&1
The system cannot find the file specified.

E:\yac>set "currentdir=E:\yac\"

E:\yac>set "pythondir=E:\yac\lib\windows-i686\"

E:\yac>set "gamedir=E:\yac\game\"

E:\yac>set "PYTHONPATH=E:\yac\lib\windows-i686\Lib"

E:\yac>title YAC V3.2 - E:\yac\

E:\yac>wmic os get OSArchitecture | find /i "32-bit" 1>NUL && set OS=32BIT || set OS=64BIT
The system cannot find the file specified.
 

hngg

Compress All The Things!
Modder
Donor
Compressor
May 26, 2019
578
2,472
This is the output of that bat file.

E:\yac>setlocal enableextensions

E:\yac>set "app_name=Yet Another Cruncher"

E:\yac>set "version_number=V3.2"

E:\yac>SETLOCAL EnableDelayedExpansion

E:\yac>md YAC_Tools\YAC_Current_Session\ 1>nul 2>&1
The system cannot find the file specified.

E:\yac>set "currentdir=E:\yac\"

E:\yac>set "pythondir=E:\yac\lib\windows-i686\"

E:\yac>set "gamedir=E:\yac\game\"

E:\yac>set "PYTHONPATH=E:\yac\lib\windows-i686\Lib"

E:\yac>title YAC V3.2 - E:\yac\

E:\yac>wmic os get OSArchitecture | find /i "32-bit" 1>NUL && set OS=32BIT || set OS=64BIT
The system cannot find the file specified.
Oh wow. Now that's really weird. That last command is just using wmic to check if you have 32-bit windows. wmic has been in windows for a very long time so it's not likely to be missing. It's like being told CMD.exe is not found.

Do you happen to be running Windows 11 and/or be a member of the Windows insider/beta program?
It seems Microsoft has deleted this file in the latest Windows 11 builds...
Here, try this version I'm uploading now, it shouldn't rely on wmic
 
Last edited:

V4mpire

Member
Game Developer
Dec 20, 2020
147
269
Oh wow. Now that's really weird. That last command is just using wmic to check if you have 32-bit windows. wmic has been in windows for a very long time so it's not likely to be missing. It's like being told CMD.exe is not found.

Do you happen to be running Windows 11 and/or be a member of the Windows insider/beta program?
It seems Microsoft has deleted this file in the latest Windows 11 builds...
Here, try this version I'm uploading now, it shouldn't rely on wmic
That works, also no, I'm still running windows 10, it was working fine until after a windows update, I'll check again but I'm quite certain I'm only getting updates that's public, so unless they've removed from Windows 10 PRO as that's what I'm running.

My system doesn't actually meet the weird official requirements for Windows 11, not that I'm in any hurry to upgrade.

1639540742217.png

On testing it actually throws the missing file error and keeps flashing and i closed it, i didn't notice until after that it appears to be processing the files still, so I will leave it run through and check it's actually done it, but that means there's still another issue
 
Last edited:

estrada777

Engaged Member
Modder
Donor
Mar 22, 2020
3,902
9,635
I'm having YAC 3.3 re-scan a large game that had an update. I saved the YAC files from the previous run so that I can tell it to skip images that were already done, and it works just fine!

This particular game has something on the order of 17k webp files. I've noticed that the deeper into the list it gets the slower the script is able to say "already crunched." I'm wondering if there is maybe a better way to process your file list so that it doesn't go so slow when it is so deep in the list. Right now I'm looking at about 1.5 seconds per image to decide it is already crunched, whereas at the beginning, when it is presumably at the top of the text file, it flies through!

At this pace it might even be faster to just start over and crunch them all again.

Update: to confirm it was the number of lines or filesize, while YAC was running I edited webp.txt and deleted the top 10k lines or so, and poof it immediately started going fast again.
 
Last edited:

estrada777

Engaged Member
Modder
Donor
Mar 22, 2020
3,902
9,635
Another issue, I notice the file "webp-header-fix.py" however I have recently experienced the header definitely NOT being fixed by YAC. I had to manually use the tool found here on the game with broken webp's AFTER running through YAC 3.3.
 

hngg

Compress All The Things!
Modder
Donor
Compressor
May 26, 2019
578
2,472
  1. Filenames with special characters are really annoying. I may be able to play around with the script to get things like "!", "?", and "," handled more gracefully.

  2. Regarding the compression checks, the script runs through the entire list of previously compressed files starting from the top and stops as soon as a match is found. This is very efficient in the beginning but as you've discovered, slows down quite a bit after several thousand files have been processed. Organizing the list into a tree structure so that only files in the same folder are checked, or maybe using the first character of the file name as a starting point could help, but I'm no coding genius and it'd probably take me quite a bit of time to figure out how to implement that. Perhaps I'll be able to kill two birds with a single stone while wrestling with how to implement multi-threading with file tracking.

  3. Despite including the file, I do not believe I've ever used the webp header fix; I haven't needed to on the games I've tested with. That said, I may look into that.
I've honestly been really busy with work these past few months with more and more responsibilities being placed on me (and a lot of overtime) so I couldn't tell you how long any of this will take.
 
  • Like
Reactions: FAP369ZONE

estrada777

Engaged Member
Modder
Donor
Mar 22, 2020
3,902
9,635
  1. Despite including the file, I do not believe I've ever used the webp header fix; I haven't needed to on the games I've tested with. That said, I may look into that.
I've honestly been really busy with work these past few months with more and more responsibilities being placed on me (and a lot of overtime) so I couldn't tell you how long any of this will take.
Can I trigger it to use the webp header stuff?
 

Kirashi

Member
May 9, 2017
110
17
I am very sorry for the dumb question but noticed the thread was about a good compressor. Can your tool also be used for VN (I would like to collect and put a lot inside one of my HDD)
 

estrada777

Engaged Member
Modder
Donor
Mar 22, 2020
3,902
9,635
I am very sorry for the dumb question but noticed the thread was about a good compressor. Can your tool also be used for VN (I would like to collect and put a lot inside one of my HDD)
It compresses audio, video, and image files inside a VN's game directory. Because it replaces the originals then you can use it directly on each of your games in your library.
 

Kirashi

Member
May 9, 2017
110
17
It compresses audio, video, and image files inside a VN's game directory. Because it replaces the originals then you can use it directly on each of your games in your library.
Considering the audios, videos and images are never free acess for VN, the tool won't be compatible?
 

estrada777

Engaged Member
Modder
Donor
Mar 22, 2020
3,902
9,635
Considering the audios, videos and images are never free acess for VN, the tool won't be compatible?
Not sure what you mean by free access.
If you are talking about RPA files, then you have to un-archive them using the unren tool.
 

d3nial1

Newbie
Jun 16, 2019
53
128
Is there any shortcut to "UN - Unarchive renpy files"? I want it to unarchive the files as soon as I open this .bat file. I think its possible by changing the codes inside .bat but I don't know what to do
 

hngg

Compress All The Things!
Modder
Donor
Compressor
May 26, 2019
578
2,472
Is there any shortcut to "UN - Unarchive renpy files"? I want it to unarchive the files as soon as I open this .bat file. I think its possible by changing the codes inside .bat but I don't know what to do
Modify the main .bat file, starting at line 38. Change it from this:
1654984787079.png
to this:
1654984823742.png
 
  • Like
Reactions: d3nial1
Apr 21, 2019
87
91
Hey, I really love your work, since you have the experience I'd like you ask a few questions (if you don't mind ofc).

  • Is there a source code for the script? I see that it's free to modify but I'm not sure where the code is

  • With video codecs it's quite tricky, I'm mainly focusing on compressing for android but here's the thing, I'm not sure why but the decoding performance is all over the place for the all codecs (h264, vp9, h265), most phones should be able to hardware decode all of these codecs easily, yet it runs pretty laggy when you use Ren'py on android and play those same videos (like even if you play that video from mpv/vlc and then try to play it inside Ren'py and you'd immediately notice the difference of smoothness), do you have any insight on this? to give you an example, my phone lags with vp9 (hw decoding supported) videos on Ren'py, but it can easily play 4K HEVC content from Netflix or even 4k blu-rays (which are like 50mbps)... I'm not sure what's the culprit here is. Most phones even back from 2017 do have HW support for hevc and older codecs, newer ones even have AV1 decoding support.

  • How simple is it to compress games? as in like, do you just replace the image/video files with the new files and the engine should display them, or is there more tinkering to do in the game's code (beside checking resolution limit issues)?

  • Do you reckon that it's possible to modify Ren'py source code to use newer ffmpeg, build it and then use it to display JXL images? ffmpeg did add support to JXL and a few other codecs a few months ago, not sure how Ren'py handles decoding (ffmpeg/pygame_sdl2 aren't clear but I may need to do a lot of digging) but this could be of potential, and JXL deocoding is even faster than JPEG.
 

estrada777

Engaged Member
Modder
Donor
Mar 22, 2020
3,902
9,635
Hey, I really love your work, since you have the experience I'd like you ask a few questions (if you don't mind ofc).

  • Is there a source code for the script? I see that it's free to modify but I'm not sure where the code is

  • With video codecs it's quite tricky, I'm mainly focusing on compressing for android but here's the thing, I'm not sure why but the decoding performance is all over the place for the all codecs (h264, vp9, h265), most phones should be able to hardware decode all of these codecs easily, yet it runs pretty laggy when you use Ren'py on android and play those same videos (like even if you play that video from mpv/vlc and then try to play it inside Ren'py and you'd immediately notice the difference of smoothness), do you have any insight on this? to give you an example, my phone lags with vp9 (hw decoding supported) videos on Ren'py, but it can easily play 4K HEVC content from Netflix or even 4k blu-rays (which are like 50mbps)... I'm not sure what's the culprit here is. Most phones even back from 2017 do have HW support for hevc and older codecs, newer ones even have AV1 decoding support.

  • How simple is it to compress games? as in like, do you just replace the image/video files with the new files and the engine should display them, or is there more tinkering to do in the game's code (beside checking resolution limit issues)?

  • Do you reckon that it's possible to modify Ren'py source code to use newer ffmpeg, build it and then use it to display JXL images? ffmpeg did add support to JXL and a few other codecs a few months ago, not sure how Ren'py handles decoding (ffmpeg/pygame_sdl2 aren't clear but I may need to do a lot of digging) but this could be of potential, and JXL deocoding is even faster than JPEG.
I can answer a few questions.

It's a .bat file so that is pretty much all the source code.

The engine used for rendering on Android is a giant PITA. Changes in each SDK, old as drivers for ancient GPU chips on cheap phones, ug! We've been fighting a losing battle on that front for a very long time. There were some fixes in renpy 7.5 that have (so far) seemingly made it better, but we'll see.

Yes it is that simple, compress, change the codec, whatever (nearly) you want, just leave the name the same.
 
  • Like
Reactions: Interesting_name82