Skyrim Mod talk:Mod File Format
Contents
Pre-Release Notes[edit]
The working assumption at the moment is that Skyrim will use a mod file format similar to that used by Oblivion. However, various changes introduced for Fallout 3 are likely to be incorporated into Skyrim, too. The best documentation of the Fallout3.esm format that I can find is here.
Key differences that I've noted with Fallout3 are:
- The headers for both records and groups (but not subrecords) are 4 bytes longer than in Oblivion (24 bytes total instead of 20). The extra 4 bytes is assumed to be flags, but the meaning of the flags does not appear to be known.
- This is the only change that was made to the fundamental structure of the file -- GRUPs, records, and subrecords are used in the exact same way; XXXX subrecords are used for oversized subrecord lengths; compressed subrecords exist and are identified with the same flag.
- References to magical effects use the effect's refID instead of the EDID, making magical effects more consistent with all other references. The data is still stored as 4 bytes, but the 4 bytes are an integer instead of a string such as 'FIDG'.
- There are no SKIL records in Fallout3 -- AVIF (Actor Value Info) records are used instead.
- Skill perk information is in PERK records.
Of course, there are also differences in various details of the individual subrecords -- although fewer than might be expected.
--NepheleTalk 04:59, 6 October 2011 (UTC)
- In case anyone's interested, here's a breakdown of the different types of record used by Fallout3.
- I agree that the new field in each record's header is almost certainly flags. The number of records with bits 0, 1, 2 and 3 set is huge - about 75% of them. Bits 4-15 are only set in a tiny fraction - roughly 0.5%. There's another large group with the first few bits of the upper 16 bits set too. rpeh •T•C•E• 07:11, 8 October 2011 (UTC)
-
Record Type Fo3 Count Data Object F:NV Count ACHR 2154 Placed NPC 3386 ACRE 3349 Placed Creature 2999 ACTI 774 Activator 1143 ADDN 37 Particle Effect 37 ALCH 71 Potion/Medicine 189 ALOC Media Location Controller 89 AMEF Ammo Effects 54 AMMO 30 Ammunition 92 ANIO 101 Animated Object 152 ARMA 92 Armor Components 131 ARMO 237 Armor 389 ASPC 59 Space-related sound effects (reverb, etc.)? 113 AVIF 60 Actor value information 64 BOOK 26 Books 27 BPTD 32 Body part data 49 CAMS 229 Cameras 276 CCRD Cards 270 CDCK Decks of Cards 13 CELL 42410 Cell 30497 CHAL Challenges 105 CHIP Gambling Chips 5 CLAS 53 Class 74 CLMT 18 Climate 31 CMNY Caravan Money 6 CONT 535 Container 2478 CPTH 307 More cameras? 418 CREA 533 Creature 1578 CSNO Casino 5 CSTY 48 Combat style 84 DEBR 6 Debris 6 DEHY Dehydration level (Hardcore mode) 5 DIAL 6381 Dialog topic 18215 DOBJ 1 Default Object Manager 1 DOOR 319 Door 320 ECZN 129 Encounter zone 17 EFSH 28 Effect shader 35 ENCH 89 Enchantment 145 EXPL 78 Explosion 154 EYES 8 Eyes 12 FACT 326 Faction 682 FLST 243 Form ID List (non-leveled level list?) 464 FURN 183 Furniture 234 GLOB 155 Global 218 GMST 530 Game setting 648 GRAS 9 Grass 24 GRUP 89748 Group 77000 HAIR 67 Hair 67 HDPT 61 Head part 61 HUNG Hunger level (Hardcore mode) 5 IDLE 1247 Idle Animations 1597 IDLM 122 Idle Markers 211 IMAD 112 Imagespace Modifier 215 IMGS 48 Image Space 67 IMOD Item Mods 50 INFO 22327 Dialog Response 23247 INGR 1 Ingredient 1 IPCT 102 Impacts 125 IPDS 41 Impact Data Set 60 KEYM 160 Key 283 LAND 40256 Land 29363* LGTM 19 Lighting Template? 31 LIGH 368 Light 501 LSCR 150 Load Screen 208 LSCT Load Screen Type 1 LTEX 51 Land Texture 89 LVLC 60 Leveled creature 343 LVLI 972 Leveled item 2738 LVLN 89 Leveled NPC 365 MESG 518 Game Messages 1144 MGEF 163 Magic Effect 289 MICN 2 Menu icon 12 MISC 237 Misc. Item 507 MSET Media Set 140 MSTT 238 Movable Statics 241 MUSC 31 Music 20 NAVI 1 1 NAVM 7198 Nav Meshes? 4771 NOTE 840 Notes 894 NPC_ 1647 NPC 3816 PACK 3266 AI Package 4163 PERK 87 Skill perks 176 PGRE 350 174 PROJ 52 Projectile 95 PWAT 56 Water 29 QUST 192 Quest 436 RACE 22 Race 22 RADS 5 Radiation Stage 5 RCCT Recipe Category 10 RCPE Recipe 105 REFR 568107 Placed Object 307710 REGN 139 Region 276 REPU Reputation? 13 RGDL 23 Ragdoll 38 SCOL 54 Static Collection 98 SCPT 1257 Script 2576 SLPD Sleep Deprivation (Hardcode more) 5 SOUN 1583 Sound 3190 SPEL 160 Spell 270 STAT 5803 Static 6785 TACT 49 Talking Activator 87 TERM 378 Terminal 344 TES4 1 Tes4 Header 1 TREE 9 Tree 3 TXST 244 Texture 493 VTYP 75 Voice Type 100 WATR 53 Water Type 78 WEAP 160 Weapon 261 WRLD 32 Worldspace 14 WTHR 27 Weather 63
- * Probably more than this but my code crashed
-
-
- Updated with information from TES5Edit/fopdoc as of 2 Jun 2014 documents the FO3, FNV, and FO4 plugin file formats known to the xEdit team. Only FO3 & FNV records edited.
- Dubious (talk) 06:26, 23 April 2017 (UTC)
-
-
-
-
Record Type Fo3 Count Data Object F:NV Count ACHR 2154 Placed NPC 3386 ACRE 3349 Placed Creature 2999 ACTI 774 Activator 1143 ADDN 37 Addon Node/Particle Effect 37 ALCH 71 Ingestible Potion/Medicine (Alchemy) 189 ALOC Media Location Controller 89 AMEF Ammo Effects 54 AMMO 30 Ammunition 92 ANIO 101 Animated Object 152 ARMA 92 Armor Components (Addon) 131 ARMO 237 Armor 389 ASPC 59 Acoustic Space (sound effects: reverb, etc.) 113 AVIF 60 Actor value information 64 BOOK 26 Books 27 BPTD 32 Body part data 49 CAMS 229 Cameras 276 CCRD Cards (Caravan) 270 CDCK Decks of Cards (Caravan) 13 CELL 42410 Cell (Area) 30497 CHAL Challenges 105 CHIP Gambling Chips 5 CLAS 53 Class 74 CLMT 18 Climate 31 CMNY Caravan Money 6 CONT 535 Container 2478 CPTH 307 Camera Path 418 CREA 533 Creature 1578 CSNO Casino 5 CSTY 48 Combat style 84 DEBR 6 Debris 6 DEHY Dehydration level (Hardcore mode) 5 DIAL 6381 Dialog topic 18215 DOBJ 1 Default Object Manager 1 DOOR 319 Door 320 ECZN 129 Encounter zone 17 EFSH 28 Effect shader 35 ENCH 89 Enchantment 145 EXPL 78 Explosion 154 EYES 8 Eyes 12 FACT 326 Faction 682 FLST 243 Form ID List 464 FURN 183 Furniture 234 GLOB 155 Global 218 GMST 530 Game setting 648 GRAS 9 Grass 24 GRUP 89748 Group 77000 HAIR 67 Hair 67 HDPT 61 Head part 61 HUNG Hunger level (Hardcore mode) 5 IDLE 1247 Idle Animations 1597 IDLM 122 Idle Markers 211 IMAD 112 Image Space Adapter 215 IMGS 48 Image Space 67 IMOD Item Mods 50 INFO 22327 Dialog Response 23247 INGR 1 Ingredient 1 IPCT 102 Impacts 125 IPDS 41 Impact Data Set 60 KEYM 160 Key 283 LAND 40256 Land 29363* LGTM 19 Lighting Template 31 LIGH 368 Light 501 LSCR 150 Load Screen 208 LSCT Load Screen Type 1 LTEX 51 Land Texture 89 LVLC 60 Leveled creature 343 LVLI 972 Leveled item 2738 LVLN 89 Leveled NPC 365 MAPM Map Marker ? MESG 518 Message 1144 MGEF 163 Magic Effect 289 MICN 2 Menu icon 12 MISC 237 Misc. Item 507 MSET Media Set 140 MSTT 238 Movable Static 241 MUSC 31 Music 20 NAVI 1 Navigation Mesh Info Map 1 NAVM 7198 Navigation Mesh 4771 NOTE 840 Note 894 NPC_ 1647 NPC 3816 PACK 3266 AI Package 4163 PERK 87 Skill perks 176 PGRE 350 Placed Grenade 174 PMIS Placed Missile ? PROJ 52 Projectile 95 PWAT 56 Placeable Water 29 QUST 192 Quest 436 RACE 22 Race 22 RADS 5 Radiation Stage 5 RCCT Recipe Category (Collection) 10 RCPE Recipe 105 REFR 568107 Placed Object Reference 307710 REGN 139 Region 276 REPU Reputation? 13 RGDL 23 Ragdoll 38 SCOL 54 Static Collection 98 SCPT 1257 Script 2576 SLPD Sleep Deprivation Stage (Hardcode more) 5 SOUN 1583 Sound 3190 SPEL 160 Spell (Actor Effect) 270 STAT 5803 Static 6785 TACT 49 Talking Activator 87 TERM 378 Terminal 344 TES4 1 Tes4 Header 1 TREE 9 Tree 3 TXST 244 Texture 493 VTYP 75 Voice Type 100 WATR 53 Water 78 WEAP 160 Weapon 261 WRLD 32 Worldspace 14 WTHR 27 Weather 63
-
-
Page name[edit]
This is me just nitpicking, but would it not be better to have the page (and sub-pages) named 'Plugin File Format' rather than 'Mod File Format'? Seems more appropriate. —Rick 05:28, 10 November 2011 (UTC)
- It might be good to have a redirect from Plugin File Format to here, but I'm not sure about actually renaming the page. Although I suppose I don't feel too strongly either way. --NepheleTalk 05:43, 10 November 2011 (UTC)
- I figured I would bring it up before the pages started being created and getting fleshed out. —Rick 05:54, 10 November 2011 (UTC)
General Skyrim Changes[edit]
Just wanted to make some quick notes about some key things that are different processing Skyrim data.
- Strings, which have already been covered elsewhere.
- Keywords
- Used for a lot of flags/type information (e.g. weapon types all tracked via 'WeapType%' keywords; armor types tracked via 'ArmorHeavy'/'ArmorLight')
- Keywords themselves are in rectype KYWD
- Vast majority of rectypes contain KSIZ and KWDA subrecords. KSIZ is the number of keywords. KWDA is then 4*KSIZ bytes in size, containing KSIZ formids pointing to KYWD records.
- All creature-related information has been wiped out. No CREA, ACRE, LVLC rectypes exist. Instead there are now 99 races -- including Wolf, Fox, Giant, Wisp, Draugr etc.
- No CLOT records any more. All included in ARMO, with ArmorClothing and ArmorJewelry keywords (generally) identifying the non-armor items.
--NepheleTalk 07:31, 11 November 2011 (UTC)
Record->Form[edit]
Sorry about not discussing it, but I was attempting to clean the page up to use official terminology (they're called forms by the game engine). —Rick 06:09, 13 November 2011 (UTC)
- Yeah, I realized with the FormID that we've got somewhat of an inconsistency there. But at first I had no idea what the page was talking about with forms, so I'm guessing other readers might have the same issue. --NepheleTalk 07:56, 13 November 2011 (UTC)
- No problem with having it as record for clarity then. —Rick 08:34, 13 November 2011 (UTC)
Code[edit]
I'm extending CBash 0.6 for Skyrim support, could serve as reference-implementation.
12 mystery record types[edit]
Thes were in the main record type table. No grup, no records, maybe these came from FO3/FONV?
- NOTE - Note
- PCON -
- PARW -
- PBAR -
- PBEA -
- PFLA -
- PMIS - Placed missile
- SKIL - Skill
- TLOD -
- TOFT -
- MICN - Menu Icon — Unsigned comment by Themendios (talk • contribs)
oh they came from here: http://www.uesp.net/wiki/Tes5Mod:Forms/1.1.21.0
well since this is the mod file format and they're not in mod files i assume there's no objections? if not then i'll just delete this note in a couple days —Themendios 16:48, 27 December 2011 (UTC)
Stamp Property[edit]
As near as I can determine, the stamp property isn't in MS-DOS format as I understand it (e.g. [1]). Suspiciously, the first of the four bytes in the sequence has a range of 1 to 30 in Skyrim.esm, the second and third bytes seem to have a very narrow range of values, and the last byte is always 0. Does anybody else have any thoughts on this? For reference, I've posted the full list of stamp data from the top-level groups below.
0C 4B 0A 00 19 4A 23 00 0A 4B 0E 00 19 4B 0E 00 11 3D 02 00 03 3D 02 00 07 4C 2B 00 03 3D 02 00 18 51 03 00 1D 4C 08 00 0D 3F 03 00 03 3D 02 00 12 4A 27 00 0A 4F 27 00 04 4A 20 00 18 4A 1D 00 11 3D 02 00 12 4A 20 00 04 4A 20 00 10 5D 2B 00 18 4A 0C 00 1C 4F 3C 00 1A 42 03 00 15 4C 2F 00 11 3D 02 00 03 3D 02 00 01 4C 2F 00 04 4A 02 00 03 3D 02 00 0E 52 2B 00 03 3D 02 00 02 4F 30 00 0B 4B 25 00 14 50 4B 00 11 3D 02 00 01 4C 0A 00 02 5C 0A 00 15 4C 2F 00 07 3E 02 00 03 3D 02 00 0E 4D 2B 00 03 3D 02 00 16 4F 38 00 01 4C 2F 00 03 3D 02 00 05 4E 11 00 0D 53 23 00 0D 4A 25 00 12 53 25 00 18 57 2B 00 1E 4C 23 00 03 3D 02 00 03 3D 02 00 1C 51 22 00 18 57 23 00 12 4A 27 00 0D 4B 02 00 03 3D 02 00 03 3D 02 00 18 4B 0E 00 18 4A 1D 00 19 45 09 00 19 45 09 00 03 3D 02 00 18 4F 2B 00 1D 51 2B 00 1B 55 2C 00 03 3D 02 00 11 4B 25 00 14 4A 25 00 1D 58 4B 00 03 3D 02 00 03 3D 02 00 08 46 09 00 10 56 2B 00 03 3D 02 00 0E 4F 25 00 1B 4D 2B 00 0C 4E 0C 00 03 3D 02 00 03 3D 02 00 05 4B 0E 00 1A 4A 0B 00 1A 4A 0B 00 05 48 0C 00 03 3D 02 00 12 4A 1C 00 19 4A 23 00 02 53 0F 00 03 3D 02 00 09 52 36 00 1C 4C 0B 00 1A 4A 0B 00 1A 4A 0B 00 1A 4B 0E 00 1A 4B 0E 00 1A 4B 0E 00 0F 4C 23 00 1C 4C 0B 00 0D 4D 23 00 1C 4D 2B 00 1C 4D 2B 00 01 4E 29 00 1B 4D 23 00 04 4E 23 00 0F 4E 23 00 17 4E 23 00 14 4F 25 00 0A 50 25 00 14 52 13 00 10 53 25 00 16 55 27 00 03 56 25 00 10 56 0B 00 1C 5B 27 00 0D 5C 0F 00 1D 5D 03 00 01 02 27 00
At a cursory glance of Oblivion.esm, the dates in TES 4 also don't look to be MS-DOS format, so either I have a different understanding of what MS-DOS formatted dates are, or we'll need to correct the information there as well once we figure it out. – Robin Hood↝talk 21:21, 29 March 2012 (UTC)
- Poking around some more, I found the Revision format, and that seems like a more likely bet for the stamp format. Using that, I get dates ranging from January 17, 2008 to September 29, 2010 in Skyrim.esm (with the exception of the very last GRUP record, which is February 1, 2003), and October 12, 2011 to February 9, 2012 in Update.esm. – Robin Hood↝talk 21:54, 29 March 2012 (UTC)
-
- Okay, this almost certainly is the same format as the revision, and it looks like we've got it wrong on Oblivion. As I've stated in the article, the high byte of the 16-bit value is the number of months since December 2002, not the complicated thing we have currently in Tes4Mod. I seem to be having some oddness with testing this in Oblivion right now, though, as everything is reverting to month 03. All the old stuff I have saved, though, the calculated date matches (or at least is similar to) the last release date of the mod. Same with all the Skyrim mods I tested. I'm assuming the other 16 bits is the check-out log, like in Oblivion, but I have no way of confirming that. – Robin Hood↝talk 00:40, 30 March 2012 (UTC)
Character encoding[edit]
Just want to note here that based on inspections of Japanese ESP files, the game seems to use UTF-8 for strings, with a null terminating byte. DavidJCobb (talk) 20:19, 22 August 2018 (UTC)