[spoiler=Update History]
- < Version 2.5 | 07/04/15 >
- Updated a tutorial on time compression.
- Updated Zeriab's Remove Comments project under Scripts.(RXDATA/RVDATA/RVDATA2) Comment Removal.
- Removed MCP under Optional Software Tools.
- < Version 2.1 | 10/23/12 > Added RVDATA2 Compression under Data > RVDATA2 Compression
- < Version 2.0 | 10/09/12 > Updated for RPG Maker VX Ace; updated appearance.
- < Version 1.9 | 08/03/11 > Added Radical Image Optimization Tool under Graphics > PNG/JPEG Optimization
- < Version 1.8 | 07/24/11 >
- Added a tutorial on media compression.
- Added a tutorial on time compression.
- Added MCP under Optional Software Tools.
- < Version 1.7 | 07/16/11 > Removed the textual tutorial on looping and added a video tutorial.
- < Version 1.6 | 07/14/11 > Added Blizzard's Resource Tester project under Stowaway Files (thanks GameGuysProjects)
- < Version 1.5 | 07/13/11 > Added Zeriab's Remove Comments project under Scripts.(RXDATA/RVDATA) Comment Removal.
- < Version 1.4 | 07/12/11 > Added JPEG & PNG Stripper under PNG/JPEG Optimization.
- < Version 1.3 | 07/12/11 > Added the Compact RVData script under .RVData Compression.
- < Version 1.2 | 07/08/11 > Added a tutorial on looping.
- < Version 1.1 | 07/08/11 > Added Yeyinde's RM Data Checker under Stowaway Files (thanks cozziekuns)
- < Version 1.0 | 07/08/11 > Initial Release
[/spoiler]
[spoiler=Easy Category]
- \ Graphics
- < PNG/JPEG Optimization (XP/VX/VXA) >
One of the easiest and quickest ways to shrink your project size is to use a PNG/JPEG optimizer on all of your graphics. While saving roughly 20 kb off of a single file may not seem very impressive, if your project has a large amount of graphics, then these small bits begin to add up quickly.
For example, I recently optimized a project for a friend which had about 1,500 PNG files. The original size for the entire graphics folder was 84,085,192 bytes (84 mb). The size of the folder after I ran a quick PNG optimization was 57,719,751 bytes (57 mb). That's a difference of 26 megabytes simply by removing excess information that's not being used by the game and then re-compressing the file. No extra scripts or advanced computer knowledge required.
There are a plethora of options available for PNG/JPEG optimization, but I personally prefer the following programs :
- PSYDK.ORG PNG Optimizer (http://psydk.org/PngOptimizer.php)
This program features an easy to use interface which you can quickly drag and drop your files into. Very simple to use. By default, the program makes backups for each file that it optimizes, so remember to either disable this feature through the options menu or move the backups after optimization is complete. No installation required; free to use.
- Radical Image Optimization Tool (http://luci.criosweb.ro/riot/)
RIOT combines several different compression methods and options for both JPEG and PNG files into one powerful application. It offers a side-by-side comparison which updates whenever you make a change, allowing you to see the end result before it is saved. The program also has a batch optimizer function which can handle multiple files at once. Highly suggested for those wanting more control than PSYDK PNG Optimizer and JPEG & PNG Stripper without the command line aspect of OptiPNG Advanced PNG Optimizer. Small installation required; free to use.
- OptiPNG Advanced PNG Optimizer (http://optipng.sourceforge.net/)
Unless you're like me and find glee in squeezing every last useless kilobyte out of PNG files, use the PSYDK PNG Optimizer instead. This is a command line PNG optimizer which has advanced options not normally needed, but can occasionally eek out several more kilobytes of unneeded data from the image file. No installation required; free to use.
- JPEG & PNG Stripper (http://www.steelbytes.com/?mid=30)
Unlike the other two options above, this program removes useless metadata from JPEG files as well. If you are using JPEG files, I highly suggest running them through this optimizer to clear up the most amount of space possible. The program has an easy to use interface which you can quickly drag and drop your files into. Very simple to use. Please note that some anti-virus software may mark this program as malware, but it is not. No installation required; free to use.
- < Thumbnail Cache Files (XP/VX/VXA) >
Occasionally I see these database files just hanging around in one or more of the graphics directories, taking up space that they shouldn't be. Thumbs.DB is often the biggest offender. This file is generated automatically by Windows when browsing a folder with image files while the 'thumbnails' view is enabled. Always check to see if you have any such files before you export the release of your game, as I have seen them bloat as high as 5 mb.
- < Stowaway Files (XP/VX) >
Quickly run through your current graphic and audio files. Open them up, visually inspect or listen to them. Are you using all of them in your project? I've found myself guilty of allowing stowaway files into my project. That is, images that are not being used in the game and are most likely left overs from a quick graphic test or an older backup version of something that is being used in the game. These normally don't eat up very much space, but in larger games allowing these moochers to tag along can inflate the size of your project by several megabytes.
If you're unsure if you're still using a certain graphic or music file within your game, move the file out of your project folder and use the following program or script to see if any errors crop up :
- Yeyinde's RM Data Checker (http://rmrk.net/index.php/topic,38957.0.html) (XP/VX)
- Blizzard's Resource Tester (http://forum.chaos-project.com/index.php/topic,113.0.html) (XP)
- Jet's Integrity Checker (http://pastebin.com/raw.php?i=DmQ8DN6W) (VX)
[/spoiler]
[spoiler=Intermediate Category]
[/spoiler]
[spoiler=Extreme Category]
- \ { Base Directory }
- < Executable Packing (XP/VX/VXA) >
Although this is wandering into the realm of silliness, you can also shave around 30 kb from the Game.EXE file by using an executable packer. There are many options available for such compressors, although I would suggest using the following program :
- UPX (Ultimate Packer for eXecutables) (http://upx.sourceforge.net/#downloadupx)
This is the portable GUI version of the popular UPX program. Quick, reliable and fairly easy to use. No installation required; free to use. Using the following options should allow for optimal compression while not interfering with the normal operation of the executable :
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fwww.moofah.com%2Ftemp%2Fmedia%2Fimages%2Fpng%2Fmboard%2Fupx-options.png&hash=7316104910b1c98009ea0b3090e4cd93c5c8e424)
After packing the executable, remember to run and play through your game to check for any incompatibilities that might arise, although there really should not be any. If everything is running fine, delete the backup file Game.EX~. If the game crashes or displays problems after compression, delete the packed executable and rename the backup file to take its place.
- \ Audio
- < Time Compression (XP/VX/VXA) >
Another trick that can be added to a fanatical kilobyte killer's arsenal utilizes RPG Maker's built-in audio pitch control.
Using Audacity, you can change the speed at which the song plays. Since increasing the speed lowers the amount of time that the song is playing, this also means that it will take up less space once it is compressed. Normally, the newly altered song would sound like something that the Chipmunks performed, but once you import it into your RPG Maker project you can use the native pitch control to slow down the song and thereby making it listenable once more.
The downside to this trick is that if you have a looping OGG file, you will have to find the loop points within the squished audio data all over again. Also, compressing the audio in this way may degrade its quality. Generally, I squeeze about 300 to 500 kilobytes from each file (comparing original compressed OGG versus time compressed OGG) that I apply this method to, which may not seem like much but it can add up quickly.
[spoiler=Time Compression]
- < Step 1 > : Launch Audacity and open the file that you wish to use. I would suggest using the highest quality of source audio available to you.
- < Step 2 > : We'll now click on the Edit menu and place the mouse over the Select option to expand another menu. Next, we'll click on the All option to select the entire length of the audio file.
- < Step 3a > : After that, we'll click on the Effect menu and select the Change Speed option which will bring up the Change Speed window.
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fwww.moofah.com%2Ftemp%2Fmedia%2Fimages%2Fpng%2Fmboard%2Ft-compress-1.png&hash=42c15d0e180f8d000b99c4d1f8581680e8996037)
Here you can enter the amount of change you wish to apply to the speed of the song. I would suggest entering a value divisible by five, as the pitch slider bar in RPG Maker goes up or down in increments of five. Also, since RPG Maker only allows you to alter the pitch up to fifty percent in either direction, you should not enter a value above fifty. Personally, I use either a value of 25 or 50.
After entering the amount that you want, press the OK button and Audacity will begin altering the speed of the song.
- < Step 3b > : If this is a file that you are wanting to use OGG looping with, remember to find the loop points again and write down the selection start and end information. See my video tutorial above about OGG looping if you are not familiar with how it works.
- < Step 4a > : Now that we have sped up the song, all that needs to be done is export the new audio data and compress it. This can be done by clicking on the File menu and selecting the Export option.
The Export File window should then appear and you can either select MP3 or Ogg Vorbis from the Save As Type drop down menu. Personally, I prefer using fre:ac for the encoding of my media files, so I will export the audio data as WAV (Microsoft) to keep the source audio quality high for now. Follow my tutorial on media compression above if you are following my route.
If you are using the MP3 or Ogg Vorbis options, remember to click on the Options button on the lower right-hand side of the window and choose your desired compression settings.
- < Step 4b > : Regardless of what format you choose, after you click the OK button, an Edit Metadata window will now appear. Again, if you are using OGG looping you will want to input the selection start and end information here. If not, simply click the OK button to instruct Audacity to begin exporting the newly sped up audio file.
- < Step 5 > : Import the newly compressed file into your RPG Maker project. You may wish to click on the Tools menu and select the Sound Test option to try and find the correct pitch setting to restore the proper playback.
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fwww.moofah.com%2Ftemp%2Fmedia%2Fimages%2Fpng%2Fmboard%2Ft-compress-2.png&hash=91d483559c648faac0a2f97069b1021c6b9a6199)
The displayed settings above are for an audio file which was sped up by fifty percent.
[/spoiler]
- \ Data
- < .RVDATA Compression (VX) >
I've currently completed a script to allow for compressing .RVDATA within the Data directory, as its total size can often roam higher than 4 mb in large projects. Current test runs have dropped the size from roughly 5 mb to 500-ish kb (200 maps, full compliment of items, armors, weapons and animations). No third party DLLs or EXEs required.
- Compact RVData (http://rmrk.net/index.php/topic,43155.msg492060.html) (VX)
- < .RVDATA2 Compression (VXA) >
Jet has ported over his own compression script to VXA, allowing for .RVDATA2 files within the Data directory to be compressed.
- RVData2 Compression (http://www.rpgmakervxace.net/topic/214-rvdata2-compression/) (VXA)
- < Scripts.(RXDATA/RVDATA/RVDATA2) Comment Removal (XP/VX/VXA) >
Although the Scripts.(rxdata/rvdata/rvdata2) file cannot be compressed by the Compact RVData script above, it can still be optimized by removing commented lines and carriage returns. Zeriab has created a project for doing just that and I believe that it does its job well. For example, I have taken a heavily commented Scripts.rvdata2 which was 270 kb and come away with a 170 kb file after.
It should be noted that removing the comments and carriage returns will make reading the code very difficult and should only be done when you are ready to release your game. You should also make a copy of your original Scripts.(rxdata/rvdata/rvdata2) and over-write the optimized version after having finalized your compressed distribution file.
NOTE : There are no guarantees by the author of this project that scripts will be in complete working order after the comments and carriage returns are removed. Please test your game thoroughly before releasing the finished product.
- Zeriab's Remove Comments (https://www.dropbox.com/s/c1v2ifisnt4oct5/Remove%20Comments.zip?dl=0) (XP/VX/VXA)
To use, place your Scripts.(rxdata/rvdata/rvdata2) file in the Input folder and run Game.exe. The comment-stripped Scripts.(rxdata/rvdata/rvdata2) file is output to the base folder once the process has finished.
[/spoiler]
Very nice tutorial, Exhydra. I look forward to seeing more of this, and more games that won't take up 500 MB.
This is a great tutorial. Nice work Exhydra! Where did you come from anyway? You're so helpful and awesome and I'm not used to that in new members - it's creeping me out :P
http://rmrk.net/index.php?topic=38957.0
This is a cool tool made by Yeyinde for checking if you have unused files in your RM Folder. Seems a bit faster than Jet's Integrity Script. Anyways, great tutorial Exhydra!
Quote from: Pacman on July 09, 2011, 12:10:14 AM
Very nice tutorial, Exhydra. I look forward to seeing more of this, and more games that won't take up 500 MB.
Thank you! More on the way in regards to audio, which generally causes the most project bloat ...
Quote from: modern algebra on July 09, 2011, 01:09:30 AM
This is a great tutorial. Nice work Exhydra! Where did you come from anyway? You're so helpful and awesome and I'm not used to that in new members - it's creeping me out :P
I've lurked around the RPG Maker scene for a while, so I'm not exactly new-new. Although it was only recently that I've become more vocal and taken a higher interest in scripting and optimization. :o
Quote from: cozziekuns on July 09, 2011, 02:12:47 AM
http://rmrk.net/index.php?topic=38957.0
This is a cool tool made by Yeyinde for checking if you have unused files in your RM Folder. Seems a bit faster than Jet's Integrity Script. Anyways, great tutorial Exhydra!
Thanks, Cozzie! I've added that tool into the tutorial. I didn't even know it existed.
This is really cool! Thank you for sharing these stuff bro B)
Do you mind if I spread it to other sites as well to help fellow makers? :D
Sure, that's fine by me. The more people with non-500 megabyte projects, the better! :o
Thank you very much for this. You've made my day ;)
Thank you for making this! this helped me so much and now i am happy and still using these tutorials to help me ;8
Where have I been? Just found this thread and I am excited to run my VX project throught the steps to reduce its filesize!
- < Version 2.5 | 07/04/15 >
- Updated a tutorial on time compression.
- Updated Zeriab's Remove Comments project under Scripts.(RXDATA/RVDATA/RVDATA2) Comment Removal.
- Removed MCP under Optional Software Tools.
Kudos for maintaining this, even after four years.
This is one of the most usefull tutorials I've ever read. :D
I shrinked the size from 156,491 MB down to 84,21 MB. :D
That is a filesize difference of 46,19%. O.o
Thank you so much for that tutorial. :) (\s/)
I'm glad the tutorial was so useful to you. :)