Corrupted save file of 110+ hour game save

Place for things which are bugs but we have no idea how to solve them. Things related to hardware, libraries, strange setups, etc.
Post Reply
Leosmellsgood
Inserter
Inserter
Posts: 30
Joined: Fri Jan 16, 2015 10:35 am
Contact:

Corrupted save file of 110+ hour game save

Post by Leosmellsgood »

Opening zip C:/Users/leosm/AppData/Roaming/Factorio/saves/Pre 16.zip failed: Bad zip file
Also says invalid or corrupt file and prompts me to delete the save. This is my biggest save and probably in the top 1% of factories out there. It has 150M iron plate produced and up to 10Gw power consumption. I dont want to abandon this save :( When I try to extract the files I get the error message "C:\Users\leosm\AppData\Roaming\Factorio\saves\Pre 16.zip: The archive is corrupt". Any help is appreciated. :|
Attachments
Pre 16.zip
(Its big)
(82.26 MiB) Downloaded 190 times

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Corrupted save file of 110+ hour game save

Post by impetus maximus »

you have auto save slots disabled?

Leosmellsgood
Inserter
Inserter
Posts: 30
Joined: Fri Jan 16, 2015 10:35 am
Contact:

Re: Corrupted save file of 110+ hour game save

Post by Leosmellsgood »

Yes i do, last autosave was at 21 hours

Koub
Global Moderator
Global Moderator
Posts: 7175
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Corrupted save file of 110+ hour game save

Post by Koub »

Your save file is incomplete : from byte 0x01400000 (around 20 MB) up to the end of file, it's totally blank, only '0's
Did you expérience whatever may cause a save to be incomplete (game grash during save, computer reboot, or anything ) ?
BTW : disabling autosaves may not be the smartest idea to do if you want safety.

I'll let the topic here, because even if I don't see how it could be a problem due to the game, I've seen such posts a pair of times, and I start to doubt.
Koub - Please consider English is not my native language.

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Corrupted save file of 110+ hour game save

Post by Zavian »

You might be able to restore a working version of an older save using your backups or windows previous versions,
https://www.howtogeek.com/56891/use-win ... our-files/

Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: Corrupted save file of 110+ hour game save

Post by Oxyd »

Koub wrote:Your save file is incomplete : from byte 0x01400000 (around 20 MB) up to the end of file, it's totally blank, only '0's
Did you expérience whatever may cause a save to be incomplete (game grash during save, computer reboot, or anything ) ?
BTW : disabling autosaves may not be the smartest idea to do if you want safety.

I'll let the topic here, because even if I don't see how it could be a problem due to the game, I've seen such posts a pair of times, and I start to doubt.
I've seen this multiple times as well, but usually with config files. It's always the same symptoms – file is approximately the correct size, but at least partially filled with zeroes, seems to happen on Windows only and nobody ever can name anything suspicious happening when the file was being saved.

I'm leaning toward this being a Factorio bug, but unfortunately people have been reporting this for years and we still have no clue what might be causing it.

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Corrupted save file of 110+ hour game save

Post by Zavian »

Not sure whether you are already doing this but StackExchange and https://disruptivesql.wordpress.com/201 ... e-through/ both suggest that calling FlushFileBuffers() ( https://msdn.microsoft.com/en-us/librar ... s.85).aspx ) will ensure the data is flushed to disk. (Assuming the disk itself doesn't lie to windows).

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Corrupted save file of 110+ hour game save

Post by posila »

Zavian wrote:Not sure whether you are already doing this but StackExchange and https://disruptivesql.wordpress.com/201 ... e-through/ both suggest that calling FlushFileBuffers() ( https://msdn.microsoft.com/en-us/librar ... s.85).aspx ) will ensure the data is flushed to disk. (Assuming the disk itself doesn't lie to windows).
We are using standard C functions for writing files. Thanks for the tip, Rseding had theory it is something wrong with OS not flushing files properly. We'll give it a try and see if this stops happening to people.

Leosmellsgood
Inserter
Inserter
Posts: 30
Joined: Fri Jan 16, 2015 10:35 am
Contact:

Re: Corrupted save file of 110+ hour game save

Post by Leosmellsgood »

Koub wrote:Your save file is incomplete : from byte 0x01400000 (around 20 MB) up to the end of file, it's totally blank, only '0's
Did you expérience whatever may cause a save to be incomplete (game grash during save, computer reboot, or anything ) ?
BTW : disabling autosaves may not be the smartest idea to do if you want safety.

I'll let the topic here, because even if I don't see how it could be a problem due to the game, I've seen such posts a pair of times, and I start to doubt.

Nothing was unusual about the saving and exiting process that I can remember, and saving takes about 30-60 seconds so I'd really rather leave autosave off.

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Corrupted save file of 110+ hour game save

Post by posila »

I tried FlushFileBuffers ( resp. _commit https://msdn.microsoft.com/en-us/library/17618685.aspx ), but it blocked the game on saving 40MB save to HDD (WD Black) for up to a second ... then I read https://blogs.msdn.microsoft.com/oldnew ... 0/?p=95505 so I think we should never need to call _commit, and corrupting save + all autosaves in this way can't possibly be due to HDD not having enought time to flush its internal cache.

So this is still open mystery.

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Corrupted save file of 110+ hour game save

Post by Zavian »

I was hoping that because it blocks until the write is complete, FlushFileBuffers() would give you an error even if anti-virus blocked the disk write, or the device driver or disk reset before the write completed. If _commit isn't blocking then it probably is just ordering the disks/device drivers to flush the necessary caches and isn't waiting until the file is on the disk, and hence might not be able to report those errors.

@Leosmellsgood, personally I would leave autosave on, but just set it to every 20 or 30 mins. (Be aware that is in game time, so if you are only getting 30 ups, 30 mins is actually every hr of playtime). In addition I make a manual save at the end of a session, with each savename ending in a number that I increment each time.

Post Reply

Return to “1 / 0 magic”