In this chapter of the manual we will cover the usage of files and directoriesby OpenMW CS. Files and directories are file system concepts of your operatingsystem, so we will not be going into specifics about that, we will only focuson what is relevant to OpenMW CS.
Basics
Directories
OpenMW and OpenMW CS use multiple directories on the file system. First of allthere is a user directory that holds configuration files and a number ofdifferent sub-directories. The location of the user directory is hard-codedinto the CS and depends on your operating system.
Operating System | User Directory |
---|---|
GNU/Linux |
|
OS X |
|
Windows |
|
In addition to to this single hard-coded directory both OpenMW and OpenMW CSneed a place to search for actual data files of the game: textures, 3D models,sounds and record files that store objects in game; dialogues and so on. Thesefiles are called content files. We support multiple such paths (we call themdata paths) as specified in the configuration. Usually one data path pointsto the directory where the original Morrowind game is either installed orunpacked to. You are free to specify as many data paths as you would like,however, there is one special data path that, as described later, which is usedto store newly created content files.
Content files
The original Morrowind engine by Bethesda Softworks uses two types of contentfiles: ESM (master) and ESP (plugin). The distinction between those two isnot clear, and often confusing. One would expect the ESM (master) file to beused to specify one master, which is then modified by the ESP plugins. Andindeed: this is the basic idea. However, the official expansions were also madeas ESM files, even though they could essentially be described as really largeplugins, and therefore should have been ESP files. There were technicalreasons behind this decision – somewhat valid in the case of the originalengine, but clearly it is better to create a system that can be used in a moresensible way. OpenMW achieves this with our own content file types.
We support both ESM and ESP files, but in order to make use of new features inOpenMW one should consider using new file types designed with our engine inmind: game files and addon files, collectively called content files.
OpenMW content files
The concepts of Game and Addon files are somewhat similar to the oldconcept of ESM and ESP, but more strictly enforced. It is quitestraight-forward: If you want to make new game using OpenMW as the engine (aso called total conversion) you should create a game file. If you want tocreate an addon for an existing game file create an addon file. Nothing elsematters; the only distinction you should consider is if your project is aboutchanging another game or creating a new one. Simple as that.
Another simple thing about content files are the extensions: we are using.omwaddon
for addon files and .omwgame
for game files.
Morrowind content files
Using our content files is recommended for projects that are intended to usethe OpenMW engine. However, some players might wish to still use theoriginal Morrowind engine. In addition thousands of ESP/ESM files werecreated since 2002, some of them with really outstanding content. Because ofthis OpenMW CS simply has no other choice but to support ESP/ESM files. Ifyou decide to choose ESP/ESM file instead of using our own content filetypes you are most likely aiming at compatibility with the original engine. Thissubject is covered in its own chapter of this manual.
The actual creation of new files is described in the next chapter. Here we aregoing to focus only on the details you need to know in order to create yourfirst OpenMW CS file while fully understanding your needs. For now let’s justremember that content files are created inside the user directory in the thedata
subdirectory (that is the one special data directory mentionedearlier).
Dependencies
Since an addon is supposed to change the game it follows that it also dependson the said game to work. We can conceptualise this with an example: yourmodification is changing the price of an iron sword, but what if there is noiron sword in game? That’s right: we get nonsense. What you want to do is tieyour addon to the files you are changing. Those can be either game files (forexample when making an expansion island for a game) or other addon files(making a house on said island). Obviously It is a good idea to be dependentonly on files that are really changed in your addon, but sadly there is noother way to achieve this than knowing what you want to do. Again, pleaseremember that this section of the manual does not cover creating the contentfiles – it is only a theoretical introduction to the subject. For now just keepin mind that dependencies exist, and is up to you to decide whether yourcontent file should depend on other content files.
Game files are not intended to have any dependencies for a very simple reasons:the player is using only one game file (excluding original and the dirtyESP/ESM system) at a time and therefore no game file can depend on another gamefile, and since a game file makes the base for addon files it can not depend onaddon files.
Project files
Project files act as containers for data not used by the OpenMW game engineitself, but still useful for OpenMW CS. The shining examples of this datacategory are without doubt record filters (described in a later chapter of themanual). As a mod author you probably do not need or want to distribute projectfiles at all, they are meant to be used only by you and your team.
As you would imagine, project files make sense only in combination with actualcontent files. In fact, each time you start to work on new content file and aproject file was not found, one will be created. The extension of project filesis .project
. The whole name of the project file is the whole name of thecontent file with appended extension. For instance a swords.omwaddon
fileis associated with a swords.omwaddon.project
file.
Project files are stored inside the user directory, in the projects
subdirectory. This is the path location for both freshly created project files,and a place where OpenMW CS looks for already existing files.
Resource files
Unless we are talking about a fully text based game, like Zork or Rogue, onewould expect that a video game is using some media files: 3D models withtextures, images acting as icons, sounds and anything else. Since contentfiles, no matter whether they are ESP, ESM or new OpenMW file type, do notcontain any of those, it is clear that they have to be delivered with adifferent file. It is also clear that this, let’s call it “resources file“,has to be supported by the engine. Without code handling those files it isnothing more than a mathematical abstraction – something, that lacks meaningfor human beings. Therefore this section must cover ways to add resourcesfiles to your content file, and point out what is supported. We are going to dojust that. Later, you will learn how to make use of those files in yourcontent.
Audio
OpenMW uses FFmpeg for audio playback, and so we support every audio typesupported by that library. This makes a huge list. Below is only small portionof the supported file types.
- mp3 (MPEG-1 Part 3 Layer 3)
A popular audio file format and de facto standard for storing audio. Used bythe Morrowind game.
- ogg
An open source, multimedia container file using a high quality Vorbis audiocodec. Recommended.
Video
Video As in the case of audio files, we are using FFmepg to decode video files.The list of supported files is long, we will cover only the most significant.
- bik
Videos used by the original Morrowind game.
- mp4
A multimedia container which use more advanced codecs (MPEG-4 Parts 2, 3 and10) with a better audio and video compression rate, but also requiring moreCPU intensive decoding – this makes it probably less suited for storingsounds in computer games, but good for videos.
- webm
A new, shiny and open source video format with excellent compression. Itneeds quite a lot of processing power to be decoded, but since game logic isnot running during cutscenes we can recommend it for use with OpenMW.
- ogv
Alternative, open source container using Theora codec for video and Vorbis for audio.
Textures and images
The original Morrowind game uses DDS and TGA files for all kinds of twodimensional images and textures alike. In addition, the engine supported BMPfiles for some reason (BMP is a terrible format for a video game). We alsosupport an extended set of image files – including JPEG and PNG. JPEG andPNG files can be useful in some cases, for instance a JPEG file is a validoption for skybox texture and PNG can useful for masks. However, please keepin mind that JPEG images can grow to large sizes quickly and are not the bestoption with a DirectX rendering backend. You probably still want to use DDSfiles for textures.