Tes5Mod:Mod File Format
Records generally correspond to objects (e.g., a creature, a game setting, a dialog entry), with the fine details of the object (e.g., health of a creature, a dialog entry test) being handled by the fields of the record. Records themselves are organized into groups.
At the highest grouping level, a plugin file is generally:
The following had sub-record order changes and updates. Also pre-existing or new records were added.
- LCTN, INFO, NPC_, RACE, NAVI, QUST, REFR, WRLD
- LCTN added: ACID, ACSR, ACUN, ACEC, ACEP, RCPR
- NAVI added: NVSI
- REFR added: XATR
GRUPs are collections of records, and are used to improve scanning of files to make it easier to skip over records that the reading program is not interested in. In addition to this, subgroups for WRLD and CELLS provide some useful structural information (e.g., the division of cell data into persistent and non-persistent references.)
|groupSize||uint32||Size of the entire group, including the group header (24 bytes).|
|label||uint8||Format depends on group type.|
|stamp||uint16||Date stamp, presumably of the last file modification. Low byte = day; high byte = number of months since December 2002 (i.e., 1 = January 2003).|
|data||uint8[groupSize-24]||Records and subgroups.|
In Skyrim.esm, the top, or highest level groups are stored in the following order:
- GMST, KYWD, LCRT, AACT, TXST, GLOB, CLAS, FACT, HDPT, HAIR, EYES, RACE, SOUN, ASPC, MGEF, SCPT, LTEX, ENCH, SPEL, SCRL, ACTI, TACT, ARMO, BOOK, CONT, DOOR, INGR, LIGH, MISC, APPA, STAT, SCOL, MSTT, PWAT, GRAS, TREE, CLDC, FLOR, FURN, WEAP, AMMO, NPC_, LVLN, KEYM, ALCH, IDLM, COBJ, PROJ, HAZD, SLGM, LVLI, WTHR, CLMT, SPGD, RFCT, REGN, NAVI, CELL, WRLD, DIAL, QUST, IDLE, PACK, CSTY, LSCR, LVSP, ANIO, WATR, EFSH, EXPL, DEBR, IMGS, IMAD, FLST, PERK, BPTD, ADDN, AVIF, CAMS, CPTH, VTYP, MATT, IPCT, IPDS, ARMA, ECZN, LCTN, MESG, RGDL, DOBJ, LGTM, MUSC, FSTP, FSTS, SMBN, SMQN, SMEN, DLBR, MUST, DLVW, WOOP, SHOU, EQUP, RELA, SCEN, ASTP, OTFT, ARTO, MATO, MOVT, HAZD, SNDR, DUAL, SNCT, SOPM, COLL, CLFM, REVB
Whether the game engine expects this order is unknown, but it's probably safer to use this order than not.
All top groups contain records matching their label (e.g., the GMST top group contains GMST records). For most top groups, only the matching record types are present. However, in the CELL, WRLD and DIAL top groups, each main record can be followed by one or more child groups which contain additional records of a different type. Unlike Oblivion, WRLD groups in Skyrim no longer contain ROAD records.
The following groups are only found in subgroups of other records:
- REFR, ACHR, NAVM, PGRE, PHZD, LAND, INFO
- 6 record types have a GRUP but have no records:CLDC, HAIR, RGDL, SCPT, SCOL, PWAT.
- There are 2 HAZD groups, the second one has no records.
|dataSize||uint32||Size of data field.|
|id||uint32||Record (form) identifier.
|revision||uint32||Used for revision control by the CS (only if enabled)
|dataSize||uint16||Size of data field. †|
†If the preceding field has the type XXXX, then dataSize will be 0 and the size of the data is in fact the 32 bit quantity stored in the XXXX field. This feature is commonly used to store large navmesh fields in Skyrim.esm.
Commonly used fields and their definitions can be found here.