- Feb 7, 2020
- 132
- 478
I've made a little tool that scans an rpgmaker mv project data folder for unused files and moves them outside of the project to be deleted.
The tool will move the files to 'www/removed', it'll not remove the files, you need to delete that folder yourself.
I'm aware that there is an official feature on rpgmaker mv when you build your game to strip unused files but its VERY rare to see devs that actually use this in the fear that it'll break some plugin.
The tool comes with a .json file that it'll use to map removeable files. In short, it'll only try to remove files that came from the default empty rpgmaker project. You can generate another json or parse all the project files if you want but its not recommended as the chances it'll break a plugin are high.
This is a cli tool, the instructions are inside and there is also a -h option but I've also added a .bat file for easy execution. Just execute and paste the project www folder path.
So far I've tested it on a few simple small games and it seems to remove on average 100-150 MB of data without breaking the game.
As it only tries to remove the default rpgmaker files, if any plugin breaks, you can easily restore the original file from any new rpgmaker project.
The tool and the source code are in the attachments.
This tool is for rpgmaker MV only! (it'll not work on MZ)
If the project has a www folder its most likely an MV project.
-------------------------------------------
Bonnus tip - Reducing size even more - removing the nw.dll dependency, kinda.
A big chunk of an rpgmaker game is the nw.dll file which is a nwjs file that rpgmaker games runs on. Its basically the fake browser that renders the game, its packaged with browser features that are not used for the game, with each update increasing the size even further.
If you have several rpgamaker games installed, those 80mb to 180mb files stacks up.
To alleviate this problem you can create a folder on your PC to store a common nw.dll to be used by ALL the rpgmaker games.
The nw.dll comes in several different versions and sizes but those changes are not related to the rpgmaker game engine itself and you can use an older or newer version of nw.dll most of the times. Worst case, you can keep multiple copies of the nw.js and use the other if the one you tried doesn't work for other games. I personally use the 82MB 2018 ver of nw.dll for MV projects.
MZ projects might need a newer version because it runs on a 'newer rpgmaker engine'.
Anyways, on windows you can use a mklink command to create a symbolic link to the common usage nw.dll file. On linux you can use an ln command to do the same.
I'll attach a simple .bat script that I use to speedup this, you just need to edit it and change the location of the common usage real nw.dll files.
Execute the .bat file and paste the game folder and it'll put the symbolic link there, just make sure to remove the nw.dll from the game's folder first.
-----EDIT:
lol, I just saw that f95 tagged [VIRUS]. I didn't know this existed. I guess its because there is a lot of reading files and moving files around or maybe some random python lib that got packaged in with the pyinstaller. I didn't use virtual env for this.
Anyways, feel free to execute the program directly for the python source. I'm almost sure I only used standard libraries
The tool will move the files to 'www/removed', it'll not remove the files, you need to delete that folder yourself.
I'm aware that there is an official feature on rpgmaker mv when you build your game to strip unused files but its VERY rare to see devs that actually use this in the fear that it'll break some plugin.
The tool comes with a .json file that it'll use to map removeable files. In short, it'll only try to remove files that came from the default empty rpgmaker project. You can generate another json or parse all the project files if you want but its not recommended as the chances it'll break a plugin are high.
This is a cli tool, the instructions are inside and there is also a -h option but I've also added a .bat file for easy execution. Just execute and paste the project www folder path.
So far I've tested it on a few simple small games and it seems to remove on average 100-150 MB of data without breaking the game.
As it only tries to remove the default rpgmaker files, if any plugin breaks, you can easily restore the original file from any new rpgmaker project.
The tool and the source code are in the attachments.
This tool is for rpgmaker MV only! (it'll not work on MZ)
If the project has a www folder its most likely an MV project.
-------------------------------------------
Bonnus tip - Reducing size even more - removing the nw.dll dependency, kinda.
A big chunk of an rpgmaker game is the nw.dll file which is a nwjs file that rpgmaker games runs on. Its basically the fake browser that renders the game, its packaged with browser features that are not used for the game, with each update increasing the size even further.
If you have several rpgamaker games installed, those 80mb to 180mb files stacks up.
To alleviate this problem you can create a folder on your PC to store a common nw.dll to be used by ALL the rpgmaker games.
The nw.dll comes in several different versions and sizes but those changes are not related to the rpgmaker game engine itself and you can use an older or newer version of nw.dll most of the times. Worst case, you can keep multiple copies of the nw.js and use the other if the one you tried doesn't work for other games. I personally use the 82MB 2018 ver of nw.dll for MV projects.
MZ projects might need a newer version because it runs on a 'newer rpgmaker engine'.
Anyways, on windows you can use a mklink command to create a symbolic link to the common usage nw.dll file. On linux you can use an ln command to do the same.
I'll attach a simple .bat script that I use to speedup this, you just need to edit it and change the location of the common usage real nw.dll files.
Execute the .bat file and paste the game folder and it'll put the symbolic link there, just make sure to remove the nw.dll from the game's folder first.
-----EDIT:
lol, I just saw that f95 tagged [VIRUS]. I didn't know this existed. I guess its because there is a lot of reading files and moving files around or maybe some random python lib that got packaged in with the pyinstaller. I didn't use virtual env for this.
Anyways, feel free to execute the program directly for the python source. I'm almost sure I only used standard libraries
Last edited: