MVStripper - remove unused assets from your MV project

Discussion in 'Useful Development Tools' started by Ultima2876, Oct 28, 2015.

  1. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    223
    Location:
    UK
    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: Oct 29, 2015
    #1
  2. DoctorMolotov

    DoctorMolotov Adrenochrome... Veteran

    Messages:
    222
    Likes Received:
    110
    Location:
    Earth
    First Language:
    English
    Oh this is nice and will definitely come in handy later on!
     
    #2
    Ultima2876 likes this.
  3. MaxLionheart

    MaxLionheart Veteran Veteran

    Messages:
    87
    Likes Received:
    27
    Location:
    Québec
    First Language:
    French
    Interesting! I'll give this a try once I'm about to release my project! Thanks!
     
    #3
    Ultima2876 likes this.
  4. kewitt

    kewitt Villager Member

    Messages:
    26
    Likes Received:
    5
    First Language:
    kewitt
    I haven't tried yet.  But ya this is a great addition!
     
    #4
    Ultima2876 likes this.
  5. PyroclasticMayhem

    PyroclasticMayhem Veteran Veteran

    Messages:
    49
    Likes Received:
    8
    First Language:
    English
    This would help a lot with mobile.
     
    #5
    Ultima2876 likes this.
  6. Seriel

    Seriel Veteran Veteran

    Messages:
    3,018
    Likes Received:
    504
    Location:
    Wales, UK
    First Language:
    English
    Primarily Uses:
    Other
    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.

    [​IMG]
     
    Last edited by a moderator: Oct 28, 2015
    #6
    Ultima2876 likes this.
  7. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    223
    Location:
    UK
    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: Oct 29, 2015
    #7
    Seriel likes this.
  8. Xelion

    Xelion Veteran Veteran

    Messages:
    38
    Likes Received:
    11
    Location:
    Argentina
    First Language:
    Spanish
    Hey, thanks for this. If I ever finish a game (xD) this will prove very useful 
     
    #8
    Ultima2876 likes this.
  9. Seriel

    Seriel Veteran Veteran

    Messages:
    3,018
    Likes Received:
    504
    Location:
    Wales, UK
    First Language:
    English
    Primarily Uses:
    Other
    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.
     
    #9
    Ultima2876 likes this.
  10. Milennin

    Milennin "With a bang and a boom!" Veteran

    Messages:
    1,765
    Likes Received:
    744
    Location:
    Fiore
    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.
     
    #10
    Ultima2876 and Seriel like this.
  11. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    223
    Location:
    UK
    First Language:
    English
    Thanks, really appreciate all bug reports!
     
    #11
    Seriel likes this.
  12. KisaiTenshi

    KisaiTenshi Veteran Veteran

    Messages:
    310
    Likes Received:
    115
    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.
     
    #12
    Ultima2876 likes this.
  13. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    223
    Location:
    UK
    First Language:
    English
    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: Oct 29, 2015
    #13
    pyremonk likes this.
  14. KisaiTenshi

    KisaiTenshi Veteran Veteran

    Messages:
    310
    Likes Received:
    115
    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.
     
    #14
    Ultima2876 likes this.
  15. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    223
    Location:
    UK
    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: Oct 29, 2015
    #15
    Shinma likes this.
  16. Maus Merryjest

    Maus Merryjest Veteran Veteran

    Messages:
    240
    Likes Received:
    36
    Location:
    Colorado
    First Language:
    English
    This is beautiful. Thank you for making this!
     
    #16
    Ultima2876 likes this.
  17. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    223
    Location:
    UK
    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 :)
     
    #17
  18. Shaz

    Shaz Veteran Veteran

    Messages:
    35,119
    Likes Received:
    9,655
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Does this look through scripts to see if there are any resource names hardcoded?
     
    #18
    Ultima2876 likes this.
  19. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    223
    Location:
    UK
    First Language:
    English
    Yup, it checks through all scripts in the /js directory, as well as all JSON files in /data! :)
     
    Last edited by a moderator: Oct 29, 2015
    #19
  20. Shaz

    Shaz Veteran Veteran

    Messages:
    35,119
    Likes Received:
    9,655
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    and js/plugins?
     
    #20
    Ultima2876 likes this.

Share This Page