Modding tutorials 1 – Introduction to files

1. What is modding?

Modding is a process where you alter the game data to do something differently. This can be as simple as changing textures of the game world. In deeper levels it goes in to altering scripts for the game, or adding completely new scripts and functions.

When you are modifying games from Bethesda Game Studios, modding is usually done with various forms of plugins and archives. These plugins and archives are loaded by the game and their effects in your game is controlled by two main factors.

  1. Load order: the order of records loaded by your plugin order and sorting rules.
  2. Resource priorities: the order of resources being loaded by your game. Resource priorities are associated with load order, but do not entirely depend on it.

This tutorial series will cover these factors in greater detail later on. In this chapter we shall take a quick look at what these files and factors actually are.

2. Understanding files and extensions

In this chapter we will take a look at where to find your files and what they are. We will also discuss about two important technical details of flags and form versions.

2.1 Locating Data folder

First thing to know is where to find your official files. All of them are installed in to your game Data folder. The default installation location of your games installed from Steam is:
C:\Program Files (x86)\Steam\steamapps\common\<GameName>

The installation locations for games can be changed from Steam settings. If you do not know where your game Data folder is, then it is easy to locate with Steam client.

  1. Go to Steam library view
  2. Right click the game
  3. Select: Properties > Local Files > Browse Local Files
Locating game folder from Steam client

You now have access to your game root folder. Open Data folder to open the location for game plugin and archive files. Note that modern mod managers like Mod Organizer 2 and Vortex do not actually install files in to Data folder. Mod Organizer 2 uses virtual Data folder system. Vortex uses hard links. Both mod managers will be covered in their own tutorials.

Workshop systems, like Steam Workshop for 32bit Skyrim and Bethesda’s own modding platform for Skyrim Special Edition and Fallout 4 will install their files in to Data folder. All Creation Club files are also installed directly in to your Data folder.

2.2 File Extensions

These are the files that appear in your game folder. They are official file formats. You may find other files from your game and mod folders as well. They are categorized among loose files.

  • Hard plugins
    .esm and .esp. These files count against your load order plugin limit.
  • Light master
    .esl file. This file type does not count against your load order plugin limit.
  • Archives
    .bsa or .ba2 files. These are being loaded by esm, esp or esl-files. They do not count against your load order plugin limit. Respective .esm or .esp files loading archives will count against the load order plugin limit.
  • Loose files
    Files that are shared outside of archives and without respective plugins to load them. They do not count against your load order plugin limit.

2.3 Plugin limit

The traditional plugin cap for Creation Engine games has been 255. This does not mean that player actually has that many slots for their mod files. Also, introduction of ESL has reduced the count by one, due to FE slot being reserved for it.

  • Skyrim (32bit) has 253 plugins as a base, because index position 0 is reserved for Skyrim.esm and index 1 for Update.esm. If you have all DLCs, then the actual amount of mods you can install is 250. 32bit Skyrim does not have index position for esl files, game does not recognize or load them.
  • Skyrim Special Edition (64bit) comes with all DLCs. Esl claims the index position FE, leaving player with 249 available slots for hard plugin files.
  • Fallout 4 has 253 plugin limit, due to Fallout4.esm claiming index position 0 and esl claiming the index position FE. If you have all six DLCs, then that will leave you with 247 available slots for hard plugin files.

Note that while esl requires one index slot from your plugins, it allows up to 4096 limited files existing in your game, without them claiming index positions from your esm and esp files.

2.4 Flags

I will use the word “flag” few times in this article. This matter belongs to more advanced modding practices, but it is good to understand basics of this from the start.

Flag is header information in the plugin file, which tells the game how to treat that file. Flags also tell the game in which block it should load the file in load order.

Usually flag matches file extension, but this is not always the case. Sometimes mod file may have different flag than it’s extension is.

Most notable examples are Unofficial Patches for Skyrim, Skyrim Special Edition and Fallout 4. These patches are using .esp extension, but they are flagged as ESMs and load right after official game play files, instead of being loaded after all ESM flagged mod files.

At top: Official DLC with esm extension and ESM Flag. At bottom: mod plugin with esp extension, but with ESM flag. Tool used: xEdit.

My goal is to keep the first series of articles easy to follow and understand, so we will not delve any deeper in to flags at this point. This information is presented here just to give an insight of what these often mentioned flags are.

It is good for mod users to understand right from the start that mods and load orders have more factors in place than file extensions and records in mod plugin files. Flags are one of those factors, but mod users themselves do not really have to deal with them. Right now it is enough just to understand that they exist and affect on how mod files are being treated by your game and tools you are using.

2.5 Plugin Form versions

The same header information above displays the Form Version of the plugin. This means the version of game record structure, which also includes record formats it understands.

This information is especially important for Skyrim Special Edition players. Old form 43 plugins from 32bit Skyrim do not follow the same record structure than Special Edition does. This is why you should not install plugins to game that does not follow the respective record structure.

Form versions:

  • Skyrim (32bit) the version is 43
  • Skyrim Special Edition the version is 44
  • Fallout 4 the version is 131

3. Short explanation of file extensions

