[2.0.69] Steam build fails to load local player-data.json

SIGSEGV
Burner Inserter
Burner Inserter
Posts: 9
Joined: Thu Apr 27, 2017 1:21 am
Contact:

[2.0.69] Steam build fails to load local player-data.json

Post by SIGSEGV »

When I start the Steam build of the game, it fails to load the local copy of player-data.json and loads a version from the Steam cloud, even though I have Steam cloud sync disabled. The cloud version is later written to the local filesystem, overwriting the local copy.

I typically use the standalone (full) build, but occasionally use the Steam build. When I do, this means that changes to my player-data.json from playing the standalone build are overwritten with the state from the last time I ran the Steam build.

What I would expect to happen is either:
1. The Steam build loads a newer local player-data.json in preference to a cloud one with an older timestamp (this would be my preference; the logs suggest the timestamps should be available).
2. The Steam build always uses the player-data.json from the cloud, and does not overwrite the local file, maintaining a separate player-data.json from the standalone build (kind of like how achievements seem to work).

Steps to reproduce:
0. Have Steam cloud sync disabled for Factorio. (Haven't tested whether this makes a difference.) Steam and standalone builds are both configured to use the same ~/.factorio directory.
1. Start the Steam build. Load a world and mark a "Tips and tricks" entry as unread. Click "Quit" in the pause menu and then the main menu to quit the game.
2. Note the contents of player-data.json.
3. Start the standalone build. Load a world. The "Tips and tricks" entry should be unread. Read it, marking it as read. Say "test" in chat. Click "Quit" in the pause menu and then the main menu to quit the game.
4. Note the contents of player-data.json; in particular "console-history" should end with the "test" message.
5. Start the Steam build. Load a world and note that the "Tips and tricks" entry is unread, even though it was read in step 3. Leave it unread. Click "Quit" in the pause menu and then the main menu to quit the game.
6. Note the contents of player-data.json; in particular "console-history" no longer ends with the "test" message.
7. Start the standalone build. Load a world and note that the "Tips and tricks" entry is still unread, even though it was read in step 3 (this is further evidence that the Steam build is overwriting the local file, even though it does not successfully read it).

Lines like the following appear in the log every time the Steam build starts:

Code: Select all

   1.360 Info PlayerData.cpp:66: Local player-data.json unavailable
   1.360 Info PlayerData.cpp:69: Cloud player-data.json available, timestamp 1759529131
While searching for other bug reports with this issue, I saw a number of logs with similar lines.

The following post in the "Technical help" forum seems to indicate the same issue back in 2022, with no replies: viewtopic.php?t=104448
Attachments
factorio-current.log
(9.62 KiB) Downloaded 49 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 16586
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.69] Steam build fails to load local player-data.json

Post by Rseding91 »

Thanks for the report. Looking into the logic, it used to work with the time stamps to determine which file to use. It was changed in 2017 in an attempt to avoid overwriting steam-synced settings however the save logic was never updated to avoid clobbering the local file.

I've changed it for 2.1 so the steam version will always use the steam cloud file and non-steam will always use the local file and the two won't clobber each other. If there's enough demand for it - we could add some (probably hidden) setting to force disable cloud sync for the player-data.json file however I'm not sold on the idea. If that's desired; players can simply use the non-steam version of the game which won't sync anything.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Fixed for 2.1”