Page 1 of 1

[17.52] Vanilla Save Corrupted by Loading Mods into Factorio Client (without opening the vanilla save)

Posted: Sun Jun 30, 2019 3:13 am
by TheeNinja
I installed the following mods today in order to create a new world:
Mods1.png
Mods1.png (57.82 KiB) Viewed 1842 times
Mods2.png
Mods2.png (53.98 KiB) Viewed 1842 times
I went into "Load game" to load my newly created modded world when it said the vanilla save had been corrupted. I hadn't opened the vanilla save in the modded client.

Attached is the vanilla save and a winrar report on the contents (even though for some reason it can't extract the files for further examination, simply says the archive is corrupt).

Both the current and previous factorio log are for launches after the save was corrupted, my mistake that I didn't file a report as soon as I got the error of corruption.

But in case it helps, I've attached the log corresponding to a launch with mods.

Re: [17.52] Vanilla Save Corrupted by Loading Mods into Factorio Client (without opening the vanilla save)

Posted: Sun Jun 30, 2019 8:46 am
by Loewchen
Can your reproduce this issue?

Re: [17.52] Vanilla Save Corrupted by Loading Mods into Factorio Client (without opening the vanilla save)

Posted: Sun Jun 30, 2019 10:40 am
by Rseding91
Thanks for the report however what you describe simply isn't possible to happen. Disabled mods don't effect save files in any way and in fact the runtime logic doesn't even know the disabled mods exist.

The save file must have been corrupted through some other external means.

However, if you are able to reproduce it with a fresh save file let us know.

Re: [17.52] Vanilla Save Corrupted by Loading Mods into Factorio Client (without opening the vanilla save)

Posted: Mon Jul 01, 2019 12:11 am
by TheeNinja
My bad for not clearing up the circumstances: The mods were enabled when the save got corrupted (when I went into "Load game" menu), but I disabled them after the corruption was reported to see if the vanilla save was still considered corrupted (and it was). The screenshot was taken after disabling them.

But yes, I will attempt to reproduce the issue ASAP and report back if I can.

Re: [17.52] Vanilla Save Corrupted by Loading Mods into Factorio Client (without opening the vanilla save)

Posted: Mon Jul 01, 2019 11:28 am
by Rseding91
TheeNinja wrote:
Mon Jul 01, 2019 12:11 am
My bad for not clearing up the circumstances: The mods were enabled when the save got corrupted (when I went into "Load game" menu), but I disabled them after the corruption was reported to see if the vanilla save was still considered corrupted (and it was). The screenshot was taken after disabling them.

But yes, I will attempt to reproduce the issue ASAP and report back if I can.
That doesn't sound like a save getting corrupted. Loading a save file doesn't actually alter the save file on disk in any way. Only when you click "save" does it alter the file on disk.

If you: enabled some mods, started the game, went into the load-game screen, clicked load, and it reported it was corrupt - then it was already corrupt before you enabled the mods.

Re: [17.52] Vanilla Save Corrupted by Loading Mods into Factorio Client (without opening the vanilla save)

Posted: Mon Jul 01, 2019 11:24 pm
by TheeNinja
I was unable to reproduce the issue, and with what you said, it would make sense that mods were not the cause of the corruption. That leaves either external corruption outside of Factorio or corruption during that saving process of the world pre-activation of the mods. I've noticed that level.dat is size 0 and preview.jpg is a different size compared to that of the autosaved (not through Factorio autosaving, saved in Steam cloud cause for an hour or so I had to play in Steam offline mode) version of this world.

For comparison
Non-corrupted autosaved version:
WinrarReport2.png
WinrarReport2.png (11.45 KiB) Viewed 1764 times
Corrupted version:
WinrarReport.png
WinrarReport.png (9.15 KiB) Viewed 1764 times
So by some process (either in Factorio or externally) `info.json` was removed, `level.dat` was cleared and `preview.jpg` reduced in size. The reason I believe it may be a rare bug within the Factorio save process is because it seems that only files that are supposed to change in the save process were modified (`level-init.dat`, which I'm assuming is the initial level and `control.lua` were left constant). I can't think of a reason for why `info.json` was removed.

I'm working in the dark here, it may well be an external process that modified the save accidentally, but is it possible that the runtime logic in the save process accidentally cleared `level.dat` and subsequently modified the data which was dependent on `level.dat` (like the preview)?

Attached is the non-corrupted autosave.

Re: [17.52] Vanilla Save Corrupted by Loading Mods into Factorio Client (without opening the vanilla save)

Posted: Mon Jul 01, 2019 11:52 pm
by TheeNinja
One thing that confuses me is that the size of `Mega Factory.zip` (the corrupted one) is 8.29 MB while `Past Mega Factory.zip` (the uncorrupted one) is less. If `level.dat` was supposedly cleared, and locale is the same size, where did the 7 MB that were previously in `level.dat` go?