User:Eckserah/File Formats/Fallout 76 Mod File Format

Overview
This has a very similar format to Skyrim's Skyrim.esm. See the UESP docs.

File format conventions
These are mostly the same as those used on UESP with a few changes.

The column headings used in the tables describing the fields for a particular record are:-


 * C
 * This is the same as UESP, except the values for this column are borrowed from standard regex conventions.
 * Blank - always one instance
 * ? - zero or one instances
 * * - zero or more instances
 * + - one or more instances


 * Tag
 * This is equivalent to the "SubRecord" column on UESP.


 * Name
 * These should have distinct values for each field in a record, and only contain alphanumeric characters and underscores, so as to be valid identifiers in most programming languages.


 * Type
 * These are mostly the same, but for simplicity, where a field is a struct, just the members of the struct are listed, rather than indenting under struct fields.


 * Description
 * This is equivalent to the "Info" column on UESP.

TES4 header
N.B. This currently only shows fields in the master file. Plugins have additional fields.

Top-level groups
Records reside in top-level groups, labelled with the same tag as the records they contain. Some groups appear twice in the file, and are marked in bold on their second appearance.

The order in which the groups appear in the file are:-

GMST KYWD LCRT AACT TRNS CMPO TXST GLOB DMGT CLAS FACT HDPT RACE SOUN ASPC MGEF LTEX ENCH SPEL ACTI TACT ARMO BOOK CONT DOOR INGR LIGH MISC STAT SCOL MSTT GRAS TREE FLOR FURN WEAP AMMO NPC_ LVLN KEYM ALCH IDLM NOTE PROJ HAZD BNDS TERM GRAS TREE FURN WEAP AMMO NPC_ LVLN KEYM ALCH IDLM NOTE PROJ HAZD BNDS LVLI WTHR CLMT SPGD RFCT REGN NAVI CELL WRLD QUST IDLE PACK CSTY LSCR ANIO WATR EFSH EXPL DEBR IMGS IMAD FLST PERK BPTD ADDN AVIF CAMS CPTH VTYP MATT IPCT IPDS ARMA ECZN LCTN MESG DOBJ DFOB LGTM MUSC FSTP FSTS SMBN SMQN SMEN MUST DLVW EQUP RELA ASTP OTFT ARTO MATO MOVT SNDR SNCT SOPM COLL CLFM REVB PKIN RFGP AMDL LAYR COBJ OMOD MSWP ZOOM INNR KSSM AECH SCCO AORU SCSN STAG NOCM LENS GDRY OVIS

The following groups contain additional record types inside nested groups:-


 * CELL - ACHR, NAVM, PGRE, PHZD, REFR
 * QUST</tt> - DIAL</tt>, DLBR</tt>, INFO</tt>, SCEN</tt>
 * WRLD</tt> - ACHR</tt>, CELL</tt>, LAND</tt>, NAVM</tt>, PGRE</tt>, PHZD</tt>, PMIS</tt>, REFR</tt>

ACHR records
ACHR.NAME   formID    Base NPC ACHR.XLCN   formID ACHR.XLYR   formID ACHR.XLRT   formID ACHR.XLKR   struct { formID; formID } ACHR.XESP   struct { formID Enable Parent; int } ACHR.DATA   struct { float X; float Y; float Z; float rot-X; float rot-Y; float rot-Z }

ACTI records
ACTI.PNAM   rgb    Marker ACTI.ATTX   lstring

ADDN records
ADDN.DATA   int    Node Index

ALCH records
ALCH.CUSD   formID ALCH.DATA   float    Weight ALCH.ENIT   struct { int Value; int Flags; formID Addiction; float Chance; formID Sound } ALCH.EFID   formID    Effect ALCH.EFIT   struct { float Magnitude; int Area; int Duration }

AMMO records
AMMO.DATA   int    Value AMMO.DNAM   struct { formID Projectile; int; int; int } AMMO.ONAM   lstring    Short Name AMMO.NAM1   zstring

AORU records
AORU.AOR2   struct { float; float; float; int }

ARMA records
ARMA.RNAM   formID    Race ARMA.MOD2   zstring ARMA.MOD3   zstring ARMA.MOD4   zstring ARMA.MOD5   zstring ARMA.MODL   formID ARMA.SNDD   formID ARMA.ONAM   formID

ARMO records
ARMO.EITM   formID    Enchantment ARMO.MOD2   zstring    Male Model ARMO.MOD4   zstring    Female Model ARMO.RNAM   formID    Race ARMO.INRD   formID ARMO.INDX   int    Index ARMO.MODL   formID    Model ARMO.DATA   struct { int Value; float Weight; int } ARMO.FNAM   struct { int Resistance; int } ARMO.DAMA   struct { formID Resist Type; int Resist Value} list ARMO.APPR   formIDlist

ASPC records
ASPC.SNAM   formID ASPC.BNAM   formID

AVIF records
Actor value

AVIF.ANAM   lstring

Actor value 000002de (MeeleeDamage) is missing in the .esm and only present in the executable.

BNDS records
BNDS.TNAM   formID    Texture

BOOK records
BOOK.DESC   lstring    Text BOOK.DATA   struct  { int Value; float Weight } BOOK.INAM   formID    Inventory Art
 * DATA</tt> With skill increasing books gone, this is now a simple value/weight (int/float) field, like used by many other item records.
 * FIMD</tt> formID Find Message Displayed (MESG)

BPTD records
BPTD.BPTN   lstring    Name

CAMS records
CAMS.MNAM   formID

CELL records
Values seen in record header flags:-

0x00000080 - unknown 0x00000400 - unknown - only set on 5 exterior cells 0x00020000 - unknown - only set on 0001fa25 CambridgePD01 'Cambridge Police Station' 0x00040000 - compressed data 0x00080000 - no wait - only set on 000016d8 Vault111Cryo 'Vault 111'

Fields

EDID   zstring     editor ID FULL    lstring     full name DATA   uint16      flags - as before VISI   int16       unknown PCMB   int16       unknown XCLL   struct      lighting info RVIS   formID XCLC   struct      { int X; int Y; in Flags } LTMP   formID      Lightning Template XCIM   formID      Imagespace XLCN   formID      Location XCMO   formID      Music Type XCAS   formID      Accoustic Space XEZN   formID      Encounter Zone XCLR   formIDlist  Regions XPRI   formIDlist

CLFM records
CLFM.CNAM   rgb    Color CLFM.FNAM   int    Playable

CMPO records
Crafting components internal, as opposed to the <tt>MISC</tt> items with the same name.

COBJ records
COCT/CNTO (components needed) got replaced by FVPA:

FVPA list { formID item; int number }

COBJ.CNAM   formID    Result COBJ.BNAM   formID    Bench COBJ.ANAM   formID COBJ.FNAM   formID    Filter

COLL records
COLL.BNAM   int    ID COLL.MNAM    zstring COLL.INTV   int    Count COLL.CNAM   formIDlist    Interactables

CONT records
CONT.COCT   int    Object Count CONT.CNTO   struct { formID Item; int Count } CONT.SNAM   formID    Open Sound CONT.QNAM   formID    Close Sound CONT.FTYP   formID

CPTH records
CPTH.ANAM   formIDlist CPTH.SNAM   formID    Camera

CSTY records
CSTY.CSRA   float CSTY.CSCV   float

DFOB records
Default object

DFOB.DATA   formID

Comments for some found in the executable:

DIAL records
DIAL.PNAM   float    Priority DIAL.QNAM   formID    Quest

DLBR records
DLBR.QNAM   formID    Quest DLBR.SNAM   formID    Start Dialogue

DLVW records
DLVW.QNAM   formID    Quest DLVW.BNAM   formID    Branch DLVW.ENAM   int DLVW.DNAM   int    Show All Text

DMGT records
Damage types

There are only eight of these

DOOR records
DOOR.SNAM   formID    Open Sound DOOR.ANAM   formID    Close Sound

ECZN records
DATA   struct { formID Owner; formID Location; int data }

Same as Skyrim, except new flag 0x08 which seems to only be set on the 30 settlement zones.

ENCH records
ENCH.EFID   formID    Effect

EQUP records
EQUP.PNAM   formIDlist    Parents EQUP.DATA   int    Use All Parents

FACT records
FACT.VENC   formID    Vendor Chest

FLOR records
FLOR.PRPS   struct { int; float } FLOR.PNAM   rgb FLOR.PFIG   formID FLOR.ATTX   lstring    Activate Text FLOR.SNAM   formID    Pickup Sound FLOR.PFPC   int Seasonal Harvest
 * ATTX lstring Activate Text (formerly RNAM)

FLST records
FLST.LNAM   formID

FURN records
FURN.XMRK   zstring    Marker

GLOB records
These are global variables, although many are used as constants, and don't change during the course of the game. A full dump of all global variables can be found here.


 * Integers


 * In instances where <tt>FNAM</tt> is <tt>'s'</tt> or <tt>'l'</tt>, the floating point value never has a fractional component, so is safe to cast to an integer value. All default values fit in a signed 16-bit integer.
 * Highest value is: <tt>00036e04 MS08_Dist_Extreme = 20000</tt>
 * Lowest value is: <tt>0004b1c8 CA_T5_Hatred = -1000</tt>


 * Floats


 * In instances where <tt>FNAM</tt> is <tt>'f'</tt>, or not specified, the floating point value sometimes has a fractional component, so is not safe to cast to an integer value.
 * Highest value is: <tt>00249d61 COMNickStrangerThresholdMax = 4000000</tt>
 * Lowest value is: <tt>0005611f CA_Event_Hates = -35</tt>
 * The default values never have more than three significant decimal places.
 * The only value with three significant decimal places is: <tt>001e8c92 ModScrapScalar_Quarter = 0.125</tt>


 * Count of records by <tt>FNAM</tt>

s        743 No value 515 f         40 l          1  (0003e0ce WorkshopCurrentWorkshopID - default value = 0)

IMAD records
IMAD.YNAM   struct

INFO records
Info records to voice file mapping: Voice files are found in Voices.ba2 (or Voices_xx.ba2 for non-English versions) under Sound/Voice/{esm Filename}/{VTYP edid}/{uppercase INFO formid}_{NAM1 field appearance number}.fuz. Special animations are mapped similar to .hkx files.

INFO.GNAM   formID INFO.NAM1   lstring    Text INFO.NAM2   zstring    Actor Note INFO.RNAM   lstring INFO.ANAM   formID    Speaker INFO.MODQ   formID

INGR records
There is only one record of this type, <tt>0001d7fc CopperPipe Copper Pipe</tt>, which doesn't appear to be referenced anywhere.

Can be added via console, appears under aid, one can "discover the restore health effect" consuming it. Displays 0 as value despite having value 31 in the DATA field, so autocalc for value is still in place. All the ALCH items using autocalc come out as 0 either way.

IPDS records
IPDS.PNAM   struct { formID; formID }

KYWD records
KYWD.DNAM   zstring    Description

LCTN records
LCTN.PNAM   formID    Parent LCTN.NAM1   formID    Music LCTN.MNAM   formID    Marker

LENS records
LENS.DNAM   zstring    Description LENS.FNAM   zstring

LSCR records
LSCR.NNAM   formID LSCR.TNAM   formID LSCR.ZNAM   struct { float; float }

LVLI records
Only the lower two bytes of Level and Number of LVLO are relevant, the high bytes seem to contain random noise (needs checking). Applies to LVLN.LVLO too.

LVLI.LVLD   int    Chance None LVLI.LVLM   int LVLI.LVLF   int    Flags LVLI.LVLG   formID LVLI.LLCT   int    Entries LVLI.LVLO   struct { int16 Level; int16 unknown; formID Item; int16 Number; int8 Chance none; int8 unknown } LVLI.LLKC   struct { formID; int } LVLI.ONAM   lstring LVLI.LVSG   formID

LVLN records
LVLN.LVLD   int    Chance None LVLN.LVLM   int LVLN.LVLF   int    Flags LVLN.LLCT   int    Entries LVLN.LVLO   struct { int Level; formID Item; int Number }

MATT records
MATT.MNAM   zstring MATT.CNAM   frgb MATT.ANAM   zstring

MESG records
MESG.TNAM   int    Display Time MESG.NNAM   lstring

MGEF records
MGEF.DNAM   lstring    Description

MISC records
MISC.DATA      struct  { int Value; float Weight } MISC.CVPA   list::8 { sint:4:1 a; formID:0 b } produces
 * <tt>CVPA</tt> List of (int; formID) entries - components produced by scrapping the item.
 * <tt>FIMD</tt> formID Find Message Displayed (MESG)

MSWP records
MSWP.BNAM   zstring MSWP.SNAM   zstring

NOTE records
Returns again, used for holotapes in FO4

EDID, OBND, PTRN, FULL, MODL, MODT as usual

YNAM, ZNAM formID Pickup/Drop Sound

DNAM byte type (1=Sound, 2=Game, 3=Text)

DATA (int, float) value/weight

SNAM formID Scene (Sound) or Terminal (Text)

PNAM zstring flash filename (Game)

NOTE.DATA   struct { int Value; float Weight } NOTE.SNAM   formID    Scene

NPC_ records
NPC_.STCP   formID NPC_.SNAM   struct { formID Faction; int } NPC_.VTCK   formID    Voice Type NPC_.TPLT   formID    Template NPC_.COCT   int    Inventory Count NPC_.CNTO   struct { formID Item; int Number } NPC_.PKID   formID    AI Package NPC_.CNAM   formID    Class NPC_.SHRT   lstring    Short Name NPC_.RNAM   formID    Race NPC_.PNAM   formID    Head Parts NPC_.HCLF   formID    Hair Color NPC_.SPCT   int NPC_.SPLO   formIDlist NPC_.WNAM   formID NPC_.ATKR   formID    Attack Race NPC_.ECOR   formID NPC_.PKTZ   int    Count NPC_.PRKR   struct { formID Perk; int Rank } NPC_.ZNAM   formID    Combat Style NPC_.NAM6   float NPC_.NAM4   float NPC_.DOFT   formID    Default Outfit NPC_.CRIF   formID    Crime Faction NPC_.FTST   formID    Face Texture NPC_.INAM   formID    Death Item NPC_.DPLT   formID NPC_.CSCR   formID

PRPS list (formID, float) Actorvalues

OMOD records
Internal mod object, as opposed to the associated MISC object

EDID, FULL, DESC, MODL, MODT as usual

DATA large struct with various sizes

MNAM formID (KYWD)

LNAM formID MISC object

OMOD.MNAM   formID OMOD.LNAM   formID

DATA field:


 * uint32 Count1
 * uint32 Count2
 * uint16 unknown
 * char[4]
 * uint16 unknown
 * formID KYWD
 * uint32 keyword_count
 * keyword_count times
 * formID KYWD
 * uint32 unknown
 * 7-byte struct Count1 times
 * formID OMOD
 * uint8[3] unknown
 * 24-byte struct Count2 times
 * uint32 value_types
 * uint32 function - 0=add, 1=mul, 2=set # mul adds its argument to the multiplier of a property (which starts out at 1)
 * uint32 property
 * uint32 value_1 - type depends on value_types: 0=int, 1=float, 2=bool, 3=?, 4=formID, 5=int, 6=formID
 * uint32 value_2 - type depends on value_types: 0-2=none, 3=?, 4=int, 5=none, 6=float
 * uint32 unknown

OTFT records
OTFT.INAM   formIDlist

PERK records
PERK.SNAM   formID    Sound PERK.NNAM   formID PERK.FNAM   zstring

PMIS records
Placed Missile - so far only one record in WRLD

NAME formID Base Object : PROJ MissileProjectile (000caba4)

DATA float[] - x/y/z position, x/y/z rotation

QUST records
N.B. This table is currently incomplete.

QUST.LNAM   formID    Location QUST.XNAM   formID    XP QUST.FLTR    zstring QUST.NNAM   lstring QUST.INDX   int    Index QUST.QSDT   int    Flags QUST.QOBJ   int    Objective QUST.NAM2   zstring    Comment QUST.ALST   int QUST.ALID   zstring    Alias ID QUST.ALCO    formID QUST.ALUA   formID    Alias QUST.ALPC   formID    Package QUST.GNAM   formID

RACE records
RACE.SPLO   formID RACE.WNAM   formID    Skin RACE.ANAM   zstring RACE.VTCK   struct { formID Male Voice; formID Female Voice } RACE.HCLF   struct { formID Male Hair Color; formID Female Hair Color } RACE.TINL   int Tints RACE.NAME   zstring RACE.QNAM   formID Equip Slot RACE.UNWP   formID Unarmed Weapon RACE.INDX   int Index RACE.HEAD   formID RACE.BSMB   zstring

REFR records
REFR.NAME   formID    Base Object REFR.TNAM   int    Map Marker REFR.XRFG   formID REFR.XEMI   formID REFR.XLKR   struct { formID; formID } REFR.XESP   struct [ formID Enable Parent; int Flags } REFR.XLYR   formID REFR.XRDS   float REFR.XSCL   float REFR.XOWN   struct { formID; int; int } REFR.XMSP   formID REFR.XNDP   struct { formID; int } REFR.XLRT   formID REFR.DATA   struct { float X; float Y; float Z; float rot-X; float rot-Y; float rot-Z } REFR.XLIB   formID

REGN records
REGN.RCLR   rgb REGN.WNAM   formID    World REGN.RDWT   struct { formID Weather; int Chance; int }

RFGP records
RFGP.NNAM   zstring RFGP.RNAM   formID

SCEN records
SCEN.DATA   formID    Dialogue SCEN.DMAX   formID SCEN.PNAM   formID    Quest

SCOL records
SCOL.FLTR   zstring SCOL.ONAM   formID

SMBN records
SMBN.PNAM   formID SMBN.SNAM   formID

SMQN records
SMQN.PNAM   formID SMQN.SNAM   formID SMQN.NNAM   formID

SNCT records
SNCT.PNAM   formID SNCT.ONAM   formID SNCT.MNAM   float

SNDR records
SNDR.GNAM   formID SNDR.ANAM   zstring SNDR.ONAM   formID

SOPM records
SOPM.ENAM   formID

SPEL records
SPEL.ETYP   formID    Equip Slot SPEL.EFID   formID    Effect

TERM records
TERM.WNAM   lstring TERM.ITXT   lstring TERM.RNAM   lstring TERM.TNAM   formID TERM.UNAM   lstring

TREE records
There is only one record of this type in the data, <tt>00004d13 TestCloth02</tt>, and it doesn't appear to be referenced anywhere.

WEAP records
The only required fields seem to be: EDID, OBND, DESC, DNAM, and CRDT - all other fields are optional

EDID   zstring     as usual VMAD   ? optional OBND   struct      as usual PTRN   formID      optional FULL   lstring     base weapon name MODL   zstring MODT   ? DEST   ? DSTD   ? DSTF   ? EITM   formID      enchantment EAMT   ? ETYP   formID      Equip Type BIDS   formID      block impact data set BAMT   formID      Blocking Material - points to MATT YNAM   formID      pickup sound ZNAM   formID      drop sound KSIZ   uint32      keyword count? KWDA   formIDlist  keywords DESC   lstring     always exists, and always zero, except for 000e98e5 DN102_FrenzyGrenade 'HalluciGen Gas Grenade', which has... 'Chance to Frenzy targets for 60 seconds.' ...which is presumably the text displayed in the chem station when crafting INRD   formID      points to INNR APPR   formIDlist

OBTE   int         count of following sections which seem to be weapon variants

> OBTF (zero length) - presumably just indicates start of section, but doesn't always exist > FULL lstring      - variant name - doesn't always exist > OBTS struct       - some additional variant data - always exists

STOP   (zero length) end of variants

MOD4   zstring MO4T   ? NNAM   formID      points to OMOD DNAM   struct      see below FNAM   ? CRDT   struct      { float; float; formID } critical data? INAM   formID      impact data set - pointer to IPDS MASE   uint32      melee_attack_speed, 0=Very Slow, 1=Slow, 2=Medium, 3=Fast, 4=Very Fast, defaults to Medium LNAM   formID      LVLI list for ammunition that gets automatically added (NPC inventory, player.additem) WAMD   formID      weapon aim model - pointer to AMDL WZMD   formID      weapon zoom model - pointer to ZOOM DAMA   struct      (FormID damage_type (DMGT record), uint32 damage_amount) - additional damage

DNAM struct
 * Now 132 bytes instead of 100
 * Appears that DATA field has been merged into this
 * Most values can be changed by weapon mods, including the default mod
 * Values can now be "misaligned", byte offsets are:-
 * 0: formID Ammunition used
 * 4: float fire speed (according to FO4Edit)
 * 8: float reload anim speed (according to FO4Edit)
 * 12: float melee reach?
 * 16: float
 * 20: float
 * 24: float attack delay (according to FO4Edit)
 * 28: uint32 always zero
 * 32: float
 * 36: uint32 always one of (0, 1, 2, 3)
 * 40: uint32 always zero
 * 44: uint32 always zero
 * 48: uint32 maybe flags
 * 52: uint16 default clip size - this value is modified by attached magazine mod
 * 54: uint8 weapon type, 0=unarmed, 1=melee 1H, 5=melee 2H, 9=gun, 10=grenade, 11=mine
 * 55: float bash damage, ingnored if not a gun
 * 59: float Weight
 * 63: int32 base value in caps - odd values seen for Mr Handy and Mr Gutsy weapons for some unknown reason
 * 67: uint16 ballistic damage - other damage types are in DAMA field
 * 69: uint32
 * 73: formID swing sound effect?
 * 77: uint32 always zero
 * 81: uint32 always zero
 * 85: formID dry fire sound effect?
 * 89: formID charge sound effect?
 * 93: formID equip up sound effect?
 * 97: formID equip down sound effect?
 * 101: formID equip fast sound effect?
 * 105: uint8
 * 106: float
 * 110: uint16 always zero
 * 112: float AP
 * 116: float
 * 120: float
 * 124: uint32
 * 128: int8 always -1
 * 129: int8 always -1
 * 130: uint8 always 127
 * 131: uint8 always 127

WRLD records
WRLD.XLCN   formID    Location WRLD.CNAM   formID    Climate WRLD.NAM2   formID WRLD.NAM3   formID WRLD.NAMA   float    Distant LOD Multiplier WRLD.ZNAM   formID    Music WRLD.XWEM   zstring    Water Environment

WTHR records
WTHR.TNAM   formID    Sky Static

Common field types
EDID   zstring ID FULL    lstring Name DESC   lstring    Description

KSIZ   int     number of Keywords KWDA   formIDlist      Keywords

MODL   zstring MODS   formID YNAM   formID    Pickup Sound ZNAM   formID    Drop Sound

DEST   struct    { int Health; int Count } DSTD   struct    { int; int; formID; formID; int } DMDL   zstring

CIS1   zstring CIS2   zstring

OBND field
Object bounds.

This is a 12-byte struct with the following format.

OBTS field
Used in ARMO, FURN, NPC_ and WEAP


 * uint32 Count1
 * uint32 Count2
 * int16[3] unknown
 * uint16 flags
 * if (flags & 0x0100) formID KYWD
 * uint16 unknown
 * 7-byte struct Count1 times
 * formID OMOD
 * uint8[3] unknown
 * 24-byte struct Count2 times
 * uint32[3] unknown
 * formID MSWP
 * uint32[2] unknown

PTRN field
formID (TRNS)