Tes5Mod:Save File Format

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

Contents

See File Format Conventions to understand the variables and the data types this specification uses.

[edit] Xbox 360

The Xbox 360 uses a container for all of its user content. The STFS file system used for the container has been mapped out and files within them can be extracted using tools such as WxPirs or Horizon.

It is entirely possible to use Xbox 360 game saves on the PC version of Skyrim. The only draw back is that the first time a game save is used on the PC version of the game, the preview screenshot is swizzled. Saving the game again once you have it loaded will fix this.

To get your XBOX 360 save. One would use a tool like Horizon to get your game save off of a Xbox 360 formatted drive (such as a USB drive) and extract the Savegame.dat from the Xbox 360 container and rename it to anything ending in ".ess". After this one would put this new ess file in Documents\My Games\Skyrim\Saves and load it in Skyrim as usual.

It is possible to perform this in the reverse direction as well. Rename your savegame.ess to savegame.dat. Then, use Horizon to reinject the save into the save originally transferred from the Xbox 360. You must then rehash and resign your save so it can be used on your Xbox 360. The only drawback of this is the same as the other: the screenshot is swizzled, but it works. This can be used to fix quest related bugs with the console if you have access to both a PC and Xbox 360 version of the game.

[edit] FormID

FormIDs in save files are stored as 3 bytes, rather than the usual 4 byte uint32 formID. These will be referred to as RefID.

[edit] RefID

The lower 22 bits represent the formID value itself, while the upper 2 bits are the type of formID.

Name Type/Size Info
byte0 uint8 The upper two bits represent the type of formID:
  • 0 = An index into the File.formIDArray. If the index value of 0 is given, the formID is 0x00000000, else, index into the array using value - 1.
  • 1 = Default (ie, came from Skyrim.esm)
  • 2 = Created (ie, plugin index of 0xFF)
  • 3 = ???
byte1 uint8
byte2 uint8

For example, the global variable "DragonsAbsorbed" (0x0001C0F2) becomes the bytes: 41 C0 F2

[edit] File

Name Type/Size Info
magic char[13] Constant: "TESV_SAVEGAME"
headerSize uint32 Size of the header.
header Header
screenshotData uint8[3*shotWidth*shotHeight] RGB pixel data of the image.
formVersion uint8 current as of Skyrim 1.9 is 74.
pluginInfoSize uint32 Size of the plugin information.
pluginInfo Plugin Info
fileLocationTable File Location Table
globalDataTable1 Global Data[fileLocationTable.globalDataTable1Count] Types 0 to 8.
globalDataTable2 Global Data[fileLocationTable.globalDataTable2Count] Types 100 to 114.
changeForms Change Form[fileLocationTable.changeFormCount]
globalDataTable3 Global Data[fileLocationTable.globalDataTable3Count] Types 1000 to 1005.
formIDArrayCount uint32
formIDArray formID[formIDArrayCount]
visitedWorldspaceArrayCount uint32
visitedWorldspaceArray formID[visitedWorldspaceArrayCount] A list of the FormIDs of all worldspaces visited by the player.
unknown3TableSize uint32 Size in bytes of unknown3Table.
unknown3Table Unknown 3 Table

[edit] Header

Name Type/Size Info
version uint32 current: 9, supported: 7 - 9
saveNumber uint32 Save number, used for default name of save file. Presumably this is a counter keeping track of the total number of saves you have made to date.
playerName wstring
playerLevel uint32
playerLocation wstring
gameDate wstring In-game date at the time of saving.
playerRaceEditorId wstring
playerSex uint16
  • 0 = Male
  • 1 = Female
playerCurExp float32 Experience gathered for level up.
playerLvlUpExp float32 Experience required for level up.
filetime filetime
shotWidth uint32 Screenshot width (in pixels).
shotHeight uint32 Screenshot height (in pixels).

[edit] Plugin Info

Name Type/Size Info
pluginCount uint8
plugins wstring[pluginCount]

[edit] File Location Table

