Editing Modding Tutorials/Mod Folder Structure

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
{{DISPLAYTITLE:Mod Folder Structure}}
 
{{DISPLAYTITLE:Mod Folder Structure}}
 
+
{{:Modding_Tutorials/Under_Review}}
{{BackToTutorials}}
 
  
 
This is a guide explaining the contents of mod folders and best practices for how they should be laid out for proper recognition by RimWorld as well as compatibility with other mods.
 
This is a guide explaining the contents of mod folders and best practices for how they should be laid out for proper recognition by RimWorld as well as compatibility with other mods.
Line 15: Line 14:
 
| Windows || <code>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods</code>
 
| Windows || <code>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods</code>
 
|-
 
|-
| Mac || <code>~/Library/Application Support/Steam/steamapps/common/RimWorld/RimWorldMac.app/Mods</code>
+
| Mac || <code>Library/Application/Support/Steam/steamapps/common/RimWorld</code>
 
|-
 
|-
 
| Linux (standalone) || <code>~/.steam/steam/steamapps/common/RimWorld/Mods</code>
 
| Linux (standalone) || <code>~/.steam/steam/steamapps/common/RimWorld/Mods</code>
Line 46: Line 45:
 
The only folder required for all mods, the <code>About</code> folder contains information that identifies your mod to RimWorld and allows it to be loaded.
 
The only folder required for all mods, the <code>About</code> folder contains information that identifies your mod to RimWorld and allows it to be loaded.
  
