Hiding savedata to prevent save backup

Started by
24 comments, last by jbadams 6 years, 8 months ago

I dont see how it would annoy any player just playing the game.

It won't annoy the user in-game: it will annoy the user when they have to go circumvent your pointless "protection" mechanism.

You wouldn't be implementing this mechanism if you didn't think that users would want to do this...

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Advertisement

I would use steganography to do this.

Embed the save data in a special RIFF tag within a wav file or such within the game data, or within a special JFIF tag within the jpeg of a texture or sprite. Asset metadata makes for a great hiding place...

I just dont want to leave the data to obvious to meddle with (not to INVITE the player to take the easy way out first thing). I dont see how it would annoy any player just playing the game. You can still save ingame, you just have to go an extra mile (or meter) to meddle with the game data.

It could annoy people for two reasons:

1) It prevents people from backing up their saves, which prevents a person from migrating their saves to a new platform. As someone who has done this multiple times across multiple systems, preventing that is very odd to me.

2) It prevents people from circumventing the permadeath mechanic. While that could be the intent of the game, it could also be a source of frustration. And there's no real harm in letting people get around it, is there? It only affects their own game experience.

I always find it weird that people think putting "Don't reply telling me to do this thing" will deter responders, even though that thing is exactly what our professional opinion says the real answer is.

Kinda like saying, "I want to make an MMO with 800 servers and 4 million players, don't reply to my thread telling me it's impossible."

That doesn't make it any less impossible.

More ontopic though: If you really want to babysit players and want their cheating or lack of cheating to be meaningful then the only real way to accomplish it is for you to control it, i.e. servers. Nothing on a player's computer is sacred, and if you think trying to be clever about hiding the thing will make them less interested in cheating then you'd be wrong.

The only kind of "hiding" of files or subversion of their contents would be to stop people with simple text editors popping the file open and changing things, mainly because this is something a kid is more likely to do. Have to teach them kids to resist the urge to cheat after all.

But anyone that really wants to cheat is going to do it anyway, look at how many people go onto AAA single player games and use cheats. Quite a lot, but I would argue a small percentage of the whole. If anything I would argue that kids in particular are more likely to WANT to cheat on things like multiplayer games because it gives them a sense of superiority that they won't actually get on a single player game even if the cheats are also available.
What i would recommend is, don't bother with hiding the save game data. If someone want's to cheat, that's their prerogative.

What you might want to do, instead, is make your game able to detect a backed up save was loaded, and do something with that information ingame that doesn't affect gameplay itself (like, you don't want to take away the players items or exp or ...).

Upon detecting the loaded save game is a backup, inform the player of what he's done, tell him his score will be set to 0 (if you have a score), or that this character won't go info a hall of fame (if you have a hall of fame), or something (if you have a something), and ask him if he's sure he want's to continue. If you don't have any feature like scores/hall of fame/something, then you might want to think about adding a feature that is influenced by a valid save game, which you can "take away" for backup save games, and which is not in any way gameplay related.

Of course, you'd have to make sure your backup detection really works in every scenario imaginable, because you don't want to punish legitimate things like switching hard drives, OS reinstalls, transfering the saves to another computer entirely, etc.

devstropo.blogspot.com - Random stuff about my gamedev hobby

I totally get where the OP is coming from. I've played FTL on PC and cheated occasionally to backup saves. Now I'm playing on iOS where it's harder to cheat - it's still totally possible, but there's enough friction in the way of cheating that I don't bother. The game is a very different experience because the stakes are much higher when permadeath can't be circumvented.

IMO, your option #3 is the best. By having a save file and a corresponding registry entry (with a timestamp or hash or something), it's still easy for someone to cheat/transfer the progress, but I think the extra step of having to modify the registry adds just enough friction to the cheating process that I think that large numbers of people wouldn't bother.


to prevent backing up the game state.

There will be time where your game will have a bug/problem you can't reproduce locally and you would just say:

please send me the save game...oh..wait..

