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:
    231
    Location:
    UK
    First Language:
    English
    It should recurse through subdirectories, but that may be what the plugin bug is :D

    EDIT: I've just checked and confirmed that it does indeed copy plugin script files properly, at least. All of the files in /js/plugins are present in my 'Target' directory after running the process. I believe if it's copying those files, it should also be scanning them for file references.
     
    Last edited by a moderator: Oct 29, 2015
    #21
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,921
    Likes Received:
    11,586
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Sorry - I meant does it look through js/plugins to see if any of THOSE have resources hardcoded?

    Also, what does it do wrt audio files?  Both the .ogg and the .m4a should be included in a project, and when you export the project it will use whatever file is appropriate for that platform.  Does your program leave both of them there?  (Or are you meant to run it AFTER exporting)?
     
    #22
    Ultima2876 likes this.
  3. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,650
    Likes Received:
    14,409
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    Thank you <3
     
    #23
    Ultima2876 likes this.
  4. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    231
    Location:
    UK
    First Language:
    English
    Yup, it checks through /js/plugins to see if they have resources hardcoded also. It'll incidentally check any subdirectory under /js -- it's a recursive function.

    With audio, it copies both the ogg and m4a files. Similarly, with tilesets, it copies the png and txt files for each used tileset.

    The recommended workflow is:

    - Work on your project

    - When you want to export for testing, save project

    - Run MVStripper, target new directory

    - Open new directory in RPG Maker MV and test to make sure it's fully working

    - Export (deploy) from stripped project

    EDIT: Had some more time to look into the plugin issue. It does seem to be copying activated plugins properly after all - they're saved in a file called /js/plugins.js and it exists in both the source and target projects. The first time I tested it I may have forgotten to save my project before running MVStripper - I can successfully 'strip' a project and it has all the plugin information in the stripped project as expected.
     
    Last edited by a moderator: Oct 29, 2015
    #24
  5. Shaz

    Shaz Veteran Veteran

    Messages:
    37,921
    Likes Received:
    11,586
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Awesome!  Thanks for writing this :)
     
    #25
    Shinma and Ultima2876 like this.
  6. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    231
    Location:
    UK
    First Language:
    English
    No worries! As I mentioned, I mainly wrote it because I needed it myself to distribute my test builds and use file versioning for my project. Once I was done, it hit me that a lot of people could probably benefit from it until Degica get a proper solution going in RPG Maker MV :)
     
    Last edited by a moderator: Oct 29, 2015
    #26
  7. ssunlimited

    ssunlimited Veteran Veteran

    Messages:
    195
    Likes Received:
    19
    Location:
    Brooklyn, New York
    First Language:
    Russian
    Primarily Uses:
    RMMV
    Okay I have used this program. Problem is I don't see an effect. I see new files in the target directory but the project itself has the same amount of megabytes as before using the program. And when I output the game it still is the same size.

    EDIT:oooooooooh! Sorry! Never mind. The second option it asks you doesn't output the unused things like I thought, it outputs the project folder without the unused things. I was confused before.

    Thank you OP. This really helps since I need this to be smaller for several reasons. How much is the minimal donation to that place? I don't think I can donate much...
     
    Last edited by a moderator: Oct 29, 2015
    #27
    Ultima2876 likes this.
  8. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    231
    Location:
    UK
    First Language:
    English
    What were you're before/after file sizes, if I may ask? :) Glad you got it working!

    If you're donating by PayPal I believe it's $1. Every dollar helps, so even if that's all you can afford it'd be awesome! Thanks!
     
    Last edited by a moderator: Oct 29, 2015
    #28
    ssunlimited likes this.
  9. ssunlimited

    ssunlimited Veteran Veteran

    Messages:
    195
    Likes Received:
    19
    Location:
    Brooklyn, New York
    First Language:
    Russian
    Primarily Uses:
    RMMV
    400 mb outputed to 215 mb  :D .
     
    #29
    Ultima2876 likes this.
  10. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    231
    Location:
    UK
    First Language:
    English
    Not bad! If you need to get your project any smaller, try deleting unused default animations, as those take up around 55mb on their own! (However, be careful - animations are a bit of a pain to set up so this should only be done with animations you're sure you won't need!)
     
    Last edited by a moderator: Oct 29, 2015
    #30
    ssunlimited likes this.
  11. ssunlimited

    ssunlimited Veteran Veteran

    Messages:
    195
    Likes Received:
    19
    Location:
    Brooklyn, New York
    First Language:
    Russian
    Primarily Uses:
    RMMV
    I don't know for the future of this game... I might keep them just in case.

    Btw I have donated a little bit.
     
    #31
    Ultima2876 likes this.
  12. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    231
    Location:
    UK
    First Language:
    English
    Thanks for donating!

    I'd do the same for now. I am tempted to add an option to search for unused animations specifically... I've had a little look and it shouldn't be hard (the only complication is 'Show Animation' events, as far as I can see - if anyone more experienced with RPG Maker can point out anywhere I might be missing that Animations could be referenced, I'd be grateful!). In most projects should knock off another 30mb or so!

    EDIT: Another idea is to integrate pngcrush into the process. A few initial tests show that using pngcrush method 10 we can shave off another 10-20% off of almost all of the png files in a project. In a project with 100mb of art assets, that's going to be a significant chunk. PNG is completely lossless so there is no disadvantage to doing this, other than the 'stripping' time being quite a bit longer (as a guess, minutes instead of seconds for the average project... it'll be a checkbox most likely ;) )
     
    Last edited by a moderator: Oct 29, 2015
    #32
    EnMod, PyroclasticMayhem and estriole like this.
  13. y0da

    y0da Villager Member

    Messages:
    21
    Likes Received:
    1
    Hello.

    First of all thank you for this tool. I got my project stripped to 198 mb.

    Is it reasonable to hope for a game under the 100mb mark after your optimisations?
     
    #33
  14. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    231
    Location:
    UK
    First Language:
    English
    For desktop deployment, not really. Unfortunately, they have to include a 95mb runtime, which would leave 5mb for all of your game's music, art and code. 150mb for a small project is more realistic (but bear in mind that the runtime is not applicable for web/mobile projects).
     
    #34
  15. y0da

    y0da Villager Member

    Messages:
    21
    Likes Received:
    1
    I wasn't specific in my reply but I was thinking about an android game. I stripped it to 153mb on android only by using your script and exporting it to Android/iOS.

    Thank you.

    However, do you know why my BGM files are not playing on my device? I tried with and without the ogg files in addition to the m4a ones.

    They only play after a ME is played. Therefore I also have no battle music.

    This is certainly offtopic but you may help me in PM if you want.

    Have a nice day
     
    #35
  16. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    231
    Location:
    UK
    First Language:
    English
    Oh, in that case, we can probably get it down to under 100mb with a future update. Animations take up quite a bit (53mb) so that's my next target. On top of that I want to add an option to PNGCrush all the images, which will take a while to export (at least a few minutes) but should trim all of the images down by another 30% or so (so we're looking at saving 15-25mb there). Finally, I'm considering ways to use the TinyPNG API to get even greater reductions on certain types of images - TinyPNG works especially well on battlebacks, parallaxes and animation sheets, giving around a 70% reduction in size (but that's more of a tricky implementation, and again will increase the 'stripping' time by quite a bit).

    No idea on the music stuff, sorry -- as far as I know, if you have both the m4a and ogg files in the project there shouldn't be any issues. Does the music play OK on desktop/web?
     
    #36
  17. y0da

    y0da Villager Member

    Messages:
    21
    Likes Received:
    1
    Thomas Phan is helping me on the audio issues. Some devices play them and others just don't,  until a ME is played...

    Please keep working on this. I am developping little apps with kids and it would be easier for me to distribute games for them on the play store (parents afraid when apk installation is blocked by google).

    I didn't look for splitting the files but it must be tricky.

    Have a nice day and keep us posted.
     
    #37
    Ultima2876 likes this.
  18. Ultima2876

    Ultima2876 Veteran Veteran

    Messages:
    185
    Likes Received:
    231
    Location:
    UK
    First Language:
    English
    This has been put on the back burner for a bit while I work on improving my other tool/site, MVFU (http://www.kickbackgames.com/mvfu). I will be working on it again in the coming weeks, but unfortunately I have to balance my free time and at the moment MVFU is the higher priority (mainly because people will use that more at the beginning of their projects, whereas MVStripper is more of an end-of-project tool).

    If anyone does have requests in the meantime for features that I haven't already mentioned, please drop them here!
     
    #38
  19. Joewoof

    Joewoof Veteran Veteran

    Messages:
    106
    Likes Received:
    45
    First Language:
    English
    This is going to be amazing when I need it at the end of my project!
     
    #39
    Ultima2876 likes this.
  20. AitorFL

    AitorFL Warper Member

    Messages:
    3
    Likes Received:
    1
    Works very well! Thank you dude!
     
    #40
    Ultima2876 likes this.

Share This Page