Far

From The Sims Technical Wiki

Jump to: navigation, search

Contents

[edit] FAR (File ARchive)

These files are the containers that pretty much contains all the data for The Sims. They have been known to support compression, but no archive for the original The Sims has been found to be compressed so far.

[edit] Header

The header for far archives is pretty straightforward, like the rest of the format. Here's how it's structured:

  • Signature - An eight byte string, consisting of the characters 'FAR!byAZ' (without quotes).
  • Version - A 4 byte integer specifying the version. (Should) always be 1.
  • Manifest offset - a 4 byte integer specifying the offset to manifest of the archive (from the beginning of the file), where offsets to every entry are kept.

[edit] Manifest

To get to the manifest, seek to the manifest offset in the header. The manifest is structured as follows:

  • Number of files - A 4 byte integer specifying the number of files in the archive.
  • Manifest Entries - As many manifest entries as stated by the previous integer

[edit] Manifest entry

A manifest entry is an entry in the manifest containing information about a file in the archive, and is structured as follows:

  • Data length - A four byte integer specifying the length of the binary filedata.
  • Data length - A four byte integer specifying the length of the binary filedata. Should be the same as the previous field, but if either fields have a smaller number, that means that the entry is compressed (not seen so far).
  • File offset - A four byte integer specifying the offset from the beginning of the archive to the archived file.
  • Length of filename - A four byte integer specifying the length of the following filename. In The Sims Online's archives, this will be 2 bytes.
  • Filename - The name of the archived file.

[edit] Version 3

The Sims Online (TSO) introduces a new version of the FAR format. This format is FAR, version 3. Files of this format are disguised as *.dat files, but uses the FAR format internally. Everything is known about this format except for the compression that is used.

Header

  • Signature - An eight byte string, consisting of the characters 'FAR!byAZ' (without quotes).
  • Version - Four bytes signifying the version of the archive. Should be 3.
  • Manifest offset - a 4 byte integer specifying the offset to manifest of the archive (from the beginning of the file), where offsets to every entry are kept.

Manifest

  • Number of files - A 4 byte integer specifying the number of files in the archive.
  • Manifest Entries - As many manifest entries as stated by the previous integer

Manifest entry

  • Raw Size - The uncompressed size of the filedata, stored as a UInt32 (4 bytes).
  • Compressed Specifics - A UInt16. See Notes.
  • Power Value - 1 byte. See Notes.
  • Unknown - 1 byte. 0 or 128.
  • DataOffset - A four byte unsigned integer specifying the offset of the data from the beginning of the file.
  • Unknown2 - 2 unsigned bytes.
  • Filename Length - UInt16. Two bytes specifying the length of the filename.
  • TypeID - UInt32, 4 bytes. See Notes.
  • FileID - UInt32, 4 bytes. ID of the current file. Assumed to be unique.
  • Filename - The filename of the current file. Length of the filename is as above (see Filename Length).

Notes

TO CALCULATE THE FILE SIZES

  • If the powerValue=0, the file size is the value of compressedSpecifics
  • If the compressedSpecifics is negative, do (((powerValue+1)*65536) + compressedSpecifics)
  • If the compressedSpecifics is positive, do ((powerValue * 65536) + compressedSpecifics)


THE TYPE ID NUMBERS

  • 1 - BMP image - (compressed)
  • 2 - TGA image - (compressed)
  • 5 - SKEL skeleton - (compressed)
  • 7 - ANIM animation - (compressed)
  • 9 - MESH model - (compressed)
  • 11 - BND binding - (uncompressed)
  • 12 - APR appearance - (uncompressed)
  • 13 - OTF outfit - (uncompressed)
  • 14 - PNG image - (uncompressed)
  • 15 - PO purchasable object (uncompressed)
  • 16 - COL collection - (compressed)
  • 18 - HAG group - (compressed)
  • 19 - JPEG image - (compressed)
  • 20 - JPEG image - (uncompressed)
Personal tools