Jump to content
  • Advertisement
Sign in to follow this  
Dirigible

Programming "Save game"

This topic is 3726 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

I've been mulling this over for a while now, and as I haven't done any programming for over a year now I haven't kept up what I learned in college. I never learned how to do this, but I've been wondering... What is the process for programming a game with a "Save game" function? I've always wondered how that works but never managed to dig it up.

Share this post


Link to post
Share on other sites
Advertisement
basically take all the information you need to recreate the current state of the game and save it to a file.

Share this post


Link to post
Share on other sites
I guess it depends on how you want to do it and what type of saving you're doing, such as save state, save point, or save wherever room/place you are and start from the beginning of that room/place.

I guess the way I would do it would be the last one. I would probably give a room or place a number value, and when the player wants to save, get that value and write it to a text file. Then, when the player wants to load, read the file and take it from there. But that's just how I would probably do it.

Share this post


Link to post
Share on other sites
As Moonshoe said it depends of the game, if you have a real-time action games with quicksave everywhere and you want to save everything including enemies states and even the position of the snowflakes (ok maybe exaggerated) you need to serialize all you class. If you only have 2-3 things to save you can simply fill up a struct with the savegame data and write it to a file.

Share this post


Link to post
Share on other sites
Thank you all for the input. I'll definitely be reading up on the provided information and build a few test programs.

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!