save games

Started by
5 comments, last by milkyman 20 years, 5 months ago
looking to create a GOOD save/load game option for my game and wondered if someone had found some source in either java, c++ or VB? as always thankyou
Advertisement
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.
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
- To learn, we share... Give some to take some -
lol some people
hahaha. - johnnybravo.

no i''m newbie towards making games and i''m learning. i have/had no idea of what made up saved games. i will look it up on game dev.

thankyou
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
The file format/loading/saving thing - one word.

XML.
die or be died...i think

This topic is closed to new replies.

Advertisement