Archived

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

save games

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

You don''t need source, you need to learn to use your brain. I''m not sure how experienced you are with programming, but perhaps you could break up the problem using these simple questions:

* What is it that I want saved in my saved-games files?
* How will my game handle saved game files?

Really by saved-game, I''m guessing you want to save the current level (just an int), the player''s current stats (more numbers), and the location and state of every object that has moved since the level started.

In that case, it''d be pretty simple for the game to load the saved level data, and resume play. You just need to work out on paper how you would incorporate this into your code. Source code will not help you out there, since all games are different in some way.

Share this post


Link to post
Share on other sites
the thing u wanna read up on is serializing application data. there are many ways to prepare the data for this, but the ultimate solution will be as mentioned previously. U need to know what to serialize and how is to to be organized. Once u have that, its like having a pseudocode or blueprint of the datatypes u need to store. The actual writing to permanent storage is not very different from common I/O operations.

i think there are a few articles on gamedev that cover serialization. I know theres at least one on the PAK format. Just browse thru. Who knows u may find more than what u''re looking for

Share this post


Link to post
Share on other sites
well like the others said think of what you need to save.

eg player position, health, ammo.
enemie position, enemy type, enemy life etc
map state, eg doors, open close etc

put these into an array, and develop your own way of reading such data out of a file eg.
[player]
123,532
100
33
[monsters]
231,534
2
89
231,534
2
89
231,534
2
89

then when reading them , read them back into the array which your program uses for the data

Share this post


Link to post
Share on other sites