[Scummvm-devel] SCI: Some more TODOs
Willem Jan Palenstijn
wjp at usecode.org
Sat Feb 21 00:52:41 CET 2009
On Fri, Feb 20, 2009 at 11:51:02AM -0500, Max Horn wrote:
> * I just made a big commit where I started to overhaul the file
> handling in SCI. It's incomplete, and may cause regressions, but it is
> a start. The biggest chunk left to take care of is engine/kfile.cpp,
> and in there mostly handling of savegames (and possibly of writing to
> other files -- if SCI ever does that?).
Recapping a discussion on IRC:
This is used for things like character exports and imports in the QfG
series, and for player name in Hoyle.
There's also a mention of this being used for deleting savegames where
the scripts try to manually rewrite the savegame index file.
(Search for __throwaway in kfile.cpp for this.)
FreeSCI stored the files that were written to in ~/.freesci , possibly
copying files from the resources first. I suggest we do the same thing
in ~/.scummvm , and possibly prefix the names with the game target name.
One thing to worry about in the future: this makes it relatively hard to
import exported characters in QfG. We may be able to fake a directory
structure with different games in different (fake) directories.
> This needs to be switched to
> the savefile API. One problem there is that FreeSCI apparently stored
> saves as multiple files, grouped by a directory. Does anybody know
> whether the original Sierra SCI also did this? Our savefile API does
> not (and will not) support subdirs. Some ideas on how to resolve this:
> 1) Fake subdirs by turning save_0/FILE into save_0_FILE. Or even
> better, into TARGET-FILE.0 or something like that.
> 2) Revise the save/load code in SCI to put all those files into some
> kind of archive file.
> 3) Maybe we don't need all those files? In a KQ4 save I made, there
> were only two files: state, and KQ4.id, which seems redundant (could
> be encoded into a header prefixed to 'state', plus the filename)
I just overhauled the savegame system, and went with option 3.
To quote the commit message of r38649:
"Converted SCI saving to use saveFileMan. Instead of a savegame being a
directory with an id and a state file, a savegame now consists of two
consecutive CFSML-serialized structs: SavegameMetadata and state_t. The
former contains the savegame title, and is loaded when scanning saves."
-Willem Jan
More information about the Scummvm-devel
mailing list