The Sims™ Technical Aspects

GLOB Resource Format


The following information is not based on any proprietary knowledge or restricted documentation—it was entirely derived from observation, experiment, and public information, thus it may be inaccurate or incomplete.

Analyzed by Greg Noel.

A semi-global file contains common resources that can be used by the objects in another file. The GLOB resource contains the name of the semi-global file that should be in scope for the objects in the current file.

As far as is known, only one GLOB resource is permitted per file. The ID of the GLOB resource is apparently not used and may be any value; 128 is the most common ID value and a value of one also occurs frequently.

GLOB Layout
Offset Size Value
0 var Semi-global name
var opt Filler

The semi-global name is a string. It contains the root of the semi-global filename (that is, the filename with the directory prefix and .iff suffix stripped off). The name is case-insensitive; "CarGlobals" and "carglobals" both refer to the same file.

The string can be encoded in a number of ways. Unfortunately, there is no clue given as to which format is present, so code has to be smart about extracting it.

The simplest flavor is when the resource will just contain the string itself. That is, an eleven-byte string will be in an eleven-byte resource. Obviously, there is no filler with this flavor. This flavor may be a bug; there's only one instance of it.

Another flavor is when the resource contains a null-terminated string, possibly followed by filler. That is, a twelve-byte string will be in a resource that is at least thirteen bytes long.

One other flavor is that the resource contains a counted string, where the first byte of the resource is the count and the next count bytes are the string. This flavor can also be padded with filler. Also in this case, a twelve-byte string will be in a resource that is at least thirteen bytes long.

No GLOB name has been observed to be longer than 32 bytes, so it is probably safe to assume that if the first byte is less than 48 (the ASCII code for zero and hence the lowest-numbered byte that could be part of a filename) the string is counted; otherwise, the string starts with the first byte and extends to a null character or end-of-file.

The filler, when present, is bytes of 0xA3. It will usually pad the resource out to 256 bytes. The reason for the padding is unknown.


Reminder: This information is not based on any proprietary knowledge or restricted documentation—it was entirely derived from observation, experiment, and public information, thus it may be inaccurate or incomplete.

Valid XHTML 1.1! Valid CSS!
Copyright © 2001-2008 Dave Baum and Greg Noel. All rights reserved.
The Sims™ is a trademark of Maxis and Electronic Arts.
This page was last modified Saturday, 09-Nov-2002 18:56:34 UTC.
Made on a Mac
SourceForge