Welcome
Welcome to the forums of AntiRTFM's Absolute N00b Spoonfeed C++ Tutorials!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

save game

Got an idea for a practice project / debug snippet / short-code contest / etc? Tell us about it here!

save game

Postby -S-S- on Tue Aug 19, 2008 7:13 pm

as title says, find a way to save your game state.
whether it be a text based rpg, or some 3D, blast em and rape them FPS.


how would you go about saving the current state of the program, so it can be accessed at another time...


-s-s-
-S-S-
 
Posts: 13
Joined: Sat Aug 16, 2008 2:57 pm

Postby Doctor Salt on Tue Aug 19, 2008 9:06 pm

Ok, heres how i would do it........(I'm not gonna write out actual code, because i don't have nearly enough time for that)


On the assumption that this "game" is some sort of RPG, or anything of that type, you'll be given an option to receive a bunch of supposedly random gibberish, which you'll write down and remember. Whenever you start the program up, your enter that "gibberish" back into it, which will basically bring you back to where you were playing before, with the same stats and weapons, etc...

Now to the method of my madness! The string of code it spits out, will be the variables in the game, just "encrypted" so you couldn't cheat through the game, and give your self ultra god like stats. So you would assign each every number a different number, so 1 strength=10128, or something, so they couldn't guess it. Just make codes for all your variables, including one for location in your game (how far you got) and if anything doesn't match with an accepted number, say they are trying to cheat, and force em back to the main menu :P
I'm a 15 year old kid who has his heart set on Programming, almost as much as Marss++.......

Came here hoping to ask more questions so if you have any free time just say!
Doctor Salt
 
Posts: 147
Joined: Wed Jul 30, 2008 3:32 pm

Postby antiRTFM on Tue Aug 19, 2008 11:07 pm

Good guessing salt!

By the way there are many game cheats that work by modifying a certain file, such as the cheating codes in Crysis.

The technical details of opening/closing/loading/saving files will be explained in an upcoming video.
User avatar
antiRTFM
Administrator
 
Posts: 462
Joined: Sun Apr 13, 2008 9:10 am

Postby Doctor Salt on Tue Aug 19, 2008 11:50 pm

aha! :P Also, I didn't really understand it, but another person posted something about encrypting the bytes used, which could also maybe be used to make it near impossible to "hack" into by changing files.

(I used to do that for this game called "Rome:total war", to get more money and stuff.... :])
I'm a 15 year old kid who has his heart set on Programming, almost as much as Marss++.......

Came here hoping to ask more questions so if you have any free time just say!
Doctor Salt
 
Posts: 147
Joined: Wed Jul 30, 2008 3:32 pm


Return to -- Code Practice Submissions --

Who is online

Users browsing this forum: No registered users and 0 guests