Tes4Mod:Save File Format

The UESPWiki – Your source for The Elder Scrolls since 1995

Jump to: navigation, search

Contents

[edit] Overview

Doesn't use standard format of ESP/ESM files as in Morrowind.

Files are not encrypted or compressed. Just lots of raw data.

Current format documentation is very incomplete. Some tables are broken into different sections, but the data is still sequential (i.e., Plugins data follows Save Game Header, etc.).

You can make a text dump of a save game's contents by using the SaveGame (save) or LoadGame (load) console commands. Simply append a non-zero value to the command arguments, eg: save test 1 or load test 1. It will generate a text file named with the same filename as your save game, but with .txt appended, eg: save test 1 will generate a test.ess.txt file. The dump file contains list of records by type and length of "subrecords" inside records.

It is probably a good idea to review the File Format Conventions.

[edit] CON (Xbox 360 only)

This section is a total of 53248 (0xD000) bytes.

This header is NOT needed by PC Oblivion, nor is it ever present in PC Oblivion created saves.

This is actually the first section of the Xbox 360 File Container, and is only found on Xbox 360 save files. The File Container format that this record is part of also inserts other chunks of information into the Oblivion save file. These additional chunks are inserted independent of the Oblivion save file format, as 4-16 KB pieces that typically appear somewhere after the first 600KB or so of "real" data. Therefore any file starting with a "CON " record needs to have the container information removed (for example, using WxPirs) before it can be parsed according to the format on the rest of this page (and before it can be read by the PC version of Oblivion). See Xbox 360 for more information on accessing Xbox 360 save files.

Name Type/Size Info
conId char[4] Constant: "CON "

The space is a space - not a NULL (0x00).

conData ubyte[53244]

[edit] File Header

Name Type/Size Info
fileId char[12] Constant: "TES4SAVEGAME"
majorVersion ubyte Current Oblivion major version is 0.
minorVersion ubyte After Shivering Isles and patch 1.2 minor version has been 126, before it was 125.
saveTime systemtime Real time that save was made. Obtained with GetLocalTime() API. This field is not present in save files less than version 0.82.

[edit] Save Game Header

Name Type/Size Info
headerVersion ulong Header's version number. After Shivering Isles and patch 1.2 version has been 126, before it was 125.
saveHeaderSize ulong Size in bytes of Save Game Header (not including this size variable).
saveNum ulong Save number. Based on what? A:Maybe its total count of saves, which you have done during all gametime.'
pcName bzstring PC's (player character's) name.
pcLevel ushort PC's level.
pcLocation bzstring PC's current cell.
gameDays float Days that have passed in game.
  • Starts at 1.042 (Day 1, 1 AM).
gameTicks ulong Uses the GetTickCount() API to count how many ticks occur during gameplay. This is a total of all ticks elapsed during gameplay.
gameTime systemtime Obtained with GetLocalTime() API.
screenshot struct Screenshot at time of save.
size
ulong Size of remaining snapshot data. Value = (width * height * 3) + 8.
width
ulong Pixel width.
height
ulong Pixel height.
data
ubyte[3*width*height] RGB bytes with no compression. Remember that bitmap's scan line typically have different length.

[edit] Plugins

Name Type/Size Info
pluginsNum ubyte Number of plugins including masters.
plugins list[pluginsNum] List of plugin names.
name
bstring Plugin file name (including extension).

[edit] Global

Name Type/Size Info
formIdsOffset ulong Absolute address of formIdsNum.
recordsNum ulong Number of change records.
nextObjectid formid Number of next savegame specific object id. I.e. FFxxxxxx. When this value is overflow it causes Shivering Isle's infamous Reference Bug.
worldId formid
worldX ulong Most likely part of Worldspace ID data.
worldY ulong Most likely part of Worldspace ID data.
pcLocation struct Current PC location (cell and position within cell).
cell
ulong FormID of cell. (Not iref).
x
float X coordinate.
y
float Y coordinate.
z
float Z coordinate.
globalsNum ushort
globals struct[globalsNum] Array of global variables.
iref
ulong Iref of global.
value
float Value of global.
  • Note that all globals are represented as floats regardless of their CS4 type (float, long, short).
tesClassSize ushort
tesClassData ubyte[tesClassSize] TES Class data.
processesSize ushort
processesData ubyte[processesSize] Processes data.
specEventSize ushort
specEventData ubyte[specEventSize] Spectator Event data.
weatherSize ushort
weatherData ubyte[weatherSize] Sky/Weather data.
unknown5 ulong unknown (this doesn't seem to be related to created items after all). Appears to be combat related?
createdNum ulong
createdData list[createdNum] Items (potions, enchanted items, spells) created in-game.
quickKeysSize ushort
quickKeysData ubyte[quickKeysSize] Quick Keys settings.
reticuleSize ushort
reticuleData ubyte[reticuleSize] HUD Reticule.
interfaceSize ushort
interfaceData ubyte[interfaceSize] Interface stuff.
regionsSize ushort Size of regionsNum + regions array.
regionsNum ushort
regions struct[regionsNum] Array of information about regions.
iref
ulong Iref of region.
unknown6
ulong Region data. ?Flags?

[edit] Records

Name Type/Size Info
records list[global.recordsNum] Collection of records documenting changes to data objects supplied by the master mods, and new objects added during game play.
formId
ulong FormId of the data object being changed. FormId for objects created in-game have value between 0xFF000000 - 0xFFFFFFFF.
type
ubyte Type of record.
Type Name Info
6 FACT Factions
19 APPA Alchemical Apparatus
20 ARMO Armor
21 BOOK Books
22 CLOT Clothing
25 INGR] Ingredient
26 LIGH Lights
27 MISC Misc. Items
33 WEAP Weapons
  • This record type has been observed to be used at with quests that requires weapon delivery.
35 NPC_ Player and NPC data: attributes, spells, factions, etc.
  • These changes affect all instances of objects.
  • Record 7 contains player character data.
36 CREA Creature information (rats, horses, hostile creatures.)
  • These changes affect all instances of objects.
39 KEYM Keys
40 ALCH Alchemy
48 CELL Cells.
49 REFR Placed instances of inanimate objects (containers, dropped items, chairs, doors, etc.)
50 ACHR Placed instances of PC (player character) and NPCs (non-player characters).
  • Record 20 (14h) contains player character data.
51 ACRE Placed instances of creatures.
58 INFO Dialog entries.
59 QUST Quest information
61 PACK AI Packages.
flags
ulong Flags indicating what has been changed. Most flags have a corresponding sub-record in the record data. See Change Flags.
version
ubyte Since patch 1.2 and Shivering Isles 126 (0x7E), before it was 125 (0x7D).
dataSize
ushort
data
ubyte[dataSize] Collection of change sub-records.

[edit] Temporary Effects

Name Type/Size Info
tempEffectsSize ulong
data ubyte[tempEffectsSize]

[edit] FormIDs Array

Name Type/Size Info
formIdsNum ulong Number of formIds in array.
formIds ulong[formIdsNum] Array of formIds.
  • Formids for objects created in-game are not included in the formids array. "irefs" are only dereferenced from the formid array if they are less than 0xFF000000.

[edit] World Spaces Array

Probably an array that maps internal references to world space formIds. But if that's so, doesn't it duplicate functionality of FormId array?

Name Type/Size Info
worldSpacesNum ulong Number of world spaces in array.
worldSpaces ulong[worldSpacesNum] Array of world space formIds.
Sponsored Links
Personal tools