How to solve the problem of slow archive speed in the world? Many players feel that the archive speed is too slow when playing this game. The following is a method to optimize the archive speed for your reference.
Unpack it directly and find the archived part of the code, and find that it is simply Base64.
There is 3M after Base64, which means....
Do it After removing the Base64 process, I found that the original archive content was as high as 21M...
What on earth did you save to have so much data?
When I opened it, it was amazing. Crash
Not only countless Nulls were saved, but also a large amount of data that was unnecessary to be saved
Item descriptions and the like were visible all over the screen, and even map prompts were there. Among them
I did an experiment and went to the store to buy dozens of pieces of equipment, then sold them immediately and saved them again
The archive file grew visibly. Although the equipment was sold, There is also data saving
This is why our archives are growing infinitely and saving is getting slower and slower
Solving the problem by hand
Initially The idea was to manually clean up the junk data in the archive
Later I found out that it was too naive and there was no way to start
I just kept doing it and just removed the Base64 steps. Okay
How long does it take to read and write 20M? The main reason is Base64
1. First open the game normally, free up the save slot No. 10, close the game, and then move to No. 10 This is our quick save location
2. Unpack
Just search for "RPGMakerMV Unpack", I won’t go into details here.
3 .Modify
Find the unpacked file, open it in the game directory %DEFAULT FOLDER% / js / rpg_managers.js
, and search for StorageManager.saveToLocalFile
StorageManager.saveToLocalFile = function(savefileId, json) { var data = LZString.compressToBase64(json); var fs = require('fs'); var dirPath = this.localFileDirectoryPath(); var filePath = this.localFilePath(savefileId); if (!fs.existsSync(dirPath)) { fs.mkdirSync(dirPath); } fs.writeFileSync(filePath, data); };
Modify to
StorageManager.saveToLocalFile = function(savefileId, json) { var fs = require('fs'); var dirPath = this.localFileDirectoryPath(); var filePath = this.localFilePath(savefileId); if (!fs.existsSync (dirPath)) { fs.mkdirSync(dirPath); } if (savefileId == 10) { fs.writeFileSync(filePath, json); } else { fs.writeFileSync(filePath, LZString.compressToBase64(json)); } };
Then the following
StorageManager.loadFromLocalFile = function(savefileId) { var data = null; var fs = require('fs'); var filePath = this.localFilePath( savefileId); if (fs.existsSync(filePath)) { data = fs.readFileSync(filePath, { encoding: 'utf8' }); } return LZString.decompressFromBase64(data); };
Modify to
StorageManager.loadFromLocalFile = function(savefileId) { var data = null; var fs = require('fs'); var filePath = this.localFilePath(savefileId); if (fs.existsSync(filePath)) { data = fs.readFileSync(filePath, { encoding: 'utf8' }); } if (savefileId == 10) { return data; } else { return LZString.decompressFromBase64(data); } };
4. Run the unpacked game
Copy the entire original save folder to www
Move all contents under %DEFAULT FOLDER% to www
Run TheWorld_unpacked.exe to enter the game
(You can also delete the original TheWorld.exe and rename unpacked.exe so that it can be launched from steam)
5. Next, save in position 10 and experience the saving speed at the very beginning of the game
Notes
1. Repeat the above steps every time the game is updated
Notes
p>
(Except for the first step)
(Except for copying the save folder in the fourth step)
2. Please back up the original archive during the first operation
< p>3. The archive size will become much larger. If the cloud archive is too slow, it is recommended to turn off the cloud archive first4. Try to use the game's own quick archive function (~), click "Archive" from the menu It will still be stuck when entering the save.
5. After modification, you will actually use the save archive in the www folder. After a normal game update, the save archive in the game directory will be used by default. Be careful not to get confused. , thought the archive was lost