While looking for ways to add my own data to the save file, I noticed, that there is a character limit to save files:
Code:
DataManager.saveGameWithoutRescue = function(savefileId) {
var json = JsonEx.stringify(this.makeSaveContents());
if (json.length >= 200000) {
console.warn('Save data too big!');
}
StorageManager.save(savefileId, json);
this._lastAccessedId = savefileId;
var globalInfo = this.loadGlobalInfo() || [];
globalInfo[savefileId] = this.makeSavefileInfo();
this.saveGlobalInfo(globalInfo);
return true;
};
After some web searching I only found a few topics on this, one mentioned that this 200000 limit is because of parser issues when files get longer than that. One topic also mentioned reaching this limit on a 101x100 or so map with 100 events.
I don't plan to have that many events on a map, but it made me a bit nervous about just putting my own save data into the regular file.
What I do might have are files that look like this in json:
Code:
[
[ {"x":100,"y":100,"waiting":12000,"busy":120}, {"x":120,"y":120,"waiting":7000,"busy":110} ],
[ {"x":12,"y":200,"waiting":14000,"busy":170} ]
]
They store the minimum amount of information I need if I want to recreate the Townbuilding I have in VXAce in MV.
So a single building is about {"x":100,"y":100,"waiting":12000,"busy":120} which is length 44. Lets be a bit generous and assume 20 buildings for each town and 10 towns each in 7 regions, we are already at ~ 62000 charcters not counting , and [].
From what I have read in the past 2 Threads there are probably 2 ways to save, one for desktop and one for all deployment.
So should I try and create my own save files in addition to the default ones to store that data and edit the DataManager functions based on the existing DataManager functions, or is there again a better way, thats just wasn't picked because it didn't exist in the old version of JS that was used when MV was created?