Sign in to follow this  
Saint Squireen

Save Game

Recommended Posts

(Straight to the point) I want to save health, level, experience, coins whenever needed and then close the application and then restart the application and recall health, level, experience, coins whenever needed.

Is there any real good ways of doing this? A google search has turned up nothing useful and I could use some help.

Share this post


Link to post
Share on other sites
The technique you're looking for is called serialization. Serialization is the process of writing out data from your application to a file (or any other external medium) so that it can be loaded back in at a later time.
Depending on the language you're using you could already have the tools to do this quite easily. A lot of managed languages already provide tools for easily writing out the contents of your classes or structures to binary files, text files, xml files, etc.

Share this post


Link to post
Share on other sites
Another thing I forgot to add:

If you just have to write out a small amount of values then a full serialization system might be overkill, you can always just use the file IO systems provided by C++ to write your values out to a binary or text file. An actual serialization system should come into play the moment where you find yourself needing to export/import entire class states.

Share this post


Link to post
Share on other sites
See:
http://en.wikipedia.org/wiki/Serialization#C_and_C.2B.2B
http://stackoverflow.com/questions/234724/how-to-serialize-in-c
http://www.parashift.com/c++-faq-lite/serialization.html
http://www.ocoudert.com/blog/2011/07/09/a-practical-guide-to-c-serialization/
http://gamedev.stackexchange.com/questions/2269/what-are-good-solutions-for-serialization-in-c

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this