itch.io is community of indie game creators and players

How to update NW.js in RPG Maker MV (for RPG devs)

RPG Maker MV has unfortunately stopped receiving updates to its runtime in 2018, and the Linux deployment target for Windows installations of the editor specifically has not been updated since 2015, which causes performance and compatibility issues on modern systems.

(Additionally, developing plugins for the 2015 runtime is unnecessarily painful due to missing features, so to spare my sanity, I require the 2018 runtime for my plugins.)

Fortunately, RPG Maker MV uses an unmodified copy of NW.js as its runtime for desktop deployment, which means it’s pretty easy to update it manually! The process isn’t really different between development OS, so I’ll go through it target by target.

What is NW.js?

NW.js, “(previously known as node-webkit)”, is a program to develop desktop apps using JavaScript. It combines the Node.js runtime (for, among other things, local file system access) with the Chromium browser runtime (for rendering HTML-based user interfaces, though RPG Maker mostly renders into a single <canvas> element).

Current versions of this runtime come with large improvements to JavaScript performance and much wider support for hardware-accelerated (WebGL mode) rendering in RPG Maker, so if your players are reporting performance issues, even on older devices, updating NW.js can fix many of them.

Additionally, all versions of NW.js that come with RPG Maker MV are incompatible with current versions of the gconf package on Linux, which prevents the deployed games and the editor playtest from starting entirely on this system. (When run from the terminal, this will usually report “Fontconfig warning:” errors.)

How to check the NW.js version

To check which NW.js version an RPG Maker game uses, rename the package.json file in its folder and then start it normally. You should see a window like this, listing a few version numbers:

As of writing this, the most recent stable nw.js version is v0.72.0.

How to Update

Game Project Update

If your project was newly created with RPG Maker MV, it may have an empty name entry in its package.json file, like this: "name": "",, or it may have a generic name. While this name isn’t directly shown to the user, it’s important to choose a somewhat unique value here to avoid errors.

It’s customary to format it like "project-name-in-lowercase-with-dashes", but of course please use your actual project name here instead.

If you leave value empty or use special characters, you may get an error message like this:

Error Loading Extension

Failed to load extension from: (path to your game). Required value ‘name’ is missing or invalid.

Unfortunately, RPG Maker MV also resets this to KADOKAWA/RPGMV during deployment, which can cause the following warning when later playing other RPG Maker MV games:

Profile error occurred

Your profile can not be used because it is from a newer version of NW.js.

Some features may be unavailable. Please specify a different profile directory or use a newer version of NW.js.

[ ] Send feedback to help us fix this issue.

[OK]

For this reason, please remember to edit this file with a unique name in your deployed game too.

If the error is already occurring on your system, you can clear it by removing or renaming the following folder:

Windows: %LOCALAPPDATA%/KADOKAWA/RPGMV/
Mac: ~/Library/Application Support/KADOKAWA/RPGMV/
Linux: ~/.config/KADOKAWA/RPGMV
(source)

(Paste the path into the address bar of your file browser to navigate there.)

Game Project Update (MZ)

When using RPG Maker MZ, the name is aggressively reset to rmmz-game each time you load the project.

This means you don’t have to edit it in your project files, but you should still edit in the deployed game to avoid the second error above on your players’ computers.

If the error is already occurring due to RPG Maker MZ, this is the folder to delete or rename:

Windows: %LOCALAPPDATA%/rmmz-game/
Mac: ~/Library/Application Support/rmmz-game/
Linux: ~/.config/rmmz-game

Sadly, this is likely something that can’t be easily properly fixed with a plugin.

Runtime Download and Folder Locations

You can download the current versions of the runtime from https://nwjs.io/downloads/, but some extra files are necessary to make the games work properly. For now, download the “Stable”, “64-bit” “Normal” version of each OS your game should support. Additionally, download the matching “SDK” version for the OS you are using the editor in. The latter is used for playtesting.

Open the installation folder of RPG Maker MV. In Steam, you can find this by right-clicking on the entry in the games list and choosing “Manage” > “Browse local files”. You should see, among others, the nwjs-lnx and nwjs-win folders, as well as, at least on those operating systems, one nwjs-…-test folder.

These are the folders that need to be modified. (You can always reset them by deleting them entirely and verifying your RPG Maker MV installation through Steam, but it’s helpful to copy them elsewhere now, too, in case you’d like to quickly change runtime versions later.)

Linux (deployment target)

Open the lwjs-lnx folder and delete all except the following files:

  • package.json
  • Game.desktop

(icon/icon.png appears to be unused here, as is www/icon/icon.png if you have it. The actual icon is, or should be, in your game project folder.)

Then, extract the runtime files from the nwjs-v…-linux-x64.tar.gz archive so that the new folder contents look like this:

(If you can’t open the archive on Windows, 7-Zip is a great archive tool there.)

Please double-check that you have deleted the Game executable (without file extension). It is not needed in the updated runtime but is the main file of the old runtime, which may be confusing to players as it may still work after the other files are replaced.

Done, you can now deploy your games for modern Linux systems.

Your players can run either nw or the ….desktop file to start the game after extracting it.

Bonus: .itch.toml

If you create a .itch.toml app manifest, it becomes much easier for players to start your game from the Itch app.

If you upload the contents of the output folder directly to itch.io without wrapping folder inside the archive, then the following nwjs-lnx/.itch.toml file works for all RPG Maker NW games:

[[actions]]
name = "play"
path = "nw"
platform = "linux"
sandbox = true

(Platform and sandbox opt-in are optional, but probably nice to have. Enabling the sandbox means that plugin scripts won’t get access to your players’ document folder, but can still read and write the game folder just fine.)

Bonus: Rename Game.desktop

You can freely rename and edit the ….desktop file with a plaintext editor to suit your game, ideally after deployment.

(Best leave the Exec= and Type= keys as they are.)

Unfortunately, the format doesn’t understand relative paths, so you can’t easily set up a nice icon for it. Looks like app icons on Linux are quite tricky for unpackaged software!

(The included desktop file is slightly misused, in that regard, but I suppose it mostly works?)

Linux (playtest)

Since the nwjs-lnx-test folder isn’t deployed to the player, there’s no need to clean it. Just extract the files from nwjs-sdk-v…-linux-x64.tar.gz and choose ‘Write into’ and/or ‘Overwrite’ when prompted.

The folder should look about like this:

Done, you can now playtest on Linux from the editor.

Windows (deployment target)

(Coming soon, but much like Linux (deployment target) above. Game.exe is essentially just a renamed nw.exe from the nwjs-v…-win-x64.zip archive. RPG Maker should be able to apply the icon as before if you rename that file to replace the older one. I’ll look into and test this once I’m able to.)

Windows (playtest)

Much like for Linux (playtest) above, extract the contents of nwjs-sdk-v…-win-x64.zip into nwjs-win-test, overwriting files. The folder’s contents should now look like this:

You should probably also delete the original Game.exe and rename nw.exe to Game.exe. I’ll check if this is the case once I can, or leave a comment if you do.

Mac OS X

I can’t help with this target since I don’t own any Apple devices, and Apple has recently increased the restrictions on sideloaded apps. If you know more about this, please let us know in the comments!

Read comments (6)