Hi,
I have a save system in my project where I save the players data in a file and another one which is a backup of the first one. Is it possible to set the file attribute as read only for both files and hidden for the backup one ? If so how ?
Hi,
I have a save system in my project where I save the players data in a file and another one which is a backup of the first one. Is it possible to set the file attribute as read only for both files and hidden for the backup one ? If so how ?
If so how ?
Through File.SetAttributes from System.IO. You could find that info through search engine.
However, you shouldn’t do that. The user will still be able to find and delete the files, so you’re creating a minor inconvenience which… does not really achieve much.
I’ve saw online people telling to just encrypt and let the user manipulate the files (deleting, moving ect) but nothing about how to do it. Thanks for the information, and I think I’ll let the files like that
If this is a single player or a non-competitive multiplayer game, you shouldn’t spend too much time defending your save files, doesn’t matter, the player(s) can’t cheat meaningfully.
If you’re doing competitive game, you should not store the save file locally, you should save to the cloud. The only way the players can’t access it.
If you’re concerned about the user ‘hacking your save files,’ or ‘cheating in your game,’ which is playing on their computer, just don’t be.
There’s nothing you can do about it. Nothing is secure, it is not your computer, it is the user’s computer.
If it must be secure, store it on your own server and have the user connect to download it.
Anything else is a waste of your time and the only person you’re going to inconvenience is yourself when you’re debugging the game and you have savegame errors. Work on your game instead.
Remember, it only takes one 12-year-old in Finland to write a script to read/write your game files and everybody else can now use that script. Read about Cheat Engine to see more ways you cannot possibly control this.