The International Simutrans Forum

Community => Simutrans Help Center => Topic started by: pletiplot on August 08, 2009, 10:59:01 PM

Title: Repair corrupted savegame file
Post by: pletiplot on August 08, 2009, 10:59:01 PM
Hi,
I have a savegame with long history recently I save it. But now I cant load it. It says:
FATAL ERROR: loadsave_t::rdwr_str()
string longer (376) than allowed size (256)
PRESS ANY KEY

and then windows throws Runtime Error and simutrans quits.

I then did a memtest and I found twou defect bits!
So I think the defect bit corrupted the saving process and the file is corrupted.
Is there some possibility, how to repair the file? Or some documentation on the savegame format (and I could repair it myself).
I have a backup from June, but I would be pleased if I have the recent one.
I think this could be chalange for all simutrans haxors.
Title: Re: Repair corrupted savegame file
Post by: IgorEliezer on August 09, 2009, 12:30:57 AM
Hmmm... didn't you see the board description?

QuoteSaved Games
Show us your proudest moments or latest projects. Screenshots and saved games most welcome.

If you need help, you should have posted in Help Request board. ;)
Title: Re: Repair corrupted savegame file
Post by: whoami on August 10, 2009, 01:44:16 PM
Quote from: pletiplot on August 08, 2009, 10:59:01 PM
I then did a memtest and I found twou defect bits!
It's really hard to understand why ECC didn't become standard (again) with nowaday's RAM prices. Even my gaming PC has ECC, but it's an old "workstation", the premium variant of computer. PC manufacturers reserve these professional features to the high-end segment. I conclude, from personal experience, that (in the low-end market) even rented "servers" may not have ECC etc., but may contain low-end/consumer components in a rack-mount case.

QuoteSo I think the defect bit corrupted the saving process and the file is corrupted.
It need not just have corrupted two bits when creating the savegame. Depending on the use of the defective bytes (in the address space) and the number of changes to the map (with defective RAM), any number of bits may have become defective. Therefore, many more corruptions may hide behind the first.
The loading routine could be changed to ignore defects (= omitting the object/structure with invalid data), but this would (usually) break your savegame as well, if many defects were present.

QuoteIs there some possibility, how to repair the file? Or some documentation on the savegame format (and I could repair it myself).
After saving the map in XML format, it can be edited with a text editor. But your savegame doesn't even load, to it cannot be (easily) converted to XML.
Title: Re: Repair corrupted savegame file
Post by: gerw on August 10, 2009, 03:42:14 PM
Quote from: pletiplot on August 08, 2009, 10:59:01 PM
Is there some possibility, how to repair the file? Or some documentation on the savegame format (and I could repair it myself).
The 'documentation' of the save game format is the code itself :) The rdwr-routines tell it to you... But it may become very time-consuming to repair the save game by hand.
Title: Re: Repair corrupted savegame file
Post by: pletiplot on August 11, 2009, 11:52:52 PM
I know much about IT and I know, that the defective bits in ram can affect much more bytes then them itselves. But the game was running properly, I experienced no problems. So I hoped that only few bytes are invalid and it will be repairable. I read something about the simutrans savegames, the savegame is primarily a zip with some binary data. I tried to unzip it and I saw a 3GB file inside instead of 100MB which I should see. If I repair a zip file the data can be saved, but I think not much of it. I will write some reports next time.
Title: Re: Repair corrupted savegame file
Post by: prissi on August 12, 2009, 05:44:40 AM
It could be also an error in simutrans, that you renamed something (and simutrans will automaically extend the string) but then saved a toolong string. However, usuallything isjustgone wrong.

The games are notzip, but Z compressed. Since you uncompressed file is more thn five time of the compressed file, I think rather the file itself is damaged, since typically the ompression is not as good (depends of course on the game in question). Damaged savegames are usually way too large after unpacking.