Faherya

The Knight of the Sad Figure
Veteran
Joined
Jul 25, 2013
Messages
261
Reaction score
596
First Language
Portuguese
Primarily Uses
RMVXA
I don't know if this is the correct area to post this. I've been discussing with friends for a long time about ways to reduce the final size of projects in RPG Maker. I put together a small PDF with few but good solutions to this problem. These are just a few comments on best practices for optimizing images and audio files. I tried to be as objective as possible, the result is just nine A6 pages.


You can download it from itch.io:

Thoughts and comments on? I'd like to get out of the regional discussions for a bit and see what more people have to say.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,832
Reaction score
1,887
First Language
Spanish
Primarily Uses
RMVXA
THE way to do it is to cut as many colors as you can from any images.
that's the heaviest weight across the board.

really not much else to do besides that.
any KB you might squeeze out of everything else still falls short to the 1000 times that amount that you can cut from images.
that's why a lot of tiles are cramped into one image in the form of tile sets, but if you can't do that, and you can't cut resolution, you have to cut color data.
 

Zeireth

Veteran
Veteran
Joined
Nov 2, 2013
Messages
81
Reaction score
64
First Language
English
Primarily Uses
N/A
I don't know if this is the correct area to post this. I've been discussing with friends for a long time about ways to reduce the final size of projects in RPG Maker. I put together a small PDF with few but good solutions to this problem. These are just a few comments on best practices for optimizing images and audio files. I tried to be as objective as possible, the result is just nine A6 pages.


You can download it from itch.io:

Thoughts and comments on? I'd like to get out of the regional discussions for a bit and see what more people have to say.
It is called file compression. You can create archives for .zip, .rar, or whatever.

If you use WinRar, then right click the folder you want to compress, click on add to archive, then select archive format RAR, then change compression method from normal to best, then change dictionary size from 32 MB to a size your computer can handle.

For instance 1024 MB puts a lot of strain on your memory while archiving, but gives you best compression. It needs at least 8 GB of DDR3 ram or DDR4 ram to use. You also cannot have any other applications running. I use 8 GB of DDR3, however if you can get 16 GB of DDR3 or DRR4 then that would be best.

I am sure there are better archival methods out there. This is all that I know, because that is what I use for file compression. As computer technology gets better so to does compression technology. Take time to research what is best for you.

Good luck with your project :)

Edit: Please do not add compressed folders or files into other compressed folders. It is redundant and does not compress files further. Just use the best compression method for one folder with all the files you want inside it.
 

Rafael_Sol_Maker

Almighty God Jabu
Veteran
Joined
May 8, 2012
Messages
145
Reaction score
107
First Language
Portuguese
Primarily Uses
RMMV
Great and handy e-book!

Coincidentally these days I'm thinking about writing optimizations tips for a gamedev e-magazine.

I already studied about image compression, packing, these kind of stuff. And from time to time I revisit this topic.

I even studied a bit on image processing in my major, lol.

I can give you some advice and guiding if you want. I'm no specialist, though. I just know a bit on the subject.

This topic deserves much more discussion and recognition, it's so important!
 

Faherya

