Tes4Mod:Save File Format/NPC

This page describes the save file format for both NPC_ and CREA change records, since the two records share an identical format.  An NPC_ Change Record (change record type 35) describes changes to the game's non-player characters (NPC_ mod file records) -- and also to the player's character (in the NPC_ change record for formid 0x00000007).  A CREA Change Record (change record type 36) describes changes to the game's creatures (CREA mod file records).

Values specified an NPC_ or CREA record affect all instances of that actor.  Values specific to a single instance of the actor are provided in the appropriate ACHR or ACRE record.  The majority of the player character information is detailed in the ACHR change record for formid 0x00000014, instead of in the NPC_ change record.

The following table summarizes the subrecords that have been found in NPC_ and CREA records:


The relative positions of the subrecords have all been confirmed; their contents (as far as they are understood) are based on actual save files.

 

Base Attributes
The Base Attributes subrecord is present when bit 3 (0x00000008) is set in a CREA/NPC_ change record's overall Flags.  Its length is a constant 8 bytes.  Each byte provides the base value (without fortifications or damage) of one basic attribute.  The attributes are listed in order of their standard index.  Unlike Morrowind save files, for the player character these are the attributes at the current level.



Base Data
The Base Data subrecord is present when bit 4 (0x00000010) is set in a CREA/NPC_ change record's overall Flags.  Its length is a constant 16 bytes, and its format follows that of the mod file NPC_ ACBS subrecord.


|-

| baseMagicka
| ushort
| Base magicka

For the player character, this is the magicka at 0 intelligence (i.e., the sum of the player's racial or birthsign Fortify Magicka bonuses).  The player's actual base magicka is dynamically calculated from (baseMagicka + 2*Intelligence).  Presumably this is to ensure that Fortify Intelligence and Damage Intelligence effects always alter the player's magicka.  On the other hand, an NPC's magicka is unaffected by Intelligence changes.
|-

| baseFatigue
| ushort
| Base fatigue

For the player character, this value is zero because fatigue is dynamically calculated from (Endurance + Strength + Agility + Willpower).  As with magicka, this is presumably to ensure that Fortify/Damage Attribute effects alter fatigue, whereas an NPC's fatigue is impervious to such effects.
|-

| barterGold
| ushort
| 
|-

| level
| short
| Level (non-autocalc NPCs) or offset relative to player's level (autocalc NPCs)
|-

| calcMin
| ushort
| Minimum auto-calculated level.
|-

| calcMax
| ushort
| Maximum auto-calculated level.
|}

Factions
The Factions subrecord is present when bit 6 (0x00000040) is set in a CREA/NPC_ change record's overall Flags.  Its length is variable, but the parameters controlling its length are well-understood.  The subrecord lists the NPC or creature's faction memberships, and rank within those factions.



Spell List
The Spell List subrecord is present when bit 5 (0x00000020) is set in a CREA/NPC_ change record's overall Flags.  Its length is variable, but the parameters controlling its length are well-understood.  The subrecord lists the spells known by the NPC or creature.



AI Data
The AI Data subrecord is present when bit 8 (0x00000100) is set in a CREA/NPC_ change record's overall Flags.  Its length is a constant 4 bytes.  The meaning of the data contained in the AI Data subrecord is unknown, however, the observed values are consistent with 4 separate ubyte variables, each of which is set to a multiple of 5 (e.g., 5,100,80,80).



Base Health
The Base Health subrecord is present when bit 2 (0x00000004) is set in a CREA/NPC_ change record's overall Flags.  Its length is a constant 4 bytes, and it provides the NPC or creature's base health.



Base Modifiers
The Base Modifiers subrecord is present when bit 28 (0x10000000) is set in a CREA/NPC_ change record's overall Flags.  Its length is variable, but the parameters controlling its length are well-understood.  This subrecord is used to record changes to miscellaneous actor attributes.

Interpretation of the subrecord is based on a limited number of samples, but seems reasonable.  For example, index 45 (Blindness) is set to 100 for the Blind Moth Priests and Dredhwen; index 69 (Vampirism) is set to 100 for known vampires (except Jakben and Janus Hassildor, for whom the value is 25 and 50, respectively).  For the player, this section contains any racial modifiers (e.g., resist disease 75%).  Indices in the ranges 0-8 and 12-32 have not been seen, presumably because the Base Attributes and Skills subrecords are used for such data.  



Full Name
The Full Name subrecord is present when bit 7 (0x00000080) is set in a CREA/NPC_ change record's overall Flags. It contains a variable-length string, providing the new name of the NPC or creature.

Note that CELL change records can also contain a "Full Name" subrecord with the same contents, but in CELL records, its presence is triggered by bit 4, not bit 7.



Skills
The Skills subrecord is present when bit 9 (0x00000200) is set in a CREA/NPC_ record's overall Flags.  Its length is a constant 21 bytes.  Each byte provides the base value of one skill.  The skills are listed in order of their standard index.



Combat Style
The Skills subrecord is present when bit 10 (0x00000400) is set in a CREA/NPC_ record's overall Flags.  Its length is a constant 4 bytes, and it provides information on the actor's current combat style.