Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Newbie in need of help

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

Hi, I''m currently making a game. And I need help. I am writing it in C++, and I need to know how to program a "game saving" feature into my game. Any help would be greatly appreciated. Thanks! ------------------------------ The Shining Knight

Share this post

Link to post
Share on other sites
To save a game you need to save all of the variables needed by your engine to know the game''s current state, so it can load it back and everything will be the same. Take an example of packman, you might need to save the following:
- the player''s position and direction
- the monster''s positions and directions
- the blips that have been eaten
- is the game in "big blip" mode (packman eats the monsters)
- AI state of the monsters

Basically you need to take the values of everything in the game as it is, and save it to a file (using fstream for example).

Hope that helps,

Share this post

Link to post
Share on other sites
Hey frank, do you know how to error check on fstreams? Saying I try to load in 5 strings, but there''s only 2. And then I wanted to fill the 3 that weren''t there with just zeros or something. Thanks.

Share this post

Link to post
Share on other sites

  • 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!