The obvious things (such as anything on the client can be broken, and don't do this, don't annoy people...) have been said, but if you still insist, what I would do is something like this:

  1. Calculate a 64-bit CRC (or cryptographic hash if you will) from the latest valid savefile, and set the file modification time of the folder where savefiles are stored to that value (or, some other folder, the data file folder if you have one). This will not prevent someone from re-imaging his drive but it will prevent the most naive attempts at copying over old savefiles. Sophisticated backup software, unlike Explorer copy, also retains modification dates, but then again, who remembers to also copy the containing folder, or an unrelated folder like the data folder! It's clever enough to fool the most naive users until someone discovers how it works and makes a post on the internet (which is probably a week or two for a not-so-wellknown game).
  2. If you want to be more clever than that, you can use alternate datastreams or extended attributes (somewhat at the expense of portability), but that will not hold someone who has a minimum of technical knowledge back either (it will thwart average users, though). ADS is stunningly trivial to use if you know how (just append the "magic formula" to the filename), and a surprisingly good way to hide stuff from an unaware end-user type of person. It's also a good way of totally fucking up if anything different from NTFS gets involved, unluckily (though this may indeed be an advantage for you, prevents copying files to FAT filesystems...).
  3. Also save every level you've visited (randomly generated, I figure, as "roguelike" implies?). This not only allows the player to go back to a level with all loot where he dropped it (which is a nice feature), it also gives you a somewhat bigger data set, which means backing it up is more expensive. Though of course, in an age of terabyte harddisks, who cares if you have 10 or 15 megabytes of save data. Saving every level also gives you the possibility of creating a hash chain, so level 3 will validate level 2, and level 2 will validate level 1. The last one could validate the last valid save file (either instead of, or in combination with a file modification time or any such hack).
  4. Use encryption. Yes, you said you don't need it, but you do. It is much easier to do nasty secret stuff and to keep your little secrets if the other person cannot trivially read everything. A binary file which is still somewhat parseable if you know how is nice for holding back the casual end-user, but a binary file which is only "total random garbage" (encrypted) is better. It needs not even be a particularly good encryption, since breaking the encryption is trivial for anyone dedicated to do so anyway (seeing how both key and algorithm are stored on the machine). But even poor encryption will reliably ruin the average user's experience unless your game is famous enough that people start putting up automated crack tools onto the internet. If that happens, congratulations, means you've succeeded.


I dont see how it would annoy any player just playing the game.
Please make sure that player is still able to play the game! Imagine such scenario: Parent (admin) installs the game in "Program Files ", kid (user) plays it. If you try to hide your save anywhere outside of user space, like system folders, most key in registry or especially installation folder, the player will not be able to save at all.

As stated briefly you must also strongly take into consideration playing the same saves on multiple computers. For example, I would play Kerbal Space Program at school in between courses and copy saves to my desktop. If you make saves too hard to find (or use some complicated scheme) I as a player would be greatly annoyed certain saves work only the computer that created it. A save is a save regardless of where it originated from.

Beating a user who doesn't bother backing up saves (and one not prone to cheating) is relatively straight forward. Just adding a flag into the header to mark the character as dead is a solution. To add salt to the wound take all his gold and items as well, he won't need them in the afterlife anyway smile.png

Granted if he plays on more than one computer, or backs up his saves, it will break this but this may not be such a bad thing. For instance, lets say a child plays his father save and dies. If you can't restore the save you will end up with a potentially angry father and one terrified child! If he wasn't backing up saves before this, well, he most likely will be afterwards in case it happens again. If he did then a simple copy and paste will return hours of work over a simple mistake.

If you feel very strongly about disallowing copying then just have a secondary file that's created in the users documents folder (ideally where saves are located as well). This file will keep a unique id associated with each save, and whether the save has been marked as dead. If this file is deleted or has an invalid header/crc you would have to remake it. How else would existing hardcore characters that didn't die be playable? The registry would also present the problem of fresh OS installs and the like..

Thus back to the start of the endless circle.. wacko.png

This topic is closed to new replies.

Advertisement