adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] Loading/saving engine state


From: Kai Sterker
Subject: [Adonthell-devel] Loading/saving engine state
Date: Fri, 11 Sep 2009 23:23:35 +0200

Something else that I briefly thought about, as we need to be able to
save and load games for the Waste's Edge remake.

This is already implemented at the individual class level, but there
isn't anything that brings it all together. There's one difficulty,
though. Since the engine is split into separate modules, it is not so
easy to save everything from a single method or class. One possible
place would be the main module, as it is the one that (a) knows which
of the other modules are initialized/in use and (b) the one module
that can have access to all the others. The second place would be to
do it from Python, since the GUI would be wirtten in Python too.

So the design seems to ask for a global save/load function in each
module that saves everything from that module into one or more files.
These in turn can be called from a central class that knows all the
modules. In addition, it needs to provide other save-game related
features, as are already present in v0.3: handling of saved-game
directories per game. Figuring out the last saved game for a
continue/auto-load functionality (see
http://cvs.savannah.gnu.org/viewvc/adonthell-0.3/src/gamedata.cc?revision=1.29&root=adonthell&view=markup).

So, what has to be saved for each module?

base: nothing
python: nothing
main: nothing
input: nothing
gui: nothing
gfx: nothing
event: the game time
audio: background music that had been loaded and any registerd audio events
rpg: item storage, quest tree and characters, including equipment,
inventory, etc
world: map and everything on it, including schedules, path finding tasks, etc

Hope I didn't forget anything.

Again, that's something somebody else could implement. But it's
something I'd like to do soon. Ideally, worldtest should be able to
make use of that to load either the test data stuff or what is to
become the Waste's Edge remake. And I'd like to have that capability
available to actually try out the map I'll be creating.

Kai




reply via email to

[Prev in Thread] Current Thread [Next in Thread]