How should I begin my venture into the Game Save world?
#1 Members - Reputation: 102
Posted 15 November 2012 - 03:55 PM
Any way to do this?
Thanks!
#2 Members - Reputation: 2761
Posted 15 November 2012 - 04:19 PM
The only way you could possibly stop someone from modifying theor own data on their own computer is to save the game to a remote server, and even then you'd need a secure connection. Are you sure it's worth the hassle, given they could still crack your program to bypass that?I want to make sure the player can't edit the save file.
Just write your data using the standard formatting streams. You can check and edit the save game files manually that way, if only for verification, and you can let people do what they want with their own data.
Professional Free Software Developer
#3 Members - Reputation: 102
Posted 15 November 2012 - 05:34 PM
Just write your data using the standard formatting streams. You can check and edit the save game files manually that way, if only for verification, and you can let people do what they want with their own data.
Yes, how would I do that? That is what I am looking for. I want to add serialization in it though.
Edited by Tuxmascot, 15 November 2012 - 05:34 PM.
#5 Members - Reputation: 207
Posted 16 November 2012 - 01:42 AM
when somehow then wants to "crack" your program, he would need to get the salt out of the binary.
Edited by FlyingDutchman, 16 November 2012 - 01:42 AM.
I open sourced my C++/iOS OpenGL 2D RPG engine :-)
See my blog: (Tutorials and GameDev)
#6 Members - Reputation: 382
Posted 16 November 2012 - 06:47 AM
Write to your save file as binary, so that the user won't be able to read it directly.
Now, if you want to hide it, you can try saving the file in a user's hidden folder:
1) In Windows you have %AppData%\Local ;
2) In Linux you have the user's home and you can create a hidden folder.
3) In a more crossplatform manner, you can use Boost Filesystem library
The references above are all in c++ to give you an idea. I don't know what language you are using, but I am sure other languages will have some libraries ready to deal with the filesystem.
Edited by kuramayoko10, 16 November 2012 - 06:50 AM.
#7 Members - Reputation: 2761
Posted 16 November 2012 - 09:01 AM
I suggest you write a pair of functions std::ostream& operator<<(std::ostream&, const Game&) and std::istream& operator>>(std::istream&, Game&) where Game is you game state you want to save. Make them friends of your Game class. Do this recursively with the members of the Game class. Write unit tests to make sure (a) the output is what you expect and (2) the istream can read what the ostream writes.Yes, how would I do that? That is what I am looking for. I want to add serialization in it though.
Just write your data using the standard formatting streams. You can check and edit the save game files manually that way, if only for verification, and you can let people do what they want with their own data.
Professional Free Software Developer






