Skyrim Mod talk:Mod File Format

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

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 •TCE 07:11, 8 October 2011 (UTC)
* Probably more than this but my code crashed
If anyone has got updated .NET code for ZLib 1.2.5 I'd love to have it. I'm on the old 1.0.4 version and I think that's why things stopped working part way through Fallout:New Vegas' import. rpeh •TCE 12:30, 11 October 2011 (UTC)
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)

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 (talkcontribs)

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.

Stamp Value
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 Hoodtalk 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 Hoodtalk 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 Hoodtalk 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)