Hello, I had a mix of rF2 crash and PC crash last week, and I was left with empty Multiplayer.JSON and CustomPluginVariables.JSON files. By empty I mean the same size as before, but filled with 0x00. This was causing a JSON error at first, then when I removed the dodgy multiplayer file rF2 changed to a failed startup (no message) until I found and removed the plugin variables file.
Thank you very much, very handy to know not to trust the reported size of a file but to check the actual content of files.
@The Iron Wolf Ok, interesting. I know a couple of times I've had the player file renamed (.temp or similar) and not properly replaced, failed startup or something (possibly mucking around with plugins...), but I could be remembering rF1 on that as well. Hopefully they can track down scenarios where the file ends up useless like this and avoid it, or at least gracefully recover if files like these end up existing but empty.
For me it is a known bug, sometimes it happens when rf2 does not close itself well. I have a backup of user folder avaible
I sometimes wonder if it isn't rF2 issue, but instead how NTFS caching works. I have write caching policy values that are not recommended by MS and can lead to data loss (but I don't care on gaming PC). In fact, I hit that 0x0 zeroed file when one of the source files I worked on got emptied out when power company came to switch meter and turned off power
@The Iron Wolf NTFS may be implicated, but for me not the write caching option you've selected as I haven't changed any of those settings on my system. Perhaps it's not an rF2 bug that causes the zeroed files, but it's nearly a bug to not write in a manner to help overcome this sort of thing. If it leads to the end user unable to start the game, verifying files through steam doesn't fix it, leaving the user with the options of reinstalling rF2, removing their player folder and starting again with settings, series stats (though not car setups if steam is saving those), or having enough knowledge to find and remove any zeroed files (which look fine from the outside, as they still have normal size) and still losing any custom settings they had in there, and, IF this could be avoided by the game renaming the existing file before rewriting it, allowing for later detection of a dead file and its automatic recovery (like the game does, or used to do, during startup with the player file), then I think that's something worth pursuing. Or at the very least, recognise a zeroed JSON file and treat it like it's not there so the game starts with the default values instead of exiting with or without an error. Still not ideal as the player could lose all sorts of settings and maybe not realise it, but at least their game will work.
... and here we are in 2023. The cliched "2 minute fix" aside, this .json corruption continues to happen. Can I propose a game code workaround? Check for empty (0kb, or NULLed contents) .json files on startup, and rebuild any dead ones. Make a backup of the 4 .json files after each successful startup, as a recovery point for step 1. Please?