[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Implementing save feature
On Fri, May 22, 2009 at 02:23:45PM -0700, Nevon wrote:
> I'm currently part of a group developing a FOSS point-and-click
> adventure game using Python and Pygame. The game engine is actually a
> fork of the engine used in the game Colonel Wiljafjord and the
> Tarbukas Tyranny, and entry in Pyweek #3. Right now we're working on
> improving the engine in whatever way we can. If you're interested, the
> source is available here: http://github.com/kallepersson/subterranean/tree/master.
>
> So now I'd like to implement a save/load feature, but I don't really
> know where to start. I have no idea how game save systems are usually
> constructed, so I'm kind of lost. If anyone has any ideas, links to
> resources, or pointers on how to best do this, please share.
>
> Thank you!
>
> Tommy Brunn
> http://www.blastfromthepast.se/blabbermouth
There are a lot of ways to do this.
What sort of game-state do you have? A big part of setting up a save
game format is sorting out what data is runtime-state that doesn't
matter for save games, and what data is persistant game state that needs
to be saved.
I don't know how the engine works, but since it is a point-and-click
adventure, I am going to say right off that you will probably be saving
things like:
* hero's location
* hero's inventory
* whatever flags or bits or variables track who you have talked to and
what quests you have completed
As for the format of the data, you have a lot of options. xml, pickle,
json, yaml, binary files of you're own devising, etc.
---
James