If you are someone who plays a large amount of (presumably free) RPG Maker MV games, you've probably noticed that A) the game engine runs in the NWJS web browser wrapper (competitor to and predecessor of Electron), and B) the directories of such games (on Windows, at least) are usually cluttered with the same multi-megabyte DLLs and other files. You might also know that, if you have a copy of NWJS by yourself, it is possible to use it to launch and run the game, instead of the game's own packaged runtime. This post describes how to download such a copy, and have every MV game in your possession simply launch that instead of their own copy.
This has a few small benefits:
- You save ≈120MB of hard drive space, per game. If you apply this to 10 such games, that's over a gigabyte in savings.
DataManager.maxSavefiles=()=>99in the console, before entering the game's save file list.)
For these examples, I'm using the free game Dweller's Empty Path, however, this example is purely arbitrary. This guide is also Windows only. However, it should be possible to approximate all of these steps in your own OS. Finally, this guide can be used with MZ games instead of MV, but I haven't actually attempted this with any MZ games yet.
1. Download the SDK build of NWJS and place it somewhere on your hard drive.
The difference between the SDK build and the normal build of NWJS is that the SDK build has Developer Tools enabled. There may be some slight performance reductions when using the SDK build on certain games, but I haven't noticed any in my experience.
2. If the game is wrapped using virtualisation software such as Enigma Virtual Box, extract it.
If the game is a single executable with no
www folder in its directory, but is still visibly an RPG Maker MV game, it's highly likely that it uses something like Enigma Virtual Box to bundle its files. You can usually extract all of the files using Enigma VB Unpacker. (In the highly unlikely event that it uses something more sophisticated like Enigma Protector, there is still a way to extract the files using something like Virtual File System Editor, but this is far too tedious to explain here.)
3. Delete every file and folder except
package.json, and any Read Me files and Extra directories created by the game author.
Yes, all of that stuff, including the
.exe, is completely separate from the game itself, and is only necessary for running NWJS. That being said, make sure you're certain which files and folders were created by the game author. As a rule, NWJS uses no
.txt files, and the only folders it uses are
credits.html always refers to NWJS's credits - not the game's credits or even the MV engine's credits - and thus can always be disposed of.
4. Edit the
package.json file to fix the
"name" and optionally add
Now, this is not necessary if you are using NWJS 0.29.4, but on later versions, the
"name" field needs to not be blank. You should ideally type the game's name here. These later NWJS versions will create a folder in
AppData\Local with the same name as the
"name", to store runtime caches and crash logs (not MV save files, however), so take care not to use a
"name" value that would result in collisions with existing folders.
"position":"center" to the
"window" object ensures that the game window is initially centered on the screen, when playing in non-fullscreen mode. I personally relish this setting.
5. Create a
.lnk shortcut pointing to
nw.exe with the command-line argument
Make sure the Target points to the
.exe of the NWJS version downloaded in step 1. Also, "Start In" must either be blank (if you're storing this shortcut in the game's folder), or refer to the game's folder. Use this to launch the game instead of the
At this point you might notice that the
.lnk shortcut will simply have the NWJS icon, instead of any game-specific icons that the
.exe might have had. Fortunately, a copy of the
.exe's icon is also present in
www\icon\icon.png, so you can simply perform the following to adjust the icon:
.icoformat, leaving the copy in the folder.
- Use "Change Icon" in the
.lnk's Properties window, and select the created
Personally, though, I don't bother with it, especially given a large number of free MV games simply do not have custom icons.
Despite the seemingly large number of steps involved, I consider this a relatively simple operation. Step 1 only has to be performed once (although you may wish to update your NWJS version periodically), step 2 seldom needs to be performed, and step 5 can be mostly shortcutted by simply copying a similar
.lnk that you created for another MV game, and renaming it. This also may sound like it carries a lot of risks and is rather brittle, but I've had remarkably few problems playing games like this.