Oblivion Mod:Save File Format/Location Data

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

This page summarizes several subrecords providing Location Data which are common to ACHR, ACRE, and REFR change records. The page is designed to be included in those pages, but the information has been collected in one place to ensure that future updates are added to all appropriate places.

Cell Changed[edit]

The Cell Changed subrecord is present when byte 31 (0x80000000) is set in an ACHR/ACRE/REFR record's overall Flags. Its length is a constant 16 bytes. It contains information about the original position of an actor who has moved from one cell to another. When present, it is always the first subrecord to appear.

In analyzed save files, Cell Changed subrecords have only been seen in ACHR and ACRE change records. However, occasionally REFR change records are seen for creature-related objects such as LVLC, which perhaps could also change cells. Therefore, it seems safest to assume that this subrecord could appear for any of the three change record types.

The x/y/z data in this subrecord is identical to the contents of the original mod record's DATA subrecord; the cell is the same as the CELL group in which the record originally appeared. One theory is that this data is used when cells are reset, to ensure that the actor is respawned at its original location (or perhaps is only respawned if it would not produce a duplicate).

Name Type/Size Info
cell iref Iref pointing to the cell where the object was originally located (before changing cells)
x float X coordinate of object's original location.
y float Y coordinate of object's original location.
z float Z coordinate of object's original location.

Created[edit]

The Created subrecord is present when byte 1 (0x00000002) is set in an ACHR/ACRE/REFR record's overall Flags. Its length is a constant 36 bytes. It contains information about the base item and the object's position.

The only subrecord that precedes the Created subrecord is Cell Changed, if both were to appear in the same record.

Note that newly-created ACHR/ACRE/REFR (e.g., placed instances of items) are only identified by this section -- they are not also listed in the save file's createdData section. The createdData section is reserved for new item definitions, e.g. custom-defined potions, weapons, or other item types.

Earlier documentation listed "Base Object" as the subrecord corresponding to byte 1; the Base Object subrecord was listed as a 4-byte subrecord containing the same information as base_item in the Created subrecord. The earlier information was probably based on an incomplete analysis of the record's contents.

Name Type/Size Info
flags ulong flag 0x2 (only one that seems to be read) determines whether to process this record as a world object or a bound object
base_item iref An iref pointing to the base object; equivalent to the NAME subrecord in a REFR mod record, except it is an iref instead of a formID.
cell iref Iref pointing to the cell where the object is located.
x float X coordinate of object's position.
y float Y coordinate of object's position.
z float Z coordinate of object's position
rX float Rotation around the X-axis in radians. See notes about rX under Moved
rY float Rotation around the Y-axis in radians.
rZ float Rotation around the Z-axis in radians.

Moved[edit]

The Moved subrecord is present when byte 2 (0x00000004) is set in an ACHR/ACRE/REFR record's overall Flags. Its length is a constant 28 bytes. It contains information about the object's new position.

The only subrecord that precedes the Moved subrecord is Cell Changed, if both were to appear in the same record. It appears in the same relative location as the Created subrecord, and presumably appears in place of the Created subrecord for pre-existing objects. Moved and Created subrecords have never been seen together, and it is assumed that they never would appear simultaneously, since all of the information provided in the Moved record is already covered by the Created record.

Name Type/Size Info
cell iref Iref pointing to the cell where the object is located. 0x00000000 means that the cell has not changed

(Previous documentation emphatically but incorrectly claimed that cell was a formid, not an iref. In current analyses, 59438 subrecords have been found that contain irefs; another 95156 subrecords contained 0x00000000. No subrecords were found containing formids, even formids to temporary objects).

x float X coordinate of object's position.
y float Y coordinate of object's position.
z float Z coordinate of object's position
rX float Rotation around the X-axis in radians.

rX frequently appears to contain some sort of flag, instead of the actual rotation. For example, rX values such as 0xFFFF7F7F have been seen, which translates into the improbable float value of 3.4E38. Generally, rY and rZ contain "normal" values for rotation in these cases (although rare cases of flag-type values for rY and rZ have also been seen). The significance of rX in these cases is unknown.

rY float Rotation around the Y-axis in radians.
rZ float Rotation around the Z-axis in radians.

Havok Moved[edit]

This Havok Moved subrecord is present when byte 3 (0x00000008) is set in an ACHR/ACRE/REFR record's overall Flags, but only if neither Created nor Moved appears (if neither flag 1 nor 2 is set). Its length is a constant 28 bytes, and uses the same format as a Moved subrecord. It contains information about the object's new position.

The only subrecord that precedes the Havok Moved subrecord is Cell Changed, if both were to appear in the same record. It appears in the same relative location as the Created and Moved subrecord, and appears in place of those records. Presumably it is used for objects which only moved as a result of the havok physics (e.g., because they were bumped, or the table on which they were located was jostled), as opposed to objects which were grabbed or dropped in a new location by the player. Objects that were Havok Moved are normally re-positioned in their original locations when the cell is reset.

Note that this subrecord is only one part of the "Havok Moved" data. Additional data can be added to the Miscellaneous section, although details of the additional data are poorly understood.

Oblivion Flag[edit]

The Oblivion Flag subrecord is present when byte 23 (0x00800000) is set in an ACHR/ACRE/REFR record's overall Flags, but only if none of Created, Moved, or Havok Moved) appears (if none of flags 1, 2, 3 or set). Its length is a constant 4 bytes, and contains information about the Oblivion cell in which the object is located.

The only subrecord that precedes the Oblivion Flag subrecord is Cell Changed, if both were to appear in the same record, but only because data is added for the Oblivion Flag only in the absence of the other preceding sections. Otherwise, no data is added to the record; the Oblivion cell information can instead be retrieved from the cell entry in one of the other sections.

One theory for this subrecord's rationale is that it is used when an Oblivion World is de-activated and all the change records associated with that world need to be found and deleted. Oblivion worldspaces are unique in that they are de-activated, and then later new instances of the entire worldspace may be created, with no memory of the earlier worldspace -- the cell reset on an Oblivion worldspace needs to be more thorough than on any other cell, and this subrecord is part of the mechanism for the thorough reset.

Name Type/Size Info
cell formid or iref Formid or iref for the Oblivion cell (i.e. Planes of Oblivion CELL or WRLD record) where the object is located. Both formids and irefs have clearly been seen in this record -- even for references to the same cell, within the same save file.