RMMV [MV] Let's get multi-threaded: Saving data!


Aug 11, 2020
Reaction score
First Language
Primarily Uses
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.

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.

  • 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:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I started really going in on my project April of last year... I'm just now making starting the actual game... making assets (and not even all of them), whoooo... TIME SINK.

Imagine being a pleb and using --------------------.js :LZSwink:
--- Survival For RPGist Part 2 ---

Survivalist: Now,I going to Test you: Fishing with Spear
M.Spear Knight: Leave it to me.
(M.Spear Knight Spearing the Fish with His Battle Spear)
M.Spear Knight: How it is?
Survivalist: I know you did it,but...Is that the Spear for Battle,not for Fishing?
M.Spear Knight: But,is that same?
Survivalist: (Sigh)...Whatever

Forum statistics

Latest member