View Issue Details

IDCategoryLast Update
0003305Bug Report2021-10-26 22:10
Status newResolutionopen
Summary0003305: Repeatedly saving and loading a game still increases save fiile size dramatically
DescriptionThis is a follow-up on issue 0002678 which I created for version 0.19.5 already. Nobody bothered to take notice since and the problem is still there in current version 0.20.11.

The issue is that whenever you load a save and save it immediately after (or, bettter: do not let enough in-game time pass) it will become significantly larger each time, until you run into out-of-memory issues. In worst case players will lose their save and all progress.

I narrowed it down to a potential solution in file state_machine.rpy. In method Machine.__init__, there is at the end the initialization of two class members:

            self.backup_default_loc = deepcopy(default_loc)
            self.backup_vars = copy(self._vars)

Those backup_* variables are used in only one place: method Machine.set_state. And this method set_state is not used at all.

This means that generally, the (deep)copies of those variables are not needed at all. I patched this file, replacing with the following:

            self.backup_default_loc = default_loc
            self.backup_vars = self._vars

This means that the backup_* variables are only references to their templates instead of copies, but since they are never used, it does not make a difference (at least if I am not overseeing something).

As a result, the saves being produced (see initial problem description) do no longer grow by 2 Megabytes each time but only by some few hundred Kilobytes, i.e. out-of-memory situations are much less likely to occur.

I really hope the dev team would look into this issue. I would think the coming tech update would be a good point to give this serious consideration. I read in the forums many times of players running into this or related problems.




2021-10-26 22:10

reporter   ~0005387

OK, version 0.20.12 finally fixes this bug. I am glad you implemented the fix exactly as I outlined it here. You could have at least commented in this bug report, however.

Ticket can be closed now.

Issue History

Date Modified Username Field Change
2021-08-29 15:04 skrskrskr New Issue
2021-10-26 22:10 skrskrskr Note Added: 0005387