[1.1.80] Save file corruption on operating system crash
Posted: Fri Jul 14, 2023 9:52 pm
I have noticed this happening for a while across multiple versions and just tried forcing it in the new 1.1.80 release and its still happening. After saving a map and exiting to the main menu, if the OS then crashes, the save file will become corrupted. In my case this occurs because im on a laptop with no battery and it will occasionally get unplugged while it is unused and in sleep mode.
Steps to reproduce:
1) start a new map
2) save the map and then exit to the main menu
3) turn off power to your computer/laptop
4) repower, reboot and reload factorio
5) observe corrupted file.
I have looked at the corrupted files in HxD and after a certain point all bytes are just zero. It is as though the map is not finished saving/writing to disk. Is there some soft-save feature where the game is still being written to disk in the background. I would expect that when the game says that the save is complete, then it is actually complete. To counter this I have been double-saving the game (*_A and *_B) within seconds of each other and it is only ever the second (*_B) save that gets corrupt.
I have attached two instances of this occuring: "Test_1" is a brand new unmodded map following the procedure above, and "Spaceblock B" is a modded map where the same thing has occurred. First save goes to all-zero at byte 0x11A and the second save at 0x500000.
Note, I have tried crashing only factorio using task manager and the corruption did not occur.
Steps to reproduce:
1) start a new map
2) save the map and then exit to the main menu
3) turn off power to your computer/laptop
4) repower, reboot and reload factorio
5) observe corrupted file.
I have looked at the corrupted files in HxD and after a certain point all bytes are just zero. It is as though the map is not finished saving/writing to disk. Is there some soft-save feature where the game is still being written to disk in the background. I would expect that when the game says that the save is complete, then it is actually complete. To counter this I have been double-saving the game (*_A and *_B) within seconds of each other and it is only ever the second (*_B) save that gets corrupt.
I have attached two instances of this occuring: "Test_1" is a brand new unmodded map following the procedure above, and "Spaceblock B" is a modded map where the same thing has occurred. First save goes to all-zero at byte 0x11A and the second save at 0x500000.
Note, I have tried crashing only factorio using task manager and the corruption did not occur.