encryption

Let's say I use txt files to store information for levels and I don't want people to easily edit it. Is there any way to obfuscate this information?

(log in to comment)

Comments

You could put in a very minimal level of "encryption" by using the gzip module. But then all anyone has to do is read your source to figure out how to decrypt the files :)

Personally, I'd advise against it. If someone wants to cheat, they will figure how to. The result is that you're just putting artificial barriers up for people who want to learn how your game works, which would be a shame.

Use pickle on level 2 or 3. At least then they have to know python to cheat.

Hi!

I agree with Richard. It is just as meaningless as copyprotection.

My suggestion is to have the .txt files use a different extension (.lvl comes to mind) and have them in a subdirectory (should be anyway because of the cleaner look).

Normal players won't even see those files, and as was said before, anyone who really wants to get at them will get at them.

Even if you wrote your own encoding routine (boy, you then sure have a lot of free time in that week) and only included the necessary decoding routines in your release, people who really want to get at it, would probably be able to get at your data.

Thus, I really advice you not to waste your time on this. One week is short enough (^_^;;

Deathworks
The best thing should maybe be if the computers got Internet is to dl the maps (or keys if the maps are big) each time and use some kind of RSA? but its a bad idé because of the lack of Internet connections in the event. :P

Hi!

Well, such a game wouldn't get any votes from me since I am not online privately, so I couldn't test any either-you-are-online-or-you-die games.

Deathworks
Why would you care if the player cheats, anyway? It's not as if you're handing out prizes. If he enjoys the game less as a result, that's his loss, not yours. And it might enable him to enjoy it more, by getting over something he's stuck on.
In my opinion the only reason to prevent cheating is when it has an "other people" factor, whether it's multiplayer, hotseat, or simply a highscore table, because it's unfair with other people. I don't see a point in designing cheating prevention on a singleplayer game, since they'd be playing alone anyway. Even if you protect the levels, they could always modify your source code or change values in memory. You'd be better off using that time to polish or fix bugs or add features (thus making us happier :)).