In this section we are taking a look of what these file extensions are and how they relate to each other. This is a short explanation, so that you understand what these files are and how they behave. We will delve deeper in to matters of load order management in further chapters of this series.

3.1 esm

Esm stands for Elder Scrolls Master. It is the main file type for Creation Engine games. They are standalone files, which do not need to rely on other files to load. However, all added esm-files still need to load the main esm-file to function correctly, like Skyrim.esm or Fallout4.esm. All official DLC-files also come as esm-files.

Esm-files include the main data for the gameplay. Groups, keywords and similar control information is included to these files and can be used by files lower in the hierarchy. Mods can also be esm-files, when they add new systems and definitions for the game.

Esm-files can be associated to one or more bsa or ba2 files.

3.2 esp

Esp stands for Elder Scrolls Plugin. Each esp-file relies on at least one esm-file to load. Esp are usually more simple files than esm. They mostly deal with custom records based on esm-files they use as masters, or exist to load resources from bsa or ba2 files.

Esp-file can also be a parent for another esp-file. This is something that is confusing to new players, so it is worth to mention that right from the start. Esp can act as a limited master to another esp plugin, but not for another esm-file.

Because esp-files rely on esm-files, they are always loaded after them in the load order. There are few very rare cases, where this statement isn’t true. The most prominent example would be Unofficial Patch, which is “ESMfied” esp-file. That file should always be loaded right after official esm-files. Otherwise any esp-files among esm-files are very likely to be in the wrong index position in your load order.

3.3 esl and ESL flag

Esl stands for Elder Scrolls Light Master or Elder Scrolls Light Plugin, depending on the use. This is a special file type that was introduced by Creation Club for Skyrim Special Edition and Fallout 4. These files s do not directly count against hard plugin count in your load order and this is why many mod authors offer esl-versions of their mods. File type has it’s limits, so every mod can not be offered with ESL-flag.

Esl files are using index position FE. Slot usage for further esl-files in the load order is progressive. First esl claims index position FE:000, second FE:001 etc.

Esl files with FE index positions, as seen in Mod Organizer 2. (Grouped for visual presentation.)

3.3.1. The limits of .esl

ESL only supports 2048 new records. This is important for mod authors, but also for mod users to understand.

While 2048 record limit is a good rule of a thumb, this value only affects on new records for the game. Overwritten records in the load order are not counted against this limit.

The terminology and use of this file type is slightly more complex than for others.

  • Light Master is a file with esl-extension. File called Example.esl is a light master file.
  • Light Plugin is a file with ESL flag, but with esp extension. File called Example.esp would be a light plugin file, if it has ESL flag added to it.

3.4 bsa/.ba2

Bsa/ba2 files stand for Bethesda Software Archive and Bethesda Software Archive 2. Both of these files are resource archives. Bsa is the older version, which was used for Skyrim. Ba2 is the archive version that was introduced with Fallout 4. Functions of these files do not differ, when you look them from mod user point of view.

These archives include files like scripts, meshes, textures, voice files and music. Official archives are named accordingly and for most cases, mod archives as well. Archives themselves always require a plugin file to load them. Resources from archives are loaded according to load order. We will talk more about this in further chapter of this series.

3.5 Loose files

These files are being distributed outside of resource archives. If you would install these files in to your game Data folder, then they would be split there under folders, matching the folder structure in official archives. Replacement files are using same file names than files in official archives. Loose files like this will overwrite each other, when file with same name is installed to same location.

Loose files have their uses, but players should avoid installing unnecessary ones. They have a tendency of increasing the loading times of the game, which may also contribute to stability.

Loose files will also win all resource priority conflicts against archived files. If you would have ExampleScript.pex packed in to BA2 file and another ExampleScript.pex as a loose file in your Data folder, then the loose file would take effect in the game. Engine does not detect version information, so the loose file in Data folder could even be older version script than the file in archive.

4. About presentation of file extensions and flags

You may have noticed that I am using lowercase letters, uppercase letters and even dots to present the matter. Modding community has taken full benefit out of existing files and flags for them. For this purpose some files are treated and written differently than others.

  • If we talk about actual file extension, then we either write it with lowercase, or with dot in front of it.
    For example: Skyrimexample.esm would be esm-file, or .esm.
  • If we talk about a file with different flag than extensions, then we write it with uppercase, or add FE after it.
    For example:Falloutexample.esp would be denoted as ESL-file or ESPFE-file, if it was an esp with ESL flag.

5. Credits

5.1 Additional contributors

Following people have directly contributed to this article, by checking it’s facts. List uses forum names, unless otherwise requested.

  • Avrie
  • cfs111
  • Chef

6. Article changes

  • 12.07.2020: Several edits to Chapter 3. Presentation cleaned up for recording.
  • 29.06.2020: Added chapter 2.5. Multiply smaller edits to make the both article and upcoming video easier to follow. Also added highlights to flag comparison image at 2.4.
  • 20.06.2020: Renamed “Change Log” as “Article changes”.
  • 14.06.2020 Load order and resource priority information was rewritten. Original explanation was too complex and misleading.