Miscellaneous
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.
This page has miscellaneous information that was too small to deserve a page by itself.
Language code
The language code is a small integer that identifies a supported language. There are twenty languages defined, although usually only fourteen are present.
Names are given to the languages in the C++ header UIGraphics/Res_Languages.h. Presumably, if additional languages are ever supported, they will show up there.
Code zero is not used in a string resource containing translations. It is not known why the translator's notes were not put there (instead of including a copy with every translated language) to minimize the space taken up by the CTSS resource.
Presumably, if language zero is requested, the locale default is used. If the requested language is not present, language one (U.S. English) is used.
| Code | Language | Code | Language | Code | Language |
| 0 | unused (default) | 7 | Dutch | 14 | Portuguese |
| 1 | English (US) | 8 | Danish | 15 | Japanese |
| 2 | English (UK) | 9 | Swedish | 16 | Polish |
| 3 | French | 10 | Norwegian | 17 | Simplified Chinese |
| 4 | German | 11 | Finish | 18 | Traditional Chinese |
| 5 | Italian | 12 | Hebrew | 19 | Thai |
| 6 | Spanish | 13 | Russian | 20 | Korean |
Not all the languages appear to be active; most objects have no more than 14 translations present.
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.
Behavior.iff
The file named Behavior.iff in the GameData directory is a treasure trove of information about game structures. It contains almost a hundred STR# (string) resources. Each resource contains information about some aspect of the game or its underlying data structures. Resources are of different types, depending upon the information it is presenting.
One type is a set of labels for mempry. Each label has a title for a two-byte field. It's likely that the labels are intended to describe structures in memory, but since structures are often transferred intact between memory and files, the same labels work to describe file formats.
Another type is a set of labels for flag bits. The individual bits are described from least significant to most significant.
Another type is a set of labels for encoding exclusive states. Effectively, this provide meanings for some set of integers.
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.
Edith
Edith is a complete simulator of the Sims' world plus a full development environment for the virtual world. EA keeps the program proprietary, so details of what it can do are somewhat limited, consisting mostly of some screenshots and anecdotes from EA developers.
Since it is primarily intended to refine objects and their interactions (rather than creating the objects originally) it has a wide range of editing capabilities for menus, behavior, and objects. All of these can be tweaked and immediately tested by running (or continuing) the simulation.
Apparently, modeling and skinning are not done by Edith; they are probably done by other tools. There are a number of commercial products for 3D modeling, so it's likely EA chose to use one of them rather than re-invent something of their own.
It is fair to say that the game is just the simulator without the development environment.
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.
Field Encoding
Field encoding is used by the game in a few places. It can save a lot of space when numbers have a reasonably small magnitude; it is especially well suited when most of the values are zero, since zero is encoded in one bit.
A compression code preceeds the encoded values. It is one byte long and always contains the value one. Presumably, different sets of encoding widths use different codes, although only the single value has been encountered in practice.
When reading fields, the bytes are considered as one long stream of bits. The most significant bit of the first byte is the first bit in the stream. Once all of the values have been read, any remaining bits in the last byte are discarded. It is possible that there is padding to an even number of bytes. I can't be certain.
When extracting a certain number of bits from the stream,
the first bit is considered the most significant.
For example, if the stream is this:
101101010110
and you read 5 bits, the resulting value is 22,
and the remaining stream looks like this:
1010110
The field encoding inserts values into the shortest possible field that will fit them. If the value is zero, it is encoded into a single zero bit. Otherwise, it is encoded into a three-bit prefix followed by a N-bit signed value. That is, if N bits are allocated for the value, the field is encoded PPPSNN...NN and the total field width is 3+1+N.
Since the prefix must begin with a one (so that it won't be confused with a zero value), so the four possible prefixes are 100, 101, 110, and 111. The field width (N) is pre-specified for each of the four prefixes.
Assuming you have a function getBits(n) which returns the value of the next n bits on the stream (and consumes them), here's how to read a field:
long getField()
{
static unsigned char widths[4] = { 5, 10, 20, 31 };
if (getBits(1) == 0) return 0;
unsigned char code = getBits(2);
unsigned char width = widths[code];
long value = getBits(width + 1);
/* magic incantation to sign-extend value */
value |= -(value&(1<<width));
return value;
}
The field widths specified in the static array are those used to decode the CARR resource; other resource types use different values.
If you really want to dig into this sort of thing, you may want to download the source to the FieldReader class (in C++).
The Sims™ is a trademark of Maxis and Electronic Arts.
This page was last modified Saturday, 04-Oct-2003 23:09:27 UTC.
