Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

RPG Maker Cook Tool Deluxe

The one stop shop for deploying RPG Maker MV/MZ games · By AceOfAces

APNG isn't working.

A topic by reo created 4 days ago Views: 59 Replies: 5
Viewing posts 1 to 4

Hello

When using RPG Maker Cook Tool Deluxe, APNGs remain frozen on the first frame and do not animate.

The plugins used are three publicly available ones:

PluginCommonBase.js

ApngPicture.js

PixiApngAndGif.js

Reviewing past topics reveals posts stating that using basic plugins like PluginCommonBase.js causes this behavior.

Please verify and resolve this issue using these plugins.

Environment: Windows, RPG Maker MZ 1.9.0, RPG Maker Cook Tool Deluxe 6.1.4.

Unchecking the following two options makes APNG work, but that defeats the purpose of packaging:

Asset Preparation's “Encrypt assets” and “Source code protection”.

Please update RPG Maker Cook Tool Deluxe so it works correctly without needing to uncheck these options.

Hello, reo!

The most likely issue here is the asset compression. When it's turned on (assuming that the "Encrypt assets" option is turned on), it compresses them into WebP (by default). And the converter that handles this doesn't handle apng files. Turning the asset compression off should address this.

Hello

I unchecked Image compression, but APNG still doesn't work when Encrypt assets is checked.

(2 edits)

Right, so looking at the code for the apng plugin, I see that there's a slight compatibility issue with it. It's a tad complicated but to keep it simple: Cook Tool's patch for decrypting relies on a function in browsers that (in a way) aren't exactly compatible with MV's and MZ's setup (the decryption is async only, so I needed to get it to work with code that is synchronous). Most plugins work out of the box, as the patch ensures that everything that uses the standard loading mechanism should work. But the plugin in question does its own thing to load these. And because the decryption is async, the plugin loses the context and just fails to load. The fix for it is to change the line that uses Utils.decryptArrayBuffer to something like this:

        static decryptResource(key) {
            const resource = this._resource[key];
            Utils.decryptArrayBuffer(resource.data, (decrypted) => {
                resource.data = decrypted;
                const newKey = ApngLoader.convertDecryptExt(key);
                resource.name = newKey;
                resource.url = newKey;
                resource.extension = 'png';
                this._resource[newKey] = resource;
                delete this._resource[key];
                });
        };

This change adds a callback, so when the method above finishes, it will load it properly. I haven't tested this, but it should give a clue as to how to fix it. If you aren't able to, I'll work on a fixed version of the plugin.

I edited ApngPicture.js,

but it still doesn't work if either Encrypt assets or Source code protection is checked.

I unchecked Image compression.

I tried it in various other game projects too,

and when Encrypt assets or Source code protection is checked, it often doesn't function properly or the game won't launch.

If it's deployed and working with RPG Maker MV or MZ, I'd like it to continue working properly after packaging with Cook Tool Deluxe.

I look forward to future updates.