<div class="TutorialTableWrapper">
+
=== <code>About.xml</code> (Required) ===
{| class="TutorialCodeTable"
+
 
! Name !! Description
 
|-
 
| class="TutorialCodeTable-description" |
 
<code>About.xml</code>
 
'''(Required)'''
 
| class="TutorialCodeTable-description" |
 
 
''See: [[Modding_Tutorials/About.xml|About.xml]]''
 
''See: [[Modding_Tutorials/About.xml|About.xml]]''
  
 
<code>About.xml</code> is used to identify a mod to RimWorld so it can be loaded, and can also be used to specify dependencies and load order helpers for mod compatibility. Please see the [[Modding_Tutorials/About.xml|full guide]] for more information.
 
<code>About.xml</code> is used to identify a mod to RimWorld so it can be loaded, and can also be used to specify dependencies and load order helpers for mod compatibility. Please see the [[Modding_Tutorials/About.xml|full guide]] for more information.
|-
+
 
| class="TutorialCodeTable-description" |
+
=== <code>Preview.png</code> (Required) ===
<code>Preview.png</code>
+
 
'''(Required)'''
 
| class="TutorialCodeTable-description" |
 
 
A mod's <code>Preview.png</code> is used as the preview image for that mod in both the in-game mod manager as well as Steam Workshop. It is strongly recommended to use a 640x360 PNG file as this is the default size and aspect ratio (16/9) configured for RimWorld and using other sizes may result in blurring or letterboxing. You can also opt to use 1280x720 for higher resolution artwork, but '''preview files must remain under 1MB or Steam Workshop will reject your upload'''. If you get a "limit exceeded" error, then double-check the size of your <code>Preview.png</code>.
 
A mod's <code>Preview.png</code> is used as the preview image for that mod in both the in-game mod manager as well as Steam Workshop. It is strongly recommended to use a 640x360 PNG file as this is the default size and aspect ratio (16/9) configured for RimWorld and using other sizes may result in blurring or letterboxing. You can also opt to use 1280x720 for higher resolution artwork, but '''preview files must remain under 1MB or Steam Workshop will reject your upload'''. If you get a "limit exceeded" error, then double-check the size of your <code>Preview.png</code>.
  
 
'''Note''': While PNG files are standard, RimWorld does not actually require a PNG file. It is possible to use JPG or even animated GIF files by simply renaming them "Preview.png", but the PNG extension must be used or RimWorld will not recognize it.
 
'''Note''': While PNG files are standard, RimWorld does not actually require a PNG file. It is possible to use JPG or even animated GIF files by simply renaming them "Preview.png", but the PNG extension must be used or RimWorld will not recognize it.
|-
+
 
| class="TutorialCodeTable-description" |
+
=== <code>Manifest.xml</code> (Obsolete) ===
<code>ModIcon.png</code>
+
 
''(Optional)''
 
| class="TutorialCodeTable-description" |
 
New in RimWorld 1.5, a mod's <code>ModIcon.png</code> is shown during game loading screens and in the Options UI if your mod has [[Modding_Tutorials/ModSettings|mod settings]]. It should be either a 32x32 or 64x64 PNG file, and too much detail or color should be avoided; Unity texture compression will make overcomplicated icons very crunchy.
 
|-
 
| class="TutorialCodeTable-description" |
 
<code>Manifest.xml</code>
 
''(Obsolete)''
 
| class="TutorialCodeTable-description" |
 
 
You may see a <code>Manifest.xml</code> file in some older mods. This was a file used by [https://steamcommunity.com/sharedfiles/filedetails/?id=1507748539 Fluffy's Mod Manager] as well as some external mod managers for dependency and versioning information in older versions of RimWorld. This is generally considered obsolete as the most important benefits of having a manifest file have largely been mainlined into <code>About.xml</code>; you do not need this file unless you want specific additional features provided by Mod Manager.
 
You may see a <code>Manifest.xml</code> file in some older mods. This was a file used by [https://steamcommunity.com/sharedfiles/filedetails/?id=1507748539 Fluffy's Mod Manager] as well as some external mod managers for dependency and versioning information in older versions of RimWorld. This is generally considered obsolete as the most important benefits of having a manifest file have largely been mainlined into <code>About.xml</code>; you do not need this file unless you want specific additional features provided by Mod Manager.
|-
 
|}
 
</div>
 
  
 
== <code>Assemblies</code> ==
 
== <code>Assemblies</code> ==
Line 128: Line 108:
 
''See: [[Modding_Tutorials/Textures|Textures]]''
 
''See: [[Modding_Tutorials/Textures|Textures]]''
  
The <code>Textures</code> folder is used to hold custom texture files for mods. It is generally recommended to use [https://en.wikipedia.org/wiki/PNG PNG files]. Please see the [[Modding_Tutorials/Textures|Textures guide]] for more information.
+
The <code>Textures</code> folder is used to hold custom texture files for mods. It is generally recommended to use [https://en.wikipedia.org/wiki/PNG PNG files]. Please see the [[Modding_Tutorials/Textures|Texturesguide]] for more information.
  
 
Just like sounds, texture files in RimWorld are identified by their path names; if a mod contains a texture file with the same path and file name as another mod or even the vanilla game or DLCs, then the last one to be loaded in your mod list will overwrite the others. This is sometimes done intentionally by re-texture mods that want to change textures from the vanilla game or other mods.
 
Just like sounds, texture files in RimWorld are identified by their path names; if a mod contains a texture file with the same path and file name as another mod or even the vanilla game or DLCs, then the last one to be loaded in your mod list will overwrite the others. This is sometimes done intentionally by re-texture mods that want to change textures from the vanilla game or other mods.
Line 143: Line 123:
 
</source>
 
</source>
  
== Versioned Folders (Optional) ==
+
== Versioned Folders ==
 
 
''Note: It is strongly recommended that you do not declare support for versions of RimWorld that you do not personally test every release with, as RimWorld code and XML has changed in significant ways between every version.''
 
 
 
Content for specific versions of RimWorld can be implemented by placing them in folders named after their minor version numbers:
 
 
 
<source>
 
Mods
 
└ MyModFolder
 
  ├ 1.4
 
  │ ├ Assemblies
 
  │ ├ Defs
 
  | ├ Languages
 
  │ ├ Sounds
 
  │ ├ Patches
 
  │ └ Textures
 
  ├ 1.3
 
  │ └ ...
 
  ├ 1.2
 
  │ └ ...
 
  ├ 1.1
 
  │ └ ...
 
  │
 
  ├ Common
 
  │ └ ...
 
  │
 
  ├ About
 
  ├ Defs
 
  ├ Languages
 
  ├ Sounds
 
  ├ Patches
 
  └ Textures
 
</source>
 
 
 
* All versioned folders and the <code>Common</code> folder can contain all normal root folders other than the <code>About</code> folder.
 
* '''For RimWorld 1.1 and later''', the game will load the first versioned folder that is compatible with the version of the game. Thus, if you only had folders for <code>1.4</code> and <code>1.2</code>, then RimWorld v1.4 would load the <code>1.4</code> folder, while RimWorld v1.3 and v1.2 would both load the <code>1.2</code> folder. All versions will also load <code>Common</code> and any direct root folders.
 
* '''For RimWorld 1.0 only''', the game does not recognize the <code>Common</code> folder. RimWorld v1.0 is capable of recognizing a <code>1.0</code> folder, but if it is used then the game '''WILL NOT''' load from the root folder; for mods that support RimWorld v1.0, it is typically recommended that content be placed into root folders and override content for newer versions be placed into versioned folders.
 
* Files with the same relative path will overwrite each other, with the most specific one taking precedence; this applies to XML files (both Def and Patch files), audio files, language files, and textures. Thus, if you have <code>Defs/MyFile.xml</code>, <code>Common/Defs/MyFile.xml</code>, and <code>1.4/Defs/MyFile.xml</code>, only the last one will be read.
 
 
 
== <code>LoadFolders.xml</code> (Optional) ==
 
 
 
Specific rules for which folders are loaded for which version of the game, as well as optional folders to be loaded for specific DLCs or mods can be specified by using a special file called <code>LoadFolders.xml</code>. This file should be placed in your root mod folder:
 
 
 
<source>
 
Mods
 
└ MyModFolder
 
  └ LoadFolders.xml
 
</source>
 
 
 
<code>LoadFolders.xml</code> allows you to specify exactly which folders should be loaded for given versions of RimWorld. '''This supersedes the default versioned folder rules as specified above for all versions of RimWorld except v1.0''', which means that you will need to specify the root or <code>Common</code> folders if you wish to use them. An example file is shown here:
 
 
 
<source lang="xml">
 
<?xml version="1.0" encoding="utf-8" ?>
 
<loadFolders>
 
  <v1.3>
 
    <li>/</li>
 
    <li>1.3</li>
 
    <li IfModActive="Ludeon.RimWorld.Ideology">Ideology/1.3</li>
 
    <li IfModActive="CETeam.CombatExtended">CombatExtended/1.3</li>
 
  </v1.3>
 
  <v1.4>
 
    <li>/</li>
 
    <li>1.4</li>
 
    <li IfModActive="Ludeon.RimWorld.Ideology">Ideology/1.4</li>
 
    <li IfModActive="CETeam.CombatExtended">CombatExtended/1.4</li>
 
  </v1.4>
 
</loadFolders>
 
</source>
 
 
 
This example file specifies that the root folder and a versioned folder should be loaded for RimWorld v1.3 and v1.4, and optionally loads extra folders based on whether the [[Ideology]] DLC and/or Combat Extended mods are loaded. This might correspond to a mod folder structure as follows:
 
 
 
<source>
 
Mods
 
└ MyModFolder
 
  ├ 1.4
 
  │ ├ Assemblies
 
  │ ├ Defs
 
  │ └ Patches
 
  ├ 1.3
 
  │ └ ...
 
  │
 
  ├ Ideology
 
  │ ├ 1.4
 
  │ │ └ ...
 
  │ └ 1.3
 
  │  └ ...
 
  ├ CombatExtended
 
  │ ├ 1.4
 
  │ │ └ ...
 
  │ └ 1.3
 
  │  └ ...
 
  │
 
  ├ About
 
  ├ Sounds
 
  ├ Textures
 
  └ LoadFolders.xml
 
</source>
 
  
* Folders that should be loaded if mods and DLCs are ''not'' loaded can also be specified using <code>IfModNotActive</code>. Mods and DLCs specified using <code>IfModActive</code> or <code>IfModNotActive</code>
+
(Placeholder)
* If you have files with the same relative path, then the last one specified by your load order will be used. Thus in the above example setup, if you had <code>Defs/MyFile.xml</code>, <code>1.4/Defs/MyFile.xml</code>, and <code>Ideology/1.4/Defs/MyFile.xml</code>, then the Ideology version would be loaded. This applies to all XML files (both Defs and Patches), Sounds, Textures, and Language files.
 
* If you have both a local version of the mod, as well as the steam version, you will need to qualify the steam version with <code>_steam</code> for requiring it to test out compatibility with the steam version. In the example above, <code>IfModActive="CETeam.CombatExtended"</code> would become <code>IfModActive="CETeam.CombatExtended,CETeam.CombatExtended_steam"</code> to support both a local mod version of Combat Extended as well as the steam version.
 
  
 
== Miscellaneous ==
 
== Miscellaneous ==

Please note that all contributions to RimWorld Wiki are considered to be released under the CC BY-SA 3.0 (see RimWorld Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Template used on this page: