Tool RPGM Ren'Py Cruncher - Ren'Py & RPGM MV Game Compactor [v0.4.1] [bas]

4.80 star(s) 4 Votes

bas

retired
Respected User
Donor
Former Staff
May 6, 2017
3,987
30,349
Okay Thank and what about value of '- q 80' on line 79?
Same thing. I used nconvert to reencode images already in webp format because cwebp breaks transparency in them, and used cwebp for everything else because nconvert breaks transparency in png images.

A proper solution would be to read the header of the image file to see if it's webp and ignore the file extension, but I'm lazy.
 
Jul 21, 2018
18
4
My (very limited) understanding of RPGM parallaxes is that they're the background images for maps that the player can walk about on. This works like an image map. If the color of a given pixel is changed, it breaks the image map so players can walk where they shouldn't, and cannot walk where the should be able to. Lossless doesn't change the colors, lossy does.

As for the issue that 0011 was having; cruncher works by re-encoding files to more efficient formats but leaving the filename and (just as importantly) file extensions the same. I.e., it will take a 5MB image.png, re-encode it to a lossy webp image that's maybe 200KB, but the filename/extension is still image.png. This allows you to compress assets of a game without changing any of the script/code. When an image is loaded by the game, it looks at the header of the file to decode & display, not the file extension.

cwebp breaks image transparency when re-encoding webp files. I've added nconvert to the latest couple versions of cruncher as it preserves transparency. However, it's much slower than cwebp so I only set it run on files with a webp file extension. 0011 ran cruncher on a game that had already been crunched by the author, so cwebp was run on files with png extension that were actually encoded as webp already.

Hope this helps clarify?
Hello bas, sorry to bother you again.

I use RPG Maker MV editor and RPG Maker vx ace editor, create simple movement parallaxes
create movement parallaxes use RPG Maker MV Database => Tileset Settings

Tileset Settings Create tiles by setting whether a character can walk on the image used for the tile *1
in my movement parallaxes test, i draw a Transparent Tileset area to make movement in parallaxes
and change original png, use jpg-lossy, webp-lossy-q100, webp-near_lossless
the movement still work, RPG Maker vx ace have the same result.

Thank you for your help :)

RPG Maker MV parallaxes test

============================================================
*1 Tileset Settings
 

bas

retired
Respected User
Donor
Former Staff
May 6, 2017
3,987
30,349
Hello bas, sorry to bother you again.

I use RPG Maker MV editor and RPG Maker vx ace editor, create simple movement parallaxes
create movement parallaxes use RPG Maker MV Database => Tileset Settings

Tileset Settings Create tiles by setting whether a character can walk on the image used for the tile *1
in my movement parallaxes test, i draw a Transparent Tileset area to make movement in parallaxes
and change original png, use jpg-lossy, webp-lossy-q100, webp-near_lossless
the movement still work, RPG Maker vx ace have the same result.

Thank you for your help :)

RPG Maker MV parallaxes test

============================================================
*1 Tileset Settings
Thanks for the info. I've tested the movement with several different games and had mixed results with lossy webp. In some games it broke movement, in others it did not. I believe this has to so with the version of the RPGM software used to create the game.

I'm sticking with lossless for maximum compatibility :).
 
Jul 21, 2018
18
4
Thanks for the info. I've tested the movement with several different games and had mixed results with lossy webp. In some games it broke movement, in others it did not. I believe this has to so with the version of the RPGM software used to create the game.

I'm sticking with lossless for maximum compatibility :).
hello bas, Thank you for your help,
I agree compatibility is very important.

Can you helping a test for me? i really want to know this test result.
use this png lossy color quantization compress broke movement game parallaxes.

RPGM MV official only support png file(nw.js support webp), i curious lossy png compatibility in this case.

I create a bat tool, drag a folder to compress.
command: pingo.exe -pngcolor=80 -nosrgb -nodate -noconversion -s9



 

bas

retired
Respected User
Donor
Former Staff
May 6, 2017
3,987
30,349
Just discovered that the newer versions of the RPG Maker MV engine runtime support opus audio. Grab the latest RPG Maker MV demo, throw the contents of its 'nwjs-win' in your game folder and overwrite. Bam. Your game will play .opus renamed to .ogg.

Should make for huge savings for RPG Maker MV games with lots of music or voice acting. Can do something like bgm 64k/other 48k or bgm 48k/other 32k.
I finally got around to trying this with a few older RPGM MV games and haven't been able to get it to work once. Followed your instructions and tried removing the old files it didn't overwrite as well as leaving them there. Tried using the original exe and the new exe. Please explain my stupids?

hello bas, Thank you for your help,
I agree compatibility is very important.

Can you helping a test for me? i really want to know this test result.
use this png lossy color quantization compress broke movement game parallaxes.

RPGM MV official only support png file(nw.js support webp), i curious lossy png compatibility in this case.

I create a bat tool, drag a folder to compress.
command: pingo.exe -pngcolor=80 -nosrgb -nodate -noconversion -s9



I'm sorry but I have re-read your message several times and I don't understand what you're asking for help with? Lossy image compression breaks parallaxes regardless of the image format. Assuming this is because parallaxes are mapped to specific RGB color values and lossy compression changes these values.
 

javajav

Member
Oct 31, 2019
116
321
I finally got around to trying this with a few older RPGM MV games and haven't been able to get it to work once. Followed your instructions and tried removing the old files it didn't overwrite as well as leaving them there. Tried using the original exe and the new exe. Please explain my stupids?
Apologies for the vague instructions. Just tried again with a random MV game (Kamikaze Kommittee Ouka RPG) and it worked.

Converted all files in www\audio\bgm to .opus, changed extension to .ogg and overwrote the originals. Game starts but opening cinematic has no bgm. Ovewrote the contents of the game's main folder with files from the RPG Maker MV demo (RPGMV_161W_Setup\nwjs-win - no folders, all files except package.json), re-launched the new Game.exe, and the intro cinematic had bgm from the opus-renamed-ogg files.

Demonstration attached.
 
  • Like
Reactions: bas

bas

retired
Respected User
Donor
Former Staff
May 6, 2017
3,987
30,349
Apologies for the vague instructions. Just tried again with a random MV game (Kamikaze Kommittee Ouka RPG) and it worked.

Converted all files in www\audio\bgm to .opus, changed extension to .ogg and overwrote the originals. Game starts but opening cinematic has no bgm. Ovewrote the contents of the game's main folder with files from the RPG Maker MV demo (RPGMV_161W_Setup\nwjs-win - no folders, all files except package.json), re-launched the new Game.exe, and the intro cinematic had bgm from the opus-renamed-ogg files.

Demonstration attached.
Very cool. I will try again and report back with results. Thanks
 
Jul 21, 2018
18
4
I finally got around to trying this with a few older RPGM MV games and haven't been able to get it to work once. Followed your instructions and tried removing the old files it didn't overwrite as well as leaving them there. Tried using the original exe and the new exe. Please explain my stupids?


I'm sorry but I have re-read your message several times and I don't understand what you're asking for help with? Lossy image compression breaks parallaxes regardless of the image format. Assuming this is because parallaxes are mapped to specific RGB color values and lossy compression changes these values.
hello bas, Thanks for your reply

in last reply, movement test have two result
1. In some games it broke movement, in others it did not.
2. I believe this has to so with the version of the RPGM software used to create the game.

I think RPGM software have some webp decoder issue in Specific version(nw.js, Chromium)
and parallaxes use lossy webp will trigger this.
RPGM MV official only support png file *1, lossy png still a valid png file
I curious lossy png compatibility in this case, and want test this format

png lossy compress not like other lossy format (lossy webp lossy, jpg)
don't use discrete cosine transform and subsampling, only use color quantization compress

original png
Input file: J_Darkness2.png | 596486 bytes
Image: 960x1152 pixels | 8 bits/sample | RGB & Alpha | 93277 color(s)
Delta filter: None
Filter per scanline:
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Chunks: only critical

Input file: J_Darkness2.png | 319505 bytes //lossy valid png
Image: 960x1152 pixels | 8 bits/sample | RGB & Alpha | 105837 color(s)
Delta filter: Average
Filter per scanline:
33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
Chunks: only critical

===========================================================
*1
Documentation => Asset Standards

I create a bat tool, drag a folder to compress.
command: pingo.exe -pngcolor=80 -nosrgb -nodate -noconversion -s9



 

Beastnation

Member
Sep 2, 2019
172
86
I'm trying compress images in cruncher but I'm getting this error

Webp header rewritten continuing.....

The code execution cannot proceed because VCOMP120.DLL was not found. Reinstalling prgram msy fix
I tried reinstalling but it didn't worked
 

bas

retired
Respected User
Donor
Former Staff
May 6, 2017
3,987
30,349
I'm trying compress images in cruncher but I'm getting this error

Webp header rewritten continuing.....

The code execution cannot proceed because VCOMP120.DLL was not found. Reinstalling prgram msy fix
I tried reinstalling but it didn't worked
yeah, that's nconvert - it needs the Visual C++ 2013 redistibutable, Download and run the approprate package for your version of Windows and try again:
 
Jul 21, 2018
18
4
hello bas
Can you give me those games resource (have broke movement) *1,
I want test those games to myself. thank you for your help :)

=======================================
*1 In some games it broke movement, in others it did not
 

PearlNecklaceProductions

Newbie
Game Developer
Sep 23, 2019
56
64
Hello there.

First of all, thank you for this tool, it works like a charm :)

It works on game projects (Renp'y) without any issue as well, and that is really good as it simplifies so much.
I am using version control (git) for the project, so I can better manage all the updates I did and all the images that I add left and right when I am working on a new version.

I created a second repository (another game folder) that I call lite version and is I would essentially use that version for android / web releases.
It is really easy to apply just the changes I want for the next release to the second repository and it would be ready like that.
After applying the changes, there would be some new images that weren't compressed yet and some images that were already compressed. I would like to run the compression again once I do that. Would the command go trough already compressed images again and compress them further, or would there be no change on the quality of images already converted to webp?
 

Abhai

Devoted Member
Sep 12, 2018
8,422
35,636
Hello there.

First of all, thank you for this tool, it works like a charm :)

It works on game projects (Renp'y) without any issue as well, and that is really good as it simplifies so much.
I am using version control (git) for the project, so I can better manage all the updates I did and all the images that I add left and right when I am working on a new version.

I created a second repository (another game folder) that I call lite version and is I would essentially use that version for android / web releases.
It is really easy to apply just the changes I want for the next release to the second repository and it would be ready like that.
After applying the changes, there would be some new images that weren't compressed yet and some images that were already compressed. I would like to run the compression again once I do that. Would the command go trough already compressed images again and compress them further, or would there be no change on the quality of images already converted to webp?
Hi, based on my personal experience, though not checked thoroughly - assuming the compressing parameters are the same, the already compressed images still should be altered a little (+/- a few percents changes only), unlike uncompressed where the change should be way more significant.
 

PearlNecklaceProductions

Newbie
Game Developer
Sep 23, 2019
56
64
Hi, based on my personal experience, though not checked thoroughly - assuming the compressing parameters are the same, the already compressed images still should be altered a little (+/- a few percents changes only), unlike uncompressed where the change should be way more significant.
Thank you, so assuming the change on the already compressed images is neglectable, there is no harm to be done, even if compression on them will be run multiple times (5-10 times) right?
 

Abhai

Devoted Member
Sep 12, 2018
8,422
35,636
Thank you, so assuming the change on the already compressed images is neglectable, there is no harm to be done, even if compression on them will be run multiple times (5-10 times) right?
well, in the theory, under the same settings, it should be so.
yet, it would be for the best if you test it (5-10 iterations) on a few sample images, and see it for yourself.
 
Jul 21, 2018
18
4
Hello there.

First of all, thank you for this tool, it works like a charm :)

It works on game projects (Renp'y) without any issue as well, and that is really good as it simplifies so much.
I am using version control (git) for the project, so I can better manage all the updates I did and all the images that I add left and right when I am working on a new version.

I created a second repository (another game folder) that I call lite version and is I would essentially use that version for android / web releases.
It is really easy to apply just the changes I want for the next release to the second repository and it would be ready like that.
After applying the changes, there would be some new images that weren't compressed yet and some images that were already compressed. I would like to run the compression again once I do that. Would the command go trough already compressed images again and compress them further, or would there be no change on the quality of images already converted to webp?
hello PearlNecklaceProductions
my english is not good, sorry

Don't use lossy encode in lossy format (best method),
if you want veryhigh quality(q95, q100), only compress lossy encode in lossless format

if you want medium or high quality (q70, q80, q90),
you can use lossy encode in lossy format,
but only compress once.

"even if compression on them will be run multiple times (5-10 times) right? "
no, that will break your image quality.
 

Abhai

Devoted Member
Sep 12, 2018
8,422
35,636
..."even if compression on them will be run multiple times (5-10 times) right? "
no, that will break your image quality.
here is attached that "breaking" of images quality.
perhaps you have a lot better eyes/monitor..., yet in my case there is no such "breaking"(yep there is a bit worse quality, as well as a bit smaller size), when comparing the test-image already being webp processed, and the same image after being 10x compressed again.
 

PearlNecklaceProductions

Newbie
Game Developer
Sep 23, 2019
56
64
I just made a test using few random file samples from the game and come to the conclusion it goes to compress all images again. On .jpg files, the size difference after second iteration and 10th seems to be the same in most cases I tried. Only thing that could actually be breaking the game is the .png images transparency. First iteration seems to be ok and quality decrease is hardly noticeable while size decrease is significant. Second compression on png's seems to remove transparency since everything is now white (image for example taken from renp'y with background being shown behind usually, but not now since png is over the whole screen) Since we use png's to combine characters I will just have to make sure to not compress png images multiple times, while jpg's in my opinion don't matter as much. So in conclusion, if anyone is using just .jpg format for their game, compressing multiple times doesn't seem to hurt that much.
screenshot0003.png
 
Last edited:
  • Like
Reactions: Abhai

Abhai

Devoted Member
Sep 12, 2018
8,422
35,636
yep, the png-transparency is a common, and as it seems still unresolved, problem with webp-codec itself.
if the transparency is broken, the only cure is to revert/dewbp those affected images...
 
Jul 21, 2018
18
4
here is attached that "breaking" of images quality.
perhaps you have a lot better eyes/monitor..., yet in my case there is no such "breaking"(yep there is a bit worse quality, as well as a bit smaller size), when comparing the test-image already being webp processed, and the same image after being 10x compressed again.
my english is not good, sorry

Thanks for your reply :)
the image is look fine, but some detail is lost,
and I sorry about 'break' word, I mean 'Compression artifact',

I pursue near-lossless compress and best quality.

dssim
0.010231

butteraugli
7.291278

metric rmse fuzz 1%
c01.jpg

And I need some help,
Someone know about *1 have broke movement issue games ? ,
I need those games resource or title to make some research.

*1
v0.4 Beta

Added code to properly encode parallaxes in RPGM games (must use lossless or it breaks movement)
 
  • Like
Reactions: Abhai
4.80 star(s) 4 Votes