[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Re: Implementing save feature



Well, I assume this is an open source game, so protecting the save state 
from editing is not of highly critical importance, right?

But you do want to inconvenience casual cheaters.

I suggest saving your state to an XML file, and then compressing that 
xml file with python's built-in zip module. Then rename the save zip 
some non .zip filename like .save so that double-clicking on a save file 
won't open it in your unzipping tool.

If you want to try harder to prevent cheating you can run your xml 
through some kind of scrambling, or obfuscation, but personally I don't 
think it is worth the trouble. But it's up to you of course.

---
James

On Fri, May 22, 2009 at 02:57:27PM -0700, Nevon wrote:
> Yeah, I figure those are the things I need to save. The location, the
> inventory and all the flags, bits and variables that are assigned as
> you go through the game. But how would I go about saving those things?
> And what data format would I choose to avoid players simply going in
> and editing the save game in plain text? Have there been any articles
> or tutorials written on this?
> 
> On May 22, 11:50 pm, James Paige <B...@xxxxxxxxxxxxxxxxxxx> wrote:
> > 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
> 
>