Jump to content

Corrupt save file recovery


Recommended Posts

I recently lost a very neat and hard-earned career (tears streaming down my face :P) to a corrupt save file, I've been looking everywhere for ways to rescue the persistent.sfs file, but can't figure out a way or can't identify what is wrong with mine.

It would be great to have an external app or editor that could diagnose corrupt save files, since I'm guessing it could be wrong syntax or missing braces or those sorts of identifiable mistakes that lead to the file not being read properly.

What happens exactly is that when I go to "Resume Saved", and press on my save, the on load, the load button animates the click but can't seem to load the save.

If anyone could help me out it would be awesome, just let me know hot to attach my persistent.sfs file.

Many thanks,

Link to comment
Share on other sites

If you are on windows 7 I may have a recovery solution for you. Right click on your persistent.sfs file, go to properties and hopefully you'll have a past versions tab. From that tab you should be able to select a version of the file from a day or two ago. Might not be exactly where you left off, but will be better that loosing it all.

For the future, I have a tool that will protect you against any save or craft file becoming corrupt (as well as those times when you forget to quicksave). It's a bit out of date, but still works fine in the current KSP. Jebretary is a version control manager that runs as a stand-alone program so it can manage version control for multiple KSP installs. It tracks every single quicksave and autosave so you can revert to any point in your saves history. It also tracks how each craft is each time you edit and then launch so you can rewind any crafts development too.

It uses the git version control system (so you do need to install that too), but it handles all the interaction with git so you don't have to worry about it. By using git it is much more space efficient than just taking copies of save and craft files. It runs as a web server on your KSP machine and you interface with it using your browser (and you can also access it on any web device that's connected to your local network).

Link to comment
Share on other sites

Typically speaking, a corrupt save file is most commonly simply truncated -- that is, the write operation is interrupted, and you're left with a file is that simply incomplete, missing all the data after a certain point. It's generally not possible to infer the vast majority of the lost data, and the only way you could attempt to "recover" it is by attempting to patch in any missing data with the default values. Such an operation is likely to be highly prone to glitches and bugs, but is theoretically somewhat possible.

Link to comment
Share on other sites

One simple solution for a quick fix would be to have 3 save files:

persistant.sfs - the current save

persistant.sfs.2 - the previous save

persistant.sfs.3 - the save before the previous one.

If the game is saved, the following happens in that order:

1. persistant.sfs.2 is copied to persistant.sfs.3

2. If 1 was successful: persistant.sfs is copied to persistant.sfs.2

3. If 2 was successful: the new (current) persistant.sfs is written to disk.

This way a player would not loose more than a few minutes of gameplay if something bad happens.

Link to comment
Share on other sites

One simple solution for a quick fix would be to have 3 save files:

persistant.sfs - the current save

persistant.sfs.2 - the previous save

persistant.sfs.3 - the save before the previous one.

The game already does that to an extent, but it requires the user to take the prudent step of manually saving every once in a while (e.g. after every significant change).

Right now, you have persistent.sfs automatically managed, quicksave.sfs manually (but extremely easy and conveniently) managed, and unlimited named saves (default "quicksave #number.sfs") manually managed from the Esc menu at the KSC screen.

I do not agree with having many levels of automatic backup for persistent.sfs, but do agree that it would be a simple enhancement to preserve the immediately previous version. It doesn't need to be as complex as your suggestion, as a move/rename is a safe "atomic" (100% success, or 100% fail, no halfway points leaving inconsistency) operation on all 3 operating systems supported by KSP. Just rename the current persistent.sfs to persistent.sfs.bak, the OS semantics are that any failure there will leave the file untouched as its previous name (unless your filesystem is broken, in which case nothing an application does can guarantee or improve safety).

I'm strongly against any unnecessary complexity related to persistent.sfs, as it is automatically saved frequently during game play. For example, copying it to a backup is orders of magnitude slower than renaming it; copying would double to triple the most time intensive part of saving. Additionally, if something with game or system state has created a situation which would be likely to corrupt the save, copying would make it very likely that you would also have a corrupted backup, where renaming does not touch the actual data blocks and is very unlikely to corrupt the file unless the filesystem is broken.

If you're not frequently hitting F5 to quick save after significant operations in the game, you should be, and you really need to get into the habit of doing that, even if you don't believe in undoing player mistakes via quick load. Then, at the end of each session, or other points where you've made significant progress that you don't want to lose, you should be using the named save feature.

Edited by Murph
Link to comment
Share on other sites

  • 2 years later...
  • 2 years later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...