What is a resource?
Resources are the building blocks of an SCI game. Graphics, sounds,
animations, scripts, etc. are all resources. In SCI there are 18
resource types: view, picture, script, text, sound, memory, vocabulary,
font, cursor, patch, bitmap, palette, cdaudio, audio, sync(?), message,
map, and heap. I believe that some of these were only introduced later
with the SCI1 engine, meaning that not all of them are available in an
SCI0 game.
About the resource map
The SCI interpreter needs some way of organizing the individual
resources. The way Sierra accomplished this was through a file known
as resource.map The resource map is merely a listing of all
resources which make up a game. The resources themselves are stored in
what I call resource packages. These are the familiar files with names
like resource.001 and resource.002.
The resource.map format
Resource maps are just a bunch of 6 byte structures in a row. The last
structure is set to FFFFFFFFFFFF and signifies the end of the file. All
other structures list a resource and its location. The structures have
the format:
The resource type is the numerical value (0-17) for one of the 18 resource types previously listed. The resource number is used to name individual resources of the same type. (eg, view.000 through view.032) The interesting thing is that the same resource may be listed multiple times. In the early SCI days it was still possible to play the game straight off the floppy disks. To prevent excessive disk swapping, Sierra put the same resource in multiple resource packages. Each resource will have a listing for each of its instances. The resource type and resource number combine to form a 16 bit resource identifier.
A word about nomenclature: Carl Muckenhoupt used the name "file number" instead of "resource number" in his SCI Decoder. When resources are saved individually, they get saved as type.number, like script.000. I made the change because I think the term "resource number" is clearer. The lurking danger with this is possible confusion between a resource's number and its identifier. I will retain the naming system whenever talking about about a resource as an individual file, but I will continue to call its extension the resource number.
The package number is the extension for the resource package containing
the resource. A resource listed with package number 1 would be found in
resource.001. The file offset is merely the offset in bytes of
the listed resource in the resource package. The package number and
file offset combine to form a 32 bit location which completely
describes how to find the resource.