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

Re: [pygame] Re: Implementing save feature



Unfortunately, no, I don't have any good examples for you, because most 
of my xml experience has not been python based. You might want to look 
at the xml modules available in the python standard library 
documentation. You can choose from expat, minidom, pulldom, sax, 
elementtree, or maybe some I am forgetting. Maybe somebody else on the 
list can suggest which is the best match for pygame.

In general though, you will probably end up with a file that has a 
node for general data, with some named data elements inside it, and a 
node for inventory with a list of item elements inside it, and a node 
for flags with a list of flag elements inside it.

---
James

On Fri, May 22, 2009 at 03:09:59PM -0700, Nevon wrote:
> No, it's not super important. I just don't want to make too darn easy
> to cheat. Your way should suffice.
> 
> Now what about storing the data in an xml-file. Do you have any
> examples of how this is done?
> 
> On May 23, 12:04 am, James Paige <B...@xxxxxxxxxxxxxxxxxxx> wrote:
> > 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
> >
> 
>