Name Type/Size Info
formIDArrayCountOffset uint32 Absolute offset to the start of File.formIDArrayCount.
unknownTable3Offset uint32 Absolute offset to the start of File.unknown3TableSize.
globalDataTable1Offset uint32 Absolute offset to the start of File.globalDataTable1.
globalDataTable2Offset uint32 Absolute offset to the start of File.globalDataTable2.
changeFormsOffset uint32 Absolute offset to the start of File.changeForms.
globalDataTable3Offset uint32 Absolute offset to the start of File.globalDataTable3.
globalDataTable1Count uint32 The number of Global Data in File.globalDataTable1 (9).
globalDataTable2Count uint32 The number of Global Data in File.globalDataTable2 (15).
globalDataTable3Count uint32 The number of Global Data in File.globalDataTable3 (5 -- bugged).

Note: This count is currently bugged (as of version 112) that it does not include type 1001 (Papyrus) in the count. This causes Skyrim to never read the final type in this table, which is typically type 1005 (Main), thankfully the bug is harmless since this type never has any data.

changeFormCount uint32
unused uint32[15]

[edit] Global Data

Name Type/Size Info
type uint32
length uint32
data uint8[length] Format of data depends on its type:

[edit] Change Form

Note: the layout of the data section is not a Record as it is in a mod file. Work is in progress documenting changeForm structures here: changeFlags

Name Type/Size Info
formID RefID
changeFlags uint32 A combination of changeFlags that indicates which changes are included in the data.
type uint8

Upper 2 bits represent the size of the data lengths:

  • 0 = uint8
  • 1 = uint16 (> 0xFF)
  • 2 = uint32 (> 0xFFFF)

Lower 6 bits represent the type of form:

  • 0 = 63 (REFR)
  • 1 = 64 (ACHR)
  • 2 = 65 (PMIS)
  • 3 = 67 (PGRE)
  • 4 = 68 (PBEA)
  • 5 = 69 (PFLA)
  • 6 = 62 (CELL)
  • 7 = 78 (INFO)
  • 8 = 79 (QUST)
  • 9 = 45 (NPC_)
  • 10 = 25 (ACTI)
  • 11 = 26 (TACT)
  • 12 = 27 (ARMO)
  • 13 = 28 (BOOK)
  • 14 = 29 (CONT)
  • 15 = 30 (DOOR)
  • 16 = 31 (INGR)
  • 17 = 32 (LIGH)
  • 18 = 33 (MISC)
  • 19 = 34 (APPA)
  • 20 = 35 (STAT)
  • 21 = 37 (MSTT)
  • 22 = 42 (FURN)
  • 23 = 43 (WEAP)
  • 24 = 44 (AMMO)
  • 25 = 47 (KEYM)
  • 26 = 48 (ALCH)
  • 27 = 49 (IDLM)
  • 28 = 50 (NOTE)
  • 29 = 105 (ECZN)
  • 30 = 10 (CLAS)
  • 31 = 11 (FACT)
  • 32 = 81 (PACK)
  • 33 = 75 (NAVM)
  • 34 = 120 (WOOP)
  • 35 = 19 (MGEF)
  • 36 = 115 (SMQN)
  • 37 = 124 (SCEN)
  • 38 = 106 (LCTN)
  • 39 = 123 (RELA)
  • 40 = 72 (PHZD)
  • 41 = 71 (PBAR)
  • 42 = 70 (PCON)
  • 43 = 93 (FLST)
  • 44 = 46 (LVLN)
  • 45 = 55 (LVLI)
  • 46 = 84 (LVSP)
  • 47 = 66 (PARW)
  • 48 = 22 (ENCH)
version uint8 Current as of Skyrim 1.9 is 74. Older values (57, 64, 73) are also valid.
length1 depends on flags Length of following data.
length2 depends on flags If this value is non-zero, data is compressed. This value then represents the uncompressed length.
data uint8[length1]

[edit] Unknown 3 Table

Name Type/Size Info
count uint32
unknown wstring[count]

Personal tools
 What is this Ad?
Report Ad