The Knight of the Sad Figure
Veteran
Joined
Jul 25, 2013
Messages
261
Reaction score
596
First Language
Portuguese
Primarily Uses
RMVXA
@gstv87 In my tests, I always had better results with the audio files. But speaking of images, really. Reducing colors (and compressing) helps a lot more than pure compression.
@Zeireth Thanks for the comment. In this case, we are talking about deeper compression, not necessarily .zip/rar files. Also because I don't know if all distribution platforms accept files of this type. xD
@Rafael_Sol_Maker Oops, spoiler of the next issue of MtRPG. :kaojoy:
Please, post your comments here or include everything in the zine (but don't take too long to release).
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,832
Reaction score
1,887
First Language
Spanish
Primarily Uses
RMVXA
@Faherya audio files are a close second to images, but when it comes to audio, you can always turn to MIDI and cut nearly 90% of the load.
the problem with that, is that you'll need a good composer to make something out of that.
if you can't work with MIDI, you have to resort to OGG or MP3, and those are tricky to compress without losing quality.
 

Faherya

The Knight of the Sad Figure
Veteran
Joined
Jul 25, 2013
Messages
261
Reaction score
596
First Language
Portuguese
Primarily Uses
RMVXA
@Faherya audio files are a close second to images, but when it comes to audio, you can always turn to MIDI and cut nearly 90% of the load.
the problem with that, is that you'll need a good composer to make something out of that.
if you can't work with MIDI, you have to resort to OGG or MP3, and those are tricky to compress without losing quality.
Exactly, I wrote a little about this in the text. You can even compose good soundtracks in MIDI. The problem is that the latest versions of RM (MV and MZ), as they are basically a browser, do not play MIDI. You can solve it as follows: compose the track in MIDI normally, import through LMMS and export as ogg-compressed. As it is a MIDI conversion, there is no loss of quality (or it is imperceptible) and the size is similar to the original file.
 

Zeireth

Veteran
Veteran
Joined
Nov 2, 2013
Messages
81
Reaction score
64
First Language
English
Primarily Uses
N/A
@gstv87 In my tests, I always had better results with the audio files. But speaking of images, really. Reducing colors (and compressing) helps a lot more than pure compression.
@Zeireth Thanks for the comment. In this case, we are talking about deeper compression, not necessarily .zip/rar files. Also because I don't know if all distribution platforms accept files of this type. xD
@Rafael_Sol_Maker Oops, spoiler of the next issue of MtRPG. :kaojoy:
Please, post your comments here or include everything in the zine (but don't take too long to release).
How is my method of lossless compression different from your method of lossless compression?

How deep do you want to go? There is only so far you can go. Due to the pigeonhole principle, no lossless compression algorithm can efficiently compress all possible data. You will have to use the best and most optimal prefix code.

MIDI, ZIP, RAR, PNG, JPEG, GIF, and etc are all forms of lossless compression. They are made from prefix coding. Most known prefix coding is Huffman code.

Like gstv87 has said for images you will have to cut colors. For text files and javascript files you would have to remove all comments and all information that players will never see.

You can use .zip, it is an accepted file for most sites. Many sites do not allow .rar because it is a proprietary format. With .zip you can get the same compression.
 

Faherya

The Knight of the Sad Figure
Veteran
Joined
Jul 25, 2013
Messages
261
Reaction score
596
First Language
Portuguese
Primarily Uses
RMVXA
How is my method of lossless compression different from your method of lossless compression?

How deep do you want to go? There is only so far you can go. Due to the pigeonhole principle, no lossless compression algorithm can efficiently compress all possible data. You will have to use the best and most optimal prefix code.

MIDI, ZIP, RAR, PNG, JPEG, GIF, and etc are all forms of lossless compression. They are made from prefix coding. Most known prefix coding is Huffman code.

Like gstv87 has said for images you will have to cut colors. For text files and javascript files you would have to remove all comments and all information that players will never see.

You can use .zip, it is an accepted file for most sites. Many sites do not allow .rar because it is a proprietary format. With .zip you can get the same compression.
Zip is a good compression method, but it only works for the download/upload step. Once the files are in a .zip, it has to be unzipped so they can be read, which ends up removing all compression. Even if you develop a method to read the files directly from the zip, they will still take up a lot of memory.

What I'm discussing are ways to reduce the size of the files themselves. In this way they will take up as little space as possible and you will still have the option of putting the optimized files inside a zip. The point is to reduce the resource usage needed to handle the files at every step, whether it's transfer, read or execute. I'm calling this process "compression", but I'm not exactly talking about wrapping a folder in a folder.zip.
 

Rafael_Sol_Maker

Almighty God Jabu
Veteran
Joined
May 8, 2012
Messages
145
Reaction score
107
First Language
Portuguese
Primarily Uses
RMMV
Okay, so how we can start here...?

First it's important to define compression.

First there's external compression. Think something on the lines of WinZip, a software that does external compression to an archived file format. Some files used by RMMZ, like save files, are compressed this way. The difference to the next type is that external compression requires decompression before using.

Secondly, there's built-in compression. By definition most images and audio files have some kind of built-in compression. It's specified by the format of the file, that must follow certain specifications. Unlike the former, decompression is done "automatically" by the codecs of that format.

And then, there is basically 2 different types of built-in compression: lossless, where no information is lost and lossy, where some redundant, useless or less important information is removed. In the latter type of compression if we force it too much it might degrade perceptibly the quality of the resource.

In images, it can cause artifacts, bluriness and loss of colors; in audio, it loses range and also can cause some clipping on certain frequencies.

So because of this, most of the codecs have some kind of "slider" or "degrees" of quality, so we can try to squeeze as much data as possible without perceptible loss of quality.

I will probably start writing something along these lines, but let the discussion continue. I don't have much spare time these days, so I won't promise the article will be done anytime soon.

But if I can help on the guide, here I am. Right now I'll just give some clues on the subject, while I can't help better.

edit: Made text more clear and concise.
 
Last edited:

Faherya

The Knight of the Sad Figure
Veteran
Joined
Jul 25, 2013
Messages
261
Reaction score
596
First Language
Portuguese
Primarily Uses
RMVXA
So far so good, I've already researched these topics. xD
Maybe you have some technical reference that I didn't find. I'm currently researching rendering systems. Speaking specifically of RPG Maker (MV/MZ), I started with rendering in browsers:

But this is more in the field of performance itself, I still need to study code optimization, so let's get back to the files. I've been reading this other article that contains something or other not yet discussed in the eBook: https://www.smashingmagazine.com/2009/07/png-optimization-guide-more-clever-techniques/

For audio files, I have done what I commented above. I edit the MIDI files using LMMS and export them in compressed ogg. So far they are getting satisfactory. This other article brings an interesting comparison about the audio quality of different platforms (Spotfy, Amazon Music, etc). We know that streaming audio and audio in a file are different things, but you can get some ideas about the bitrate. https://www.soundguys.com/audio-compression-explained-29148/

I haven't researched other formats yet, but I'm especially interested in SFC, which was the SNES format. I don't rule out the possibility of trying to recreate a similar format.
 

Latest Threads

Latest Posts

Latest Profile Posts

1660339609612.png
Really need to come up with better names for my folders.
rpgmakerxp wrote on caethyril's profile.
Hi, I saw you comment a google drive link to add a specific script to a kadowa plugin for battle voices here: https://forums.rpgmakerweb.com/inde...attacking-defending-skills-damage-ect.119148/

I'd like to add "multiple possible battle voices" for stuff too, can you please let me know what to change cause the link isn't working.
As you get older you notice how things you always used to do is starting to cause pain XD
I've always sitted on my feet for exemple and now I've started to develop knee pains that always occur after I sit in a way that I've ALWAYS done.
And am I going to stop doing it? Eh, likely not before it is causing me massive pain....:kaoswt:
Yay me...

Forum statistics

Threads
124,452
Messages
1,163,762
Members
163,273
Latest member
DarckMysterix
Top