Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: What makes the game crash/save go corrupt?  (Read 586 times)

SebasMarolo

  • Bay Watcher
    • View Profile
What makes the game crash/save go corrupt?
« on: December 27, 2016, 11:13:51 pm »

Ok, so I've been playing around with adv. mode more than usual lately. As a result, I get careless, and my adventurers suffer rather serious wounds more often. To which my response is using the task manager to close DF and start from a previous point on the save. "savescumming".

Thing is, when I save the game later down the line, a small dialog window shows up and say an error was detected, DF has to be closed, yadda yadda. Usual crash, I guess.

I use uncompresed saves because I read those get corrupted less often. Thing is, I'd like to know if the crashes happen because savesumming corrupts my save, or if it might be something else (I think trading coins or visiting the town's keep does it...)
Logged
So uh, yeah you just murdered a until proven otherwise pretty neutral innocent being for no reason.

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: What makes the game crash/save go corrupt?
« Reply #1 on: December 28, 2016, 11:42:29 am »

Never had savescumming cause corruption, but it used to do this in 0.23. You could still corrupt it by closing the process in the middle of writing to disk, I imagine.

Crashes typically happen with segmentation faults i.e. when game seeks something and finds it missing.

In adv. mode, I recall Max™ mentioning that trying to fast-travel into the center of many thousand strong army at once also causing a crash. What's the population in those keeps, I wonder?

SebasMarolo

  • Bay Watcher
    • View Profile
Re: What makes the game crash/save go corrupt?
« Reply #2 on: December 28, 2016, 11:57:54 am »

Never had savescumming cause corruption, but it used to do this in 0.23. You could still corrupt it by closing the process in the middle of writing to disk, I imagine.

Crashes typically happen with segmentation faults i.e. when game seeks something and finds it missing.

In adv. mode, I recall Max™ mentioning that trying to fast-travel into the center of many thousand strong army at once also causing a crash. What's the population in those keeps, I wonder?

No, the game doesn't crash when I enter the keep. Here's what happened:

I went into the keep.
Got down into the basement. Tried to save there on the + shaped hallway and it crashed and DF closed.

Started DF again, walked from the tavern to the keep's door, saved and no problem. Went inside, asked some guys to join me, went back to tavern room. Picked up some bone crafts and traded them with my "companions" for their iron armour (which had the symbol of two goblin civs. "the tragic hero, an image of two cabbages." I like to think the image refers to the last part of a tragic story about a goblin hero that tries to save a cursed princess but the curse turns them into cabagges.)

After trading, I try to save and bam! Error found, DF has to be closed.

You mentioned something about files not being found. I kind of downloaded DF again, should I defrag my disk to see if deleting the old and putting the new mixed the places or something?
Logged
So uh, yeah you just murdered a until proven otherwise pretty neutral innocent being for no reason.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: What makes the game crash/save go corrupt?
« Reply #3 on: December 28, 2016, 01:29:02 pm »

Segmentation fault is generally not caused by missing files, but bugs. C(++) doesn't have any bounds checking, so it happily addresses element 5000 of a 3 element array. This will either result in the return of some "random" DF data that happens to be located at that place, or it addresses a location that's outside of the bounds of DF, and the OS/CPU detects that a program is reading outside of its bounds, which typically causes C(++) programs to crash. It's possible to catch segmentation faults and write an error report and THEN terminate, but lamentably few programmers do that.

You can also get segmentation faults due to bad computer memory modules.

However, renaming the old DF folder, installing a new DF download in a new folder (possibly with the original name), and then copying the save can be worth trying. Just remember that you need to reapply any tweaks you have made to DF that are not copied into the save (such as e.g. .ini file settings).

DF is actually surprisingly resistant to save corruption during saving: it generally crashes with a fail to save the state, but the old save state is retained, or crash when trying to clean up its data after having saved the state successfully, but I have lost a couple of games due to save corruption.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: What makes the game crash/save go corrupt?
« Reply #4 on: December 28, 2016, 07:20:57 pm »

Terminating the DF process should not cause save corruption unless you are playing 0.23 or older (where it was surprisingly easy) - in 0.27 and later, all world changes are written to the "current" folder and then merged into "regionX" when you actually save the game.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.