Jump to content
  • Advertisement

Archived

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

mittens

Newbie in need of help

This topic is 3763 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
Advertisement
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
etc.

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,
Frank

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!