Jump to content
  • Advertisement
Sign in to follow this  
Saint Squireen

Save Game

This topic is 2305 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!