• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows Players experiencing data loss

Spasman

Member
Hi there. I developed a game called Boring Man a while ago and I've had this bug or problem or something floating around the whole time. A handful of players lose their save data seemingly at random, but it has NEVER happened to me or any of the devices I've tested with, or even to people I know personally who have tried the game, so its been impossible to fix since I can't replicate it. I've gotten endless feedback data on it and I can't really seem to pinpoint a cause. (It's especially difficult because a lot of my players are young children and are difficult to communicate with)

I don't even know if its a problem in my code or a problem with GM itself. I'd like to run it through any YYG devs to see if maybe they have insight but if not, feel free to move me to the Programming sub forum if needed.

I use the installer to push the game builds. I'll compile the installer, then install the game onto my desktop, then upload the install directory to my website and Steamworks, then uninstall the game from my desktop. I do this twice, once with and without the Steam API enabled. Doing this allows me to keep my map and tile files in the Steam/Game EXE folder, instead of including them in the game and needing to extract them to the appdata folder.

When the player first starts the game, it creates the save file locally in the AppData folder. Anytime the player levels up. earns an achievement, or leaves the room (IE the menu or the room where the map file loads itself) The game will save their data automatically. If they quit the game (IE trigger the Game End event) the game will also save there as well.

The save data is encrypted via base 64 to stop save editing at face value. I use to have my own encryption script, but I simplified it to using the base64 functions to see that would stop player saves from corrupting. Still nothing. I could remove encrypting entirely but a 10 year old with notepad open would be able to edit their saves very easily.

In very rare cases, the save being "corrupted" isn't the games fault, because the player will mistake that there is a cloud saving ability (There isn't) and hop on a different computer, thinking their save was deleted when in reality it was just never transferred automatically. I also suspect some of them sometimes play for 4 or 5 hours in the first time running the game and quit the game improperly, not allowing the game to save properly (maybe by using Alt + F4). Having to clarify they haven't done those things adds to the confusion...

But most of them, I have questioned them to see if they have done either of these things and they just seemingly lose it while still on the same device and quitting the game properly.

I also suspect there are MULTIPLE ways they are losing their saves. One way I discovered was a bug within GMS (which was fixed recently). If the AppData folder had unicode characters in the file path, the game wouldn't locate the folder properly. This only resolved a certain way of players losing their save (because it wasn't saving at all in the first place)

I'm just at a loss. I've never seen this problem before in the 7 years I've used this program. I'm afraid to move forward with any other projects that involve saving because I might be making the same mistake again.

Yes I could implement cloud saving or a login system.. but for what purpose? Just to get around a bug or problem I can't resolve that shouldn't even be there?

I have provided as much info as I could for a pretty vague problem. I dunno, maybe I need advice more on troubleshooting it then a way to fix it.
 

TsukaYuriko

šŸŒ 
Forum Staff
Moderator
There's nothing that would allow me to pinpoint the cause of the data loss here, so I'm afraid I can't directly help you with that. I'll throw the usual suspects of dying hard drives and subsequent data loss as well as accidental multiple layers of encryption into the room, though.

That aside, may I suggest implementing save file backup functionality (with a configurable amount of incremental backup saves)? This may not resolve the core issue, but would (hopefully) at least provide players with something of their save file intact meanwhile in case anything goes wrong. It also goes without saying that there should be mechanisms in place that allow the save file to recover from "improper" ways of saving, e.g. writing the newest version of the save file to a separate file (not overwriting the save file that already exists) and renaming the new file to override the old one only after the saving process is 100% done in order to, say, guard the save file from sudden power outages or process termination during saving.
 

Spasman

Member
Right, I do have back up procedures in the game, the game will create/update two back up save files everytime the player levels up (or finds a "gold weapon" which is somewhat more progress for the save file). The back up files DO help some players, but sometimes other players have their entire appdata folder wiped. I want to say these players are hiding critical details from me (like, user error and want their save data back without looking dumb) so st first, I was chalking it up as user error and HDD problems as well (since kids with poor/old computers flock to games like mine), but It just happens much more often then I've ever seen in any other game it makes me think its something I could fix..

The multiple layers of encryption thing does bring up a good suspect, thats why I simplified the encryption. However most of the time player reports they get the "create new save file" pop up at the start of the game, which means their save file was either totally deleted or misplaced because it checks with file_exists(). If encryption layering were the case at this point, I feel like it would've happened to me too.

I guess this thread is pretty pointless then if the issue is too broad, I'm just feeling desperate and looking for a miracle. I get a complaint about someone losing their save data 2 to 3 times a week, and my player base is incredibly small at that. If anyone has any insight i'm all ears.
 
Top