Attnam / ivan

Iter Vehemens ad Necem - a continuation of the graphical roguelike by members of http://attnam.com
GNU General Public License v2.0
305 stars 42 forks source link

"Continue game" with older save versions freezes #565

Open andrewtweber opened 5 years ago

andrewtweber commented 5 years ago

In 0.57 on Mac, when I tried "Continue game" the game would freeze and I would have to force quit. Tried multiple times.

After I cleared out my save directory (~/Library/Application Support/IVAN/Save/) it works.

Probably should've checked the save files first but I'm guessing they were 0.56.

AquariusPower commented 5 years ago

To detect an old save, it will read the old file structure to collect the savegame version, I am quite sure the freezing happened at this point as such structure may have changed from 0.56 to 0.57

If I am not wrong, there is an option to disable importing old saves and that could help to prevent freezing, not sure tho.

Anyway, that code (that detects old saves) could be better protected against freezes and show something like "???" (instead of the detected version) in case the structure being read fails/crashes for any reason. The worst case would be the freeze be an infinite loop trying to read a wrong structure (if it is possible to happen at all, may be high CPU usage could hint that), and the only option would be to clear the save path as you did.

andrewtweber commented 5 years ago

Yeah I wanted to suggest detecting a failure and just skipping that save, or better yet displaying that the file can't be converted. But infinite loop is the exact scenario I was thinking about that would be difficult to detect and fail nicely.

AquariusPower commented 5 years ago

instead of just "continue" we could also have "continue last" (or something like that), this way everything prone to fail while listing old savegames could be ignored. It would just look for the newest savegame and load it.