From: brett l. <wak...@gm...> - 2006-06-30 23:04:37
|
On 6/30/06, Erik Vos <eri...@hc...> wrote: > I see two alternatives: > > 1. Serialize all classes that hold the current state. > I have no experience with serializing, so I don't know > if this really is a good idea. This seems like a non-trivial amount of work, including reworking many of our existing classes. > 2. Store the Undo stack. > > The second option presupposes that we create a stack of atomic > actions, which can be played back (Undo) and forward (Redo) as > far as back to the start of the game (as you can do in > Lemmi's moderator). Loading a saved game then would amount to > ReDoing the whole stack (e.g. an XML file consisting of a sequence > of <action> tags). > > The nice thing about this last option is that one solution can > provide for two needed features. But, again, I'm not sure if > this really is a good idea. > I agree, that Undo/Redo is a much needed feature. However, I don't think it eliminates questions about how to store the data and defining game-specific templates of what to store. I think we're going to need a DTD (or similar template) to define the syntax of the saved game file. Having it hard-coded doesn't seem like a wise idea. Though, I certainly could be wrong here. I am also concerned about the time it will take to load a saved game if we're going to go with the 'replay all steps' model. Perhaps we should store both the state of the game when saved, and the list of previous plays? This would allow us to only need to reload the game state while still having access to the previous actions for either loading later or loading asynchronously. What do you think of this? Also, one other alternative is to allow undo/redo during a game, but not save it to the file, and just decide that undo/redo after the application closes is just simply not supported. I suppose it really depends on how much effort we want to put into this paticular feature. My initial inclination is to keep it simple and expand on it later if there's demand for the additional abilities. ---Brett. |