encrypt save file data?

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

encrypt save file data?

Postby Suicune » Tue Apr 20, 2010 9:51 pm

i dont think this is possible, but it cant hurt to ask. the reason for me wanting this, is because ive recently learned that its possible to open a .sav in notepad and edit the variables values, which allows for "cheating" the game.

thankfully, most people wont think of doing that, or wont bother because it would defeat the purpose of playing, but still, if its possible to encrypt the .sav file, then how would it be done?
Suicune
Member
 
Posts: 29
Joined: Fri Dec 25, 2009 2:59 pm

Postby Lyberodoggy » Tue Apr 20, 2010 10:15 pm

You can't encrypt that file and still get it to work with am. What you can do though is use a custom save/load system as described in the Post Your Own Tutorials section of this forum and then use an encryption algorithm on the outputted ini file, again as described in that section of the forum. let me fetch the two tutorial links for you. I ll edit this post in two minutes.


EDIT: http://www.adventuremaker.com/phpBB2/vi ... php?t=3741
http://www.adventuremaker.com/phpBB2/vi ... 4524#14524
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Suicune » Wed Apr 21, 2010 3:57 am

thanks for the links, i had a look at them, and it looks good.

however, im probably best not worrying about it at this point, because i already have all my frames created (just doing all the coding now), and to add a bunch of hotspots to take the player to a custom save screen would mean i have to edit all 700 or so of my frames! ...because i intented the player to be able to save anywhere they want in my game. obviously, it would not make sense to have invisible "save" hotspots, so i would have to put a save "button" on every frame, and when designing my frames, i didnt plan for that, so theres no space in my frames to add something like that now...

mabye if i learned about it while still in my frame creation phase, i might have been able to integrate it, but its too late now, seeing as the game is nearing completion, but thanks anyways! i guess ill just hope that no one finds out about it who is playing, or anyone who does keeps it to themselves and doesnt spoil it for others...
Suicune
Member
 
Posts: 29
Joined: Fri Dec 25, 2009 2:59 pm

Postby Lyberodoggy » Wed Apr 21, 2010 1:10 pm

You can actually do that using the runtime frames merging. Create one frame with the save/load buttons or a menu button and then merge that with every frame of your game
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Suicune » Thu Apr 22, 2010 7:10 am

hey i got a new idea, tell me if its possible?

my idea is, to create a lot of FAKE variables that LOOK important (example: "finaldooropen", etc), but are not used in the actual gameplay, and set them all to 0. then, using a script or whatever, cause the game to close/crash/exit if any of those fake variables are NOT 0 when loaded!

this would prevent people from cheating my game so easily, because they would no longer be able to open the .sav and make everything "1" anymore, since if they edited 1 of my fake variables to "1", it would cause the save to not work properly, and instead cause the game to shut down when loaded.

i think this is a funny way to ruin cheating attempts, while keeping legit save files perfectly unharmed lol, but i dont know if its possible to tell the game to close with a script... it might be.

any thoughts on this?
Suicune
Member
 
Posts: 29
Joined: Fri Dec 25, 2009 2:59 pm

Postby Mystery » Thu Apr 22, 2010 11:48 am

You could add to the
Project Properties -> Advanced -> Execute some VBScript code when the project starts or a savegame is loaded:

Code: Select all
If fakevar1+fakevar2+fakevar3 > 0 Then quit
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Suicune » Thu Apr 22, 2010 11:59 am

thanks! i didnt think itd be that easy, but this should prove useful.
Suicune
Member
 
Posts: 29
Joined: Fri Dec 25, 2009 2:59 pm

Postby Lyberodoggy » Thu Apr 22, 2010 1:45 pm

even with that trick (which is very good btw) an experienced cheater may find a way through. You could do something with windows' registry to avoid that, but it would work only for one saved game so yeah, actually your way is the best.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Suicune » Thu Apr 22, 2010 2:09 pm

Lyberodoggy wrote:even with that trick (which is very good btw) an experienced cheater may find a way through. You could do something with windows' registry to avoid that, but it would work only for one saved game so yeah, actually your way is the best.


i know its not an ABSOLUTE safeguard, but then again, it would be very hard to create such anyways, since a very determined person always finds a way.

im gonna wager players wont be THAT determined to cheat the game. no one that i know of tried to cheat my 1st game (although even i didnt know it was possible at the time). so theres a good chance no one even bothers to try to cheat my new one at all. this was mainly just a precaution i wanted to take, just in case someone did try it. fortunately, i think most players wont even think to open the save in a notepad anyways.
Suicune
Member
 
Posts: 29
Joined: Fri Dec 25, 2009 2:59 pm

Postby Mystery » Thu Apr 22, 2010 4:27 pm

My personal opinion is that game developers are not (and should not be) security specialists who create their games with crackers in their minds too much.
I'd say that 99% of the players play games to enjoy them, and if they get stuck, they try to find hints in game forums, which is not a problem in my eyes at all.
For the rest of persons who might see games as technical challenge - well, I think that they'd even crack encryption codes, if this is what they are after.

I don't think that I'd even think about such things when I create a game - might be however a useful idea with the fake variables if I ever develop a game that has a prize for the 1st person to finish. So, an interesting discussion all in all :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby ShadowHunter » Fri Apr 23, 2010 7:11 am

Just use variable names that make no sense and dito values when possible...

X565ADJ = 4541A

Easy peasy :D
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Suicune » Sun Apr 25, 2010 6:33 am

ShadowHunter wrote:Just use variable names that make no sense and dito values when possible...

X565ADJ = 4541A

Easy peasy :D


i wanted to avoid this because then i might forget what variables do what, but i guess i will be fine if i save the information in a notepad.

so starting in the 2nd half of my game (which ive just reached), im going to take your suggestion and use nonsense variable names... SOME of the time (cant make it too obvious :P)

its not worth it to rename all 310+ variables ive already put in my 1st half of the game though... WAY too much work! probably gonna have 700 or so variables by the end of my game, then adding 100-300 fake ones should hopefully destroy any chance to cheat, since there would be too many possibilities to choose from.

thanks once more for all the help guys. game should hopefully be done in 2-3 weeks!
Suicune
Member
 
Posts: 29
Joined: Fri Dec 25, 2009 2:59 pm

Postby ShadowHunter » Sun Apr 25, 2010 8:13 am

Good luck with your project :D
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Suicune » Wed May 12, 2010 2:39 am

sorry to bump this old topic, but ive tried using this script and it didnt work as intended:

Mystery wrote:You could add to the
Project Properties -> Advanced -> Execute some VBScript code when the project starts or a savegame is loaded:

Code: Select all
If fakevar1+fakevar2+fakevar3 > 0 Then quit


when i put that in my project properties, edit a save file to change the value of the "forbidden" variables, then try loading the file, the saved file still loads like normal, and any edits done to the save file stay on the loaded game... so basically, its not stopping any "cheating" at all.

there are no error messages or nothing, it just seems to ignore the quit command...

HOWEVER, i have tried swapping "quit" with "stopeverything" and that works for me, if a "bad" save file is loaded, the game will freeze upon opening it. but what me and mystery are trying to figure out, is why stopeverything works, but quit doesnt. everything else in the script was kept the same, only that part of the script was changed... so its a bit weird. was the quit command not meant to be used in this manner perhaps?

but yea, since the stopeverything command works for me, this isnt really a NEED anymore, so much as a curiousity thing.
Suicune
Member
 
Posts: 29
Joined: Fri Dec 25, 2009 2:59 pm

Postby mercedes » Wed May 12, 2010 6:09 am

Did u try Action.quit ...I don't think it should matter..but..u could try that..

However i did see this in the help documents..

Quit-- Quits to the main menu (or to the desktop, if the "bypass the Initial Screen" is checked).

Again..not sure if that should matter..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Suicune » Wed May 12, 2010 9:26 am

yes i did try action.quit

and no, i dont have bypass initial screen active on my game. mabye that matters.
Suicune
Member
 
Posts: 29
Joined: Fri Dec 25, 2009 2:59 pm

Postby juhuwoorps » Wed May 12, 2010 9:46 am

Put the code in
project properties/advanced/Execute some VBSScript code every time a frame is loaded

and it will work ;)
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby Suicune » Wed May 12, 2010 11:57 pm

ah! that makes more sense, i have been putting it in "execute everytime a save game is loaded or the application starts"

im sticking to "stopeverything" though, because its doing its job for me, and now i dont have time to change anything anymore before my games scheduled public release date tomorrow, and i still have half the game to test for bugs tonight... then i have to sleep (and hopefully i can manage to get any)

but thanks, glad to know why it wasnt working!
Suicune
Member
 
Posts: 29
Joined: Fri Dec 25, 2009 2:59 pm

Postby Lyberodoggy » Thu May 13, 2010 12:26 pm

You should also display a message stating the reason for the "freeze". Else it's going to be considered a bug by most cheaters.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests