Home | SCI Documentation | SCI Tutorials | SCI Tools | SCI Wiki | Community

The Sierra Creative Interpreter

PrevChapter 7. FreeSCINext


FreeSCI attempts to store savegames portably; for this reason, most of the game data is saved as plain text, while the graphics are written to png[1] files.

Savegame directory policy

The general FreeSCI directory policy is simple: If there is a $HOME, use ~/.freesci/[game name]/ as your playground, if there is no home, use the current working directory. Savegames are true to that policy. Each save game has a directory associated with itself, and this directory is relative to the directory mentioned above. For example, if you execute "save_game frobnitz" in SQ3 on your *BSD box while your $HOME is set to /home/rogerw, the save game files would be written to /home/rogerw/.freesci/SQ3/frobnitz/.



This is the main save file. It contains huge amounts of text data, which are an almost-complete replication of the game internal state_t structure. The code used to read and write this file is automatically generated by a script called cfsml.pl, and it is believed to be rather flexible; i.e. you should be able to insert blank lines, comment lines, (Using the hash ('#') sign), move assignements around, and change values. The identifiers used in this file are identical to the identifiers used in the c code.


This is a binary copy of the heap data. Heap data is internally structured to be identical to SCI heap data (little endian, 16 bit), so it is portable to all platforms.


These files contain raw hunk data. SCI code may allocate raw hunk data, but it can't do anything with it (except unallocate it again). It is unlikely that you are going to encounter a hunk file in normal SCI code. This may change for later SCI versions.


Songs stored by the sound subsystem.


Contains the state of the sound subsystem. The syntax is identical to the used in the "state" file.


Savegame name file for one SCI game. The file names are chosen by taking the game's "unique" identifier and appending a suffix of ".id". This file contains the savegame name in plain text.

Obsolete files

The following files were generated by earlier versions of FreeSCI, but are no longer used:


The four maps of the main picture are stored in four separate png files:


The meanings of those files should be rather obvious.

visual_map.png contains regular palette or color information, so it is, in fact, a screenshot of the game (the mouse pointer is not shown, since it is not stored in the display maps). The other three png files each contain a greyscale gradient palette.


These are png files containing the various graphical buffers used in the game. buffer_x.1 is the visual buffer, buffer_x.2 is the priority buffer, and buffer_x.4 is the control buffer. Any combination of these three buffers is possible.

Control and priority buffers contain a grayscale gradient palette.


FreeSCI's file saving and restoration functionality isn't perfect. Please be aware of the following flaws and limitations before you dig out your flame thrower:

File handles

Open file handles are NOT stored or loaded. If you try to save the game with the built-in debugger while file handles are still open, you will be warned about this and saving will abort, unless you preceed your save directory name with an underscore ('_').

Kernel functions

SCI kernel functions are able to call the virtual machine. In practice, this means that you may have two or more vm function calls on your system stack; it is not easily possible to store the game state in this case. FreeSCI does not allow it, and, as far as I know, no Sierra SCI code ever tries to do that.

To determine whether or not this applies to you, run "bt" in the debugger; the "base" number in the first line must be zero, or you won't be able to save the game (restoring should work, though).


[1] Portable Network Graphics. A very portable graphics format with lossless compression, a free reference implementation, and dozens of useful features.

Prev - Header FilesHomeNext - The Graphics Subsystem

by helping to defray some of the costs of hosting this site. If it has been of help to you, please consider contributing to help keep it online.
Thank you.

© 2013 to present The Sierra Help Pages. All rights reserved. All Sierra games, artwork and music © Sierra.