"Exclude Unused Files" at Deployment removes some used files in RMMZ

Hello Everyone,

This is my first time posting a thread so i'm unsure about the location and method, so please let me know if I am doing it wrong 🙂

In order to upload a game to itch.io, the size has to be less than 1 GB and it can't contain more than 500 files.
To that end, I need to deploy my game at the smallest possible size, and using the "Exclude Unused Files" feature seemes like the most efficient way to do this.
However, this feature excludes some Very used files and the result is a game that doesn't run.
The files used files that are excluded and causing the problem are namely the ones used in Plugins. I found a work around for some of these in an earlier thread about a related topic here, which was very helpful but didn't address the exact problems I am having.
In that thread, a very helpful pdf by @JohnDoeNews explains that you should create an event in an extra map and trigger all your plugin files in regular event commands. That way your game will no longer consider them "unused". This works for files that are located within the pre-existing folders in my project, but I can't figure out how to do it for files located within new floder that are created for the plugins specifically. Here is an example:

I use Galv's Layer Graphics MZ plugin. For that, I have to create a "layers" folder inside the "img" folder to house my graphics files in. I can not figure out how to access any image file directly from this "layers" older in an regular event command in order to place in the above mentioned extra map, and "trick" rpgm into thinking it is a used file.
Is there a way to achieve this?
Can it be done through script calls?

Any help on this would be much appreciated

Thank you in advance

ps. I originally tried posting a reply in the tread i mentioned above but for some reason my comment never got approved
The fastest and easiest way to do this is to manually remove all of the unused files and on deployment so not check the removed unused files check box.
I'm not sure about MZ but MV will not remove folders or files from game's root directory so you can move layers directory out of img.
I don't know if this exists in MZ, but MV had a script command to register files to the editor for exactly this case.
and while it was supposed to be used by each plugin for its own files, nothing prevents that to be used by a quick custom plugin for files from other plugins.

however as said I haven't used MZ enough to tell its equivalent to that option.
Ideas:
  1. If you're not using encryption then replacing the missing layers images after deployment is probably the easiest option.

    With the built-in encryption, a workaround may be to:
    • Move img/layers -> img/pictures/layers;
    • Add references in-game;
    • Deploy game;
    • Move the deployed img/pictures/layers -> img/layers.

  2. You could try this plugin:

  3. You could write a small plugin of your own, in this format:
    JavaScript:
    /*:
     * @target MZ
     * @plugindesc Include extra resources.
     * @help Free to use and/or modify for any project, no credit required.
     * @requiredAssets img/layers/clouds
     * @requiredAssets img/layers/trees
     */
    This should specifically avoid excluding img/layers/clouds.png and img/layers/trees.png.

  4. You could try editing the plugin header of Galv's plugin. Replace each instance of this line:

    @dir img/layers/
    ...with this:

    @require 1 @dir img/layers/
    Allegedly @require was only needed in MV (@type file and @dir etc should be sufficient) but I figure it's worth trying.
Like @TheAM-Dol says, though, I think I'd personally just avoid using "Exclude unused files".
Also worth to mention, are you turning your folder into a .Zip file?
Thank you everyone for your quick and helpful replies!
I will try out the suggestions and see which works best for me.
@TheAM-Dol Since I am not a programmer and fairly new to development, I thought it might be safer to let the engine do it, But with your encouragement, i will try it by hand. My question here would be, is it only removing media files (images, audio, animations...) or is it also removing some data or other kinds of files i know nothing about, that might be taking up space and number but still unused?

@Martin_Arcainess yes I am zipping the folder after deployment, which reduces the size by a lot.
You know you don't have to reduce the size at all and just use Butler which allows you the ability to bypass the 1GB limit to upload your project and for those who don't understand Butler these is an easier GUI version of Butler on itch.io too, but of course I would still recommend you zip it first before uploading it.
Thanks I will check out Butler as you suggested.
TBH, another reason i am trying to keep my game as small as possible is because I live in a country where the internet is really slow, has download limits and sometimes just straight up goes away for days. It just makes it more efficient for both up- and download the smaller the size is.
But it is definitely useful to way all the options, so thanks for pointing it out.
Hello Everyone,

This is my first time posting a thread so i'm unsure about the location and method, so please let me know if I am doing it wrong 🙂

In order to upload a game to itch.io, the size has to be less than 1 GB and it can't contain more than 500 files.
To that end, I need to deploy my game at the smallest possible size, and using the "Exclude Unused Files" feature seemes like the most efficient way to do this.
However, this feature excludes some Very used files and the result is a game that doesn't run.
The files used files that are excluded and causing the problem are namely the ones used in Plugins. I found a work around for some of these in an earlier thread about a related topic here, which was very helpful but didn't address the exact problems I am having.
In that thread, a very helpful pdf by @JohnDoeNews explains that you should create an event in an extra map and trigger all your plugin files in regular event commands. That way your game will no longer consider them "unused". This works for files that are located within the pre-existing folders in my project, but I can't figure out how to do it for files located within new floder that are created for the plugins specifically. Here is an example:

I use Galv's Layer Graphics MZ plugin. For that, I have to create a "layers" folder inside the "img" folder to house my graphics files in. I can not figure out how to access any image file directly from this "layers" older in an regular event command in order to place in the above mentioned extra map, and "trick" rpgm into thinking it is a used file.
Is there a way to achieve this?
Can it be done through script calls?

Any help on this would be much appreciated

Thank you in advance

ps. I originally tried posting a reply in the tread i mentioned above but for some reason my comment never got approved
u can send pm to the staff and ask them to cap up to 2 or 3 GB if your game is big or contains at least 3gbs due to ogg format that has twice better size for your music.

my game was atleast 2gb or 3gb since i import my music to mz.

The only trick to get reduce size is to rename mp3 to ogg so it will trick the engine thinking it's ogg and its 100% perfect!
Hello again everyone,
So i ended up removing the unused files by hand, which most of you advised as the safest way.
My upload of downloadable game files, both Mac and Windows versions, seem to be working perfectly.
However, I've encountered a problem when I try to upload a version playable in the browser:
After uploading and saving, I go to the game page, where i am asked to wait because the game is loading for the first time. A couple of minutes later, I get this error message:

"There was a problem loading your project:​

Put "https://storage.googleapis.com/itchio/html/11414528/GMTK 24 web/img/parallaxes/tbc.png": context canceled
Please try deleting the ZIP file and uploading another one."

Spoiler: screen capture
Screenshot 2024-09-07 at 19.18.57.png

Any idea about how I can fix that?
Is it ok that I am asking this here as a continuation of my earlier problem?
or should I open a new thread especially for this?

Thanks in advance for your help
I did a quick search online and found these links:
  1. https://www.reddit.com/r/RPGMakerMV/comments/1060td9/
    • The non-standard filenames in Galv's Character Frames may cause problems.
  2. https://www.reddit.com/r/godot/comments/1chbyz5/
    • Uploading from a different browser may help.
Otherwise, since this looks like a different problem, I'd suggest starting a new thread. 👋
There have been other threads about this, one just recently.

I'd recommend using the plugin parameter in Galv's plugin to change the character it uses away from %, since % is used by HTML to initiate character codes in URLs.
Thanks for the replies.

From the content of the error message, it doesn't look like the problem is related to galv pluggins, but from a regular parallax.
I tried to see what happens if I just took out that particular parallax from the game (it's the only one anyway), and got a different error about the Button Set:

"Put "https://storage.googleapis.com/itchio/html/11417696/img/system/ButtonSet.png": context canceled "

I will try your galv suggestion and look at links offered above to see if they help.

If none of them work, I will open a new thread as @caethyril suggested.

Otherwise, @ATT_Turan I found a couple of threads about the general problem of uploading to itch, but none that encountered these kinds errors. I tried to post a question in one several times, but it never worked (not sure why). If you've found a similar thread, can you link it here please, if possible.
It seems it was the % that i had forgotten in a character sheet name from a previous version of the game when i had used Galv's character frames plugin!
I took it out and it works!

Thanks again to everyone for your help.
Now that this is all resolved, is there a way for me to close this thread? Or is that a job for a moderator or admin or someone else with power?
(please excuse the noob questions; this is my first thread:LZSangel:)
Great! 😂

Since I'm here, I'll close this for you~

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.


In future, if your support thread is solved, you can report it to be closed by clicking the Report button on one of your posts in that thread:

report.png

When reporting a post, you'll be asked to give a reason. You can enter "problem solved" or "can be closed", something like that. Reports show up for the moderator team, and one of us can close the thread. 👋

Original thread: https://forums.rpgmakerweb.com/threads/exclude-unused-files-at-deployment-removes-some-used-files-in-rmmz.170802/