Problem description:
I am unsure how player saving works. Apparently on my game every time you hit save, the save file gets larger by 1kb even though the character has not moved or just afk. Basically, the save file is getting larger over time. Anyone know what's causing this? Is it normal? If not, what can you suggest to make saving efficient? Thanks.
Is setting 'World Time' (00:00:00 AM for example) on a global var save on the player's save file? If I make it tmp would the time reset if the player relogs or would the world time reset only reset during server reboot?
|
Also, would setting the 'correct' saving system lower the player's save files when I make changes to it or will it be permanent?
|
Global variables aren't saved, therefore, there's no reason to make them tmp.
If you save the value of the global variable to the savefile, it will enter the buffer, but won't be read back by default unless you tell it to. And no, changing your savefile system won't do anything to change your file size. In all likelihood, changing your saving system will make the savefiles incompatible with the new system. Like I just told you, though, there's no way to clear old data out of a savefile without first deleting it. |
F["mob"] << src
Would saving it using that line cause the larger save files? Or does it save unnecessary data to the save? |
The above is a link to a two-part saving tutorial.
Generally speaking, this is caused by not marking variables as temporary when they should be, saving icons, etc. What happens, is essentially every time you save an object, the savefile gets an internal representation of that object. If the object is loaded from the savefile, it isn't removed. Thus, if you overwrite the savefile, the old object's internal representations remain, even if you didn't save the object again.
Getting your saving under control by not saving things you don't mean to, and fully understanding how savefiles work is your best bet. In large part, understanding why and when to mark variables a tmp is a big part of this. Most of the major rips store non-temporary references to other players, which can quite often cause other peoples' players to be saved in the current player's savefile. In some cases, this can cause a massive chain-reaction where other peoples' players are stored all over the place within the save database.
Read through my tutorials, get to know savefiles, and then take a look at your saving system.