MVStripper - remove unused assets from your MV project

Ultima2876

Veteran
Veteran
Joined
Oct 25, 2015
Messages
185
Reaction score
239
First Language
English
Hey all,

I've made a quick'n'dirty tool to strip unused files from MV projects to get the filesize down.

http://www.kickbackgames.com/public/files/MVStripper-Win.zip (Windows)

http://www.kickbackgames.com/public/files/MVStripper-OSX.zip (Mac)

It's just a simple nwjs app. If you open the package.nw you can check out the code, improve it or whatever. I'll add a license later on if I find time -- probably MIT or BSD.

It errs on the side of safety, so if a file is referenced from anywhere in your project it is kept. That means that even a barebones project will include over half of the files in the 'RTP' -- but you can get this down yourself by removing unused animations and such from the database. That said, it still helps a lot :p

It brings the filesize of an empty project down from 400mb to around 100mb out of the box, and only takes a few seconds.

Feedback and bug reports are welcomed - please let me know if you use it! Also if you want to thank me, make a donation to http://www.childsplaycharity.org/

EDIT: Updated to fix a bug on Windows version.
 
Last edited by a moderator:

MaxLionheart

Veteran
Veteran
Joined
Aug 23, 2015
Messages
115
Reaction score
35
First Language
French
Interesting! I'll give this a try once I'm about to release my project! Thanks!
 

kewitt

Villager
Member
Joined
Feb 9, 2015
Messages
26
Reaction score
5
First Language
kewitt
Primarily Uses
I haven't tried yet.  But ya this is a great addition!
 

Seriel

Veteran
Veteran
Joined
Aug 16, 2014
Messages
3,013
Reaction score
505
First Language
English
Primarily Uses
RMVXA
Woohoo! I was waiting for one of these to land on MV!

A million thanks! :D

Edit:
How do I use it? :/

Selecting my project folder does nothing at all.

screenshot_95.png
 
Last edited by a moderator:

Ultima2876

Veteran
Veteran
Joined
Oct 25, 2015
Messages
185
Reaction score
239
First Language
English
Sorry about that! There was a tiny bug in the Windows version that was completely breaking it (stupid me, rushing a release right before bed x_x) -- please re-download it and give it another try, it should work now!

I've also noticed a few other small bugs (like the button above getting cut off and not looking quite right on Windows, and if you cancel from the 'save folder' window the button stays disabled until you restart the app). Unfortunately I'm on a Mac and I made this in about 2 hours, so I didn't have a lot of time to do testing on Windows!
 
Last edited by a moderator:

Xelion

Veteran
Veteran
Joined
Apr 18, 2012
Messages
113
Reaction score
153
First Language
Spanish
Hey, thanks for this. If I ever finish a game (xD) this will prove very useful 
 

Seriel

Veteran
Veteran
Joined
Aug 16, 2014
Messages
3,013
Reaction score
505
First Language
English
Primarily Uses
RMVXA
Sorry about that! There was a tiny bug in the Windows version that was completely breaking it (stupid me, rushing a release right before bed x_x) -- please re-download it and give it another try, it should work now!

I've also noticed a few other small bugs (like the button above getting cut off and not looking quite right on Windows, and if you cancel from the 'save folder' window the button stays disabled until you restart the app). Unfortunately I'm on a Mac and I made this in about 2 hours, so I didn't have a lot of time to do testing on Windows!
Heh, i'll probably end up doing most of the windows testing for you :p

I'll let ya know if I find anything wrong with it.
 

Milennin

"With a bang and a boom!"
Veteran
Joined
Feb 7, 2013
Messages
3,201
Reaction score
2,558
First Language
English
Primarily Uses
RMMV
This looks useful, and should have been included with RPG Maker itself. I'll try it out some time when my game gets to a state where I can have it serve as a playable demo.
 

KisaiTenshi

Veteran
Veteran
Joined
Oct 24, 2015
Messages
310
Reaction score
129
This looks useful, and should have been included with RPG Maker itself. I'll try it out some time when my game gets to a state where I can have it serve as a playable demo.
Not to reduce the authors efforts, but a 73MB program (of which 72MB is the runtime) that makes use of 15 node libraries and the same node-webkit runtime is very very much overkill. Considering that RPG Maker MV already comes with a NodeWebkit runtime in the form of the game.exe, this could have been made much smaller by having a batch file or shell script execute the node-webkit installation already available.
 

Ultima2876

Veteran
Veteran
Joined
Oct 25, 2015
Messages
185
Reaction score
239
First Language
English
Not to reduce the authors efforts, but a 73MB program (of which 72MB is the runtime) that makes use of 15 node libraries and the same node-webkit runtime is very very much overkill. Considering that RPG Maker MV already comes with a NodeWebkit runtime in the form of the game.exe, this could have been made much smaller by having a batch file or shell script execute the node-webkit installation already available.
Yup, I only really used nwjs for rapid development; originally I didn't even think I'd distribute it as I made it for my own personal use, but afterwards figured why not... it's definitely quick'n'dirty ;) If I was putting proper effort into it I'd do it in C# with Mono and test more fully on both Windows and OSX. 

However, it's open source! Feel free to grab the index.html file and do whatever you need to do to get the filesize down (or better yet, make a native app which I didn't have time to do)! :)

I'll provide some limited justification for the bloat. I think all those node libraries come as dependencies of fs-extra, which is only used to make file copying a little faster. That could definitely be cleaned out, though at 580kb I don't really see the need. Using a shared runtime is possibly a nice idea, though there are no guarantees that the version of nwjs will be the same - in fact it's likely to differ as MV gets updates - and it's a constantly evolving (and not very robust yet!) piece of software to begin with. Still, could definitely be a nice option to have.

I think the biggest flaw with the project is that it can't be ran on the command line easily as of yet ;)
 
Last edited by a moderator:

KisaiTenshi

Veteran
Veteran
Joined
Oct 24, 2015
Messages
310
Reaction score
129
Yup, I only really used nwjs for rapid development; originally I didn't even think I'd distribute it as I made it for my own personal use, but afterwards figured why not... it's definitely quick'n'dirty ;) If I was putting proper effort into it I'd do it in C# with Mono and test more fully on both Windows and OSX. 

However, it's open source! Feel free to grab the index.html file and do whatever you need to do to get the filesize down!

I'll provide some limited justification for the bloat. I think all those node libraries come as dependencies of fs-extra, which is only used to make file copying a little faster. That could definitely be cleaned out, though at 580kb I don't really see the need. Using a shared runtime is possibly a nice idea, though there are no guarantees that the version of nwjs will be the same - in fact it's likely to differ as MV gets updates - and it's a constantly evolving (and not very robust yet!) piece of software to begin with.

I think the biggest flaw with the project is that it can't be ran on the command line easily as of yet ;)
Yeah I understand the rapid prototyping involved here, which is why I replied to the comment about "should have been included", since if the RPG Maker MV developers were to include this as-is, it would be ridiculous. Since the editor is QT, and the game engine is basically vanilla node-webkit, they could just put the .nw package in and launched it from within the editor or use a batch file/shell script to launch it or a "build" process.

Like pseudo-code of what really needed to be done was:

open game asset directory for each directory recurse for each file, grep through all json||js files if found, mark as used, end loop if not found continue to next file if no mark, add to "removal-confirm" list close directoryclose directorywrite out removal-confirm listThen allow the user to remove items from the removal-confirm list, then they can just run this list against either project or deployment. That way stuff like licenses aren't stripped out.
 

Ultima2876

Veteran
Veteran
Joined
Oct 25, 2015
Messages
185
Reaction score
239
First Language
English
It doesn't strip scripts/licenses or anything like that, only images, audio and movies. You definitely don't need to worry about licenses/legal stuff being stripped out as it doesn't touch any code files :)

Also I think if the developers of RPG Maker wanted to do something like this I totally wouldn't expect them to include an nwjs webapp to do it, haha
 
Last edited by a moderator:

Merryjest

Veteran
Veteran
Joined
May 8, 2012
Messages
275
Reaction score
53
First Language
English
Primarily Uses
RMMZ
This is beautiful. Thank you for making this!
 

Ultima2876

Veteran
Veteran
Joined
Oct 25, 2015
Messages
185
Reaction score
239
First Language
English
There's been a bug report on Reddit that plugins might not be being copied properly. I'll be looking into it as soon as possible, in the meantime if anyone has a project that is using plugins and has a moment to try it and see if they have this issue, I'd really appreciate the feedback :)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,505
Reaction score
16,405
First Language
English
Primarily Uses
RMMV
Does this look through scripts to see if there are any resource names hardcoded?
 

Ultima2876

Veteran
Veteran
Joined
Oct 25, 2015
Messages
185
Reaction score
239
First Language
English
Does this look through scripts to see if there are any resource names hardcoded?
Yup, it checks through all scripts in the /js directory, as well as all JSON files in /data! :)
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,505
Reaction score
16,405
First Language
English
Primarily Uses
RMMV
and js/plugins?
 

Latest Threads

Latest Posts

Latest Profile Posts

FsFvJLfWYAEN1Th


The thing that stinks about parallax mapping is the time investment it takes to make one map, but it does help sell the art style of my game so... In for a penny, I guess.
chapter one of the demo is almost done i just need my protag's va to get me his lines
Who else is excited for RPG Maker Unite? I can't wait to get my hands on it.
Every time...I forget about this stupid pun every time, and every time I see it, I both love and hate my sense of 'humour'. If you can call it that.
Untitled.png

Forum statistics

Threads
129,839
Messages
1,205,620
Members
170,980
Latest member
arctisune
Top