A minimal, reusable skeleton for a RimWorld 1.6 mod with Harmony, ModSettings, and a build that drops the DLL straight into 1.6/Assemblies/.
-
Copy this folder to a sibling location, e.g.
../MyNewMod/. -
Rename the source folder and files inside
Source/:Source/__ASSEMBLY__/→Source/MyNewMod/Source/MyNewMod/__ASSEMBLY__.csproj→MyNewMod.csprojSource/MyNewMod/__ASSEMBLY__.cs→MyNewMod.cs
-
Find-and-replace across the whole folder (Rider/VS Code: replace-in-files):
Sentinel Replace with Example __MODNAME__display name (spaces & punctuation OK) Janitor's Closet__AUTHOR__your handle Synergy__PACKAGEID__unique id, lowercase, dot-separated, no spaces synergy.janitorscloset__DEFPREFIX__short uppercase prefix for every defName JANITOR__ASSEMBLY__C# identifier; matches the renamed folder/files (no spaces, no punctuation) JanitorsClosetThe replace is case-sensitive and content-only: file/folder names use
__ASSEMBLY__so step 2 handles those manually. -
Add art to
About/:Preview.png(640×360 recommended)ModIcon.png(32×32 recommended)
-
Build the project (
dotnet buildfromSource/MyNewMod/, or via Rider/VS). The DLL outputs directly to1.6/Assemblies/MyNewMod.dll. -
Symlink or copy the mod folder into
RimWorld/Mods/(or your local Steam Workshop dir) and enable it in the in-game mod list.
__ModTemplate__/
├── About/
│ ├── About.xml metadata (name, author, packageId, deps)
│ └── (Preview.png, ModIcon.png — add your own)
├── 1.6/
│ ├── Assemblies/ built DLL lands here (gitignored)
│ ├── Defs/Things.xml ThingDefs, RecipeDefs, etc.
│ └── Patches/Patches.xml XML PatchOperations
├── Languages/English/Keyed/Keys.xml
├── Source/__ASSEMBLY__/
│ ├── __ASSEMBLY__.cs Mod, ModSettings, Harmony bootstrapper
│ └── __ASSEMBLY__.csproj net472, refs Assembly-CSharp + UnityEngine, Harmony 2.3.3
├── Textures/ PNGs referenced by texPath in Defs
├── LoadFolders.xml tells RimWorld to load both / and 1.6/
├── .gitignore
└── README.md
- Every defName starts with
__DEFPREFIX___(prefix + underscore) to avoid collisions with vanilla and other mods. - Every translation key in
Languages/.../Keys.xmlalso starts with__DEFPREFIX___. - Harmony id uses the packageId (
__PACKAGEID__), so it's automatically unique. - DLL output goes straight to
1.6/Assemblies/— no manual copy step.
The .csproj references RimWorld DLLs at C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\. If your install lives elsewhere, update the five <HintPath> entries in __ASSEMBLY__.csproj (or set up a Directory.Build.props if you want one source of truth across mods).
This template targets 1.6. To support 1.5 alongside:
- Add a
1.5/folder mirroring1.6/. - Add a
<v1.5>block toLoadFolders.xml. - Add
<li>1.5</li>to<supportedVersions>inAbout.xml. - Either build twice with different references, or use
MayRequire/version checks in code.