Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 18th, 2006, 12:09 PM   #1
Varrickmana
Newbie
 
Varrickmana's Avatar
 
Join Date: May 2006
Posts: 21
Rep Power: 0 Varrickmana is on a distinguished road
Saving Progress

I was wondering how people let their programs save their progress. Like on a text-based rpg, how would I allow the player to save their game? I have an idea of what the answer might be, but please, help me out on this one. Please give me a detailed description of what to do if you can. Thx.
__________________
Kids, every year, more than 400,000 people die from tobacco chewing, smoking, an-
MY GOD, HERE COMES A ZOMBIE PIRATE NINJA!!!!!!
Varrickmana is offline   Reply With Quote
Old May 18th, 2006, 12:38 PM   #2
King
Professional Programmer
 
King's Avatar
 
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 380
Rep Power: 3 King is on a distinguished road
What is your idea, we can tell you if it sucks or not. Depending on how complicated your game is you can just save some info to a text file, then read it back in when you start the game back up.
__________________
I am Addicted to Linux!
King is offline   Reply With Quote
Old May 18th, 2006, 1:02 PM   #3
skoob
Newbie
 
skoob's Avatar
 
Join Date: May 2006
Location: AZ
Posts: 8
Rep Power: 0 skoob is on a distinguished road
Send a message via MSN to skoob Send a message via Yahoo to skoob
What is the reason for save a game that is 30 minutes long?
skoob is offline   Reply With Quote
Old May 18th, 2006, 1:04 PM   #4
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 314
Rep Power: 4 Klarre is on a distinguished road
An idea is to have a "GameState" class (or struct), where you store all things that you want to keep. And if everything in that class is static (no std::vector or std::string, just static arrays), it is very simple to write this class instance to a binary file, and then recreate it when you want to load your game.
This link might help you using binary files if you are not already familiar with it: http://www.cplusplus.com/doc/tutorial/files.html
Klarre is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:14 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC