ThinkN

Villager
Member
Joined
Aug 11, 2020
Messages
15
Reaction score
18
First Language
English
Primarily Uses
RMMV
This is an RPG Maker MV plugin that uses a web worker to asynchronously compress data in a background thread. The data is then asynchronously saved to disk or browser storage.

Link to the plugin & sample project on Github

Is this a port of MZ's async code to MV?
No! This code uses the same open-source external libraries as MZ (localforage and pako) so it is able to accomplish some of the same things. However the code is very clearly just MV with some "async" and "await" keywords thrown in. No code was copy+pasted from MZ.

MZ's code does this:
  • Saving is asynchronous
  • Compressing save data is asynchronous, but uses the main thread
  • Loading is asynchronous
Whereas this plugin does this:
  • Saving is asynchronous
  • Compressing save data is asynchronous AND uses a dedicated thread via a web worker
  • Loading is synchronous like default MV
Is this code ready for production?
Probably not! I'm really only releasing it to inspire more talented people than me. Someone in the community must be a pro at using web workers, and I'd love to see them take this technology and really make it polished and stable.

UPDATE:
I've tested in these environments and it's been working fine:
  • Windows, deployment
  • Windows, latest Firefox
  • Windows, latest Edge
  • Mac, latest Safari
  • Android, latest Chrome

How to use in your own project
  • Copy js/libs/localforage.min.js and js/libs/pako.min.js into your own js/libs
    Add script tags for localforage and pako into your index.html file
    • Copy the files from js/plugins into your own project's plugins folder.
    • Delete N_BloatSave if you don't want it. It's just for testing.
  • Activate N_SaveManager in your plugin manager.

Changelog
  • v1.0.6 Merged extra file into main plugin file (again).
  • v1.0.5 Simplified backup so it doesn't decompress and then re-compress data unnecessarily.
  • v1.0.4
    • Simplified: Removed unneeded methods.
    • Performance: Made creation of backups asynchronous.
    • Performance: Moved coding and decoding data into worker.
  • v1.0.3 Merged extra file into main plugin file.
  • v1.0.2 Threads are now terminated immediately after they deliver their payload, preventing a memory leak.
  • v1.0.1 Removed an unneeded function.
  • v1.0.0 release.
 
Last edited:

siuleeboss

Veteran
Veteran
Joined
Apr 29, 2019
Messages
58
Reaction score
14
First Language
Chinese
Primarily Uses
RMMV
Hi, I use your plugin to run fine on computer and Android 11, but on some android 7 emulators like BlueStacks 5, and also on phones with android 6.0.1, I get this error, please How to solve?
Screenshot_2022.05.21_10.41.00.880.png
 

Latest Threads

Latest Posts

Latest Profile Posts

The game's opening, now fully polished! :LZScheeze:





Aaand, here's me working on it in today's "Game Making Every Day" video! :LZSooo:

Hello! Can anyone help me? I followed making cooking tutorial for RPG Maker MV. But for some reason buff state that food gives doesn't work in overworld. It disappears. What am I supposed to do?
A shotgun is not a rifle. Huh.
SIGH its so hard to convince my friend that making a game for fun and making one to sell takes different planning. I don't care about weird bothersome ways of doing things in a game made for fun, but when you are planning to market it, there is some stuff that you just have to streamline or cut out.
It might be a little bit boring and tedious, but building that database of armor, items, weapons and skills are super important.

Forum statistics

Threads
124,399
Messages
1,163,347
Members
163,198
Latest member
Oneesama
Top