Mod Order Guide

**This guide has been partially updated as of Aug 2022. At this point the Rimpy server probably has a better idea of what newer mods tend to do in various places, but I'm going to leave this up for posterity reasons. Use Rimpy, it will sort your mods perfectly.**

*References to "I" or "me" are because I, **Trisscar**, the author of this modlist guide, finally got off my ass and went in to add explanations and flesh out the guide, as before it was short and terse due to Discord's character limit. Credit to Felinoel, Chevalier XLIV, and everyone else from Rim of Magic, Madness, LotR, and a few other servers who helped me figure out (and post) this entire mess of a guide, and the intricacies of modding with Rimworld in general, over the course of like.... two and a half years. Ya'll are awesome.*

If you have not done so recently, I highly recommend that if you use Steam to run Rimworld, that you go into your library, right click Rimworld, Properties, Local Files, Verify File Integrity or whatever it's called. This makes sure everything downloaded properly and tends to solve a lot of issues pretty much instantly.

--If the mod list tends to make your eyes bleed, one possible helpful tip: go to your mods folder in your computer's files, path (if on Windows);

☀C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods

And make a bunch of empty folders named the various categories in a flashy and attention grabbing manner. (Or just use LOMS on the Workshop, since that does it for you without the console spam that empty folders tend to have.)

Examples: "++++=Items=++++" "69xxxRACESxxx96" "L\_\_quiet-in-the-LIBRARIES\_\_L"

\*\*\*\*\*

**Useful out-of-game mod sorter if you hate load times (No, it does not sort it for you):**

https://github.com/Mehni/ModSorter/releases/latest (This may work better on 1.1 than 1.2, if you encounter issues there are other offline mod list accessibility options such as Rimpy)

\*\*\*\*\*

Unless stated otherwise, categories further down override categories further up.

(e.g., If a mod is adding both *map gen* AND *pawns*, it goes in *Races* [races being the *latter*]; if it adds *items* but it's a *faction* mod, it goes in *items* [items being the latter category]; etc.).

Note that Vanilla Expanded is a set of mods that tend to follow their own rules to some degree, for instance Van. Faction Exp. wants to go below the sets item mods if you want the factions to use said items.

* HARMONY (1.1 and up)
* Core
* Royalty (If available, 1.1 and up)
* Ideology (same as Royalty)
* SRTS (if you load after Hugslib then the ships will show up in a colonist's inventory)
* Hugslib
* Jecstools
* Humanoid Alien Races
* Prepare Carefully or Character Editor, not both unless you have a very good idea of what you are doing
* **Libraries -**Core file packets (If something says it has no content, just code for other mods to build from, that's a library). Examples include Misc Core, Turret Extensions, and a few others.

* Terra Core goes here. It's also an overhaul mod, so if you are using it with a large modlist you'll probably get a lot of red errors and things breaking. You have been warned.
* THEN immediately after libraries, What the Hack (this mod is a silly one that way) and then
* Giddy-up Core
* Giddy-up Addons
* Doors Expanded
* Third Age
* If running Combat Extended, it is theorized that it should go right above Third Age, patch to both goes right below both.

~~CE is a compatibility mess that can more than double your modlist based on patches for mods, and then patches for those patches, alone. It's a cool idea, I just wish it's execution was better. Or at least less destructive. If you want to use it cool, but I highly recommend building the rest of your modlist first and adding CE and it's patches at the end of the process.~~

CE now houses a ton of patches internally for many mods, due to the hard work of the latest team to take it on. ....I'd still prefer it not need to do that in the first place, but it would require a rewrite of most of the code, so the workaround is at least nice.

Also if you are adding CE, and you have not checked that every mod you add EXPLICITLY states, via CE or the mod itself, that it is compatible; Your errors will be no one's fault but yours.

Also note that people are starting to make mods that do things CE does, without the coding issues; you are not locked to CE just because you like a thing it does.

*(I should note that CE itself is not overly to blame for the "patches for your patches" bit, as the first set of patches is usually done by other people who might not know exactly what they're doing. I'm still annoyed that CE overwrites vanilla bases to do what it does however.)*

* Rimworld of Magic goes here. So does Medieval Times. Mostly because both tend to break things a little if they aren't up here. Also Rimwar.
- Despite what the mod page says, it's been reported that Rimhammer-The End Times needs to go here or various things will break, this is assumed to be due to the fact that End Times does tech restricting things. Try this if you use it and things are being silly.

* Tiberium Rim by Telefonmast (or Maxim) may want to go here.

---AFTER ALL OF THAT---

* **Map Generation** -Anything that adds biomes, messes with how maps work, or changes how the world map generates. Grand Rivers and Archipelagos go here. Mods that add new stone types to mine should probably go here as well.

### ***~~---NATURE'S PRETTY SWEET IS BANNED TILL SOMEONE OVERHAULS IT. IT IS A BUGGY BROKEN MESS THAT KILLS SAVES. YOU HAVE BEEN WARNED.---~~***

***Nature's Pretty Sweet has been overhauled by the amazing mod-necromancer Mlie. It is probably in a much better state than it was, but use it carefully regardless please.***

* **Factions** -Anything that ONLY adds new factions, not new races or types of pawns. Faction Control goes here. This category is mostly unused at this point due to most faction mods also adding races or items, so you probably won't see many things going here.
* **Traits** -Rainbeau's made a few of these. If it just adds traits, or adds slots, it goes here.
* Androids, Android Tiers, Misc Robots, any other mod that adds robot-style colonist pawns. This is due to a conflict with a medical mod or two.
* **Medical** -Yes this includes those that add new bionic parts, medical bills (not the money kind), and new surgeries. No it does not include mods that ONLY add medical items. EPOE and Rah's and A Dog Said and Archotech are examples of medical mods. Do not run both EPOE and Rah's together, they conflict because they do basically the same thing. Pawnmorpher may want to go here. Apothecary may want to go here.
* **Fun Part:** There are some mods that are for lack of a better word, tetchy. They'll fight with other mods for seemingly no reason and break things consistently no matter where they go. This can possibly be predicted by going to the Github page for AllYourBase and downloading/enabling that mod, then looking at what it prints to your console log. It's generally a better idea to just find mods that do the thing, without the issues; but if you can't, shove the mod here and see if things sort out better.

* **Game Behaviour/Mechanics/UI Mods** -While You're Up/Hand Me That Brick go here, but ALSO mods like Steel Isn't Flammable, Fewer Inferno Cannons and Greenworld, anything that changes how pawns, items, buildings, or events behave or (only) their textures. Storytellers as well. Mods that change the textures of other mods, as opposed to the textures of the base game, are basically patches and should go under the mods they are affecting. Emphasis on GAME behaviour.
* **Items** -Clothing, hair, buildings, walls, hats, weapons, Vegetable Garden, nuclear power plants, Rimfactory, Climate Control and Advanced Bridges. Anything that is something that you can build or make or find as a quest reward goes here.

Vanilla Hair Expanded goes *just* above Races due to some weird mod interactions, otherwise you can get stuff like pink boxes instead of colonist heads occasionally. They have some more troubleshooting stuff in their mod description, make sure to read it carefully.
* =====**Race/Animal Mods** ***!!RACES GO AT THE BOTTOM THIS IS NOT A DRILL!!*** -Includes Animal Collab, Arachnophobia, Werewolves, Vampires, and other mods that make massive changes to pawns just by being loaded. Anything that adds pawns (this MAY include mods that add robots, but for now throw em up above medical till it's determined one way or another) goes here.=====
* '**Level This'** needs to go below Werewolves due to a health patch they do in a slightly different and minorly conflicting fashion. Something like "one does additive, one does multiplicative".

* Facial Stuff, and a few others that require that they're at the bottom for reasons. This includes a certain NSFW mod and possibly mods that add children.
* Hospitality probably.
* Dubs Performance Analyzer and RocketMan probably want to go here for patching reasons.

--Sometimes two mods will conflict, and might be fixed by putting one of them above the other when it otherwise wouldn't be. An example of this is VGP and Glowing Healroot, where healroot will sometimes null-texture if GH is not below VGP. Try this if you have done everything else here and the error still occurs.

### Some explanation as to why this guide orders itself the way it does, and how mod order should actually be working assuming no major errors in mod code:

Aight first off, this guide is basically, as one coder has termed it, hoodoo. I personally as the writer of it consider it to be more like Greek philosophy, but eh. ;)
The base idea of this guide is the idea that your order is mildly based on what you interact with in the game in said order. So you gen the world, then do pawn stuff, then have items come into play, etc.
Buuuuutt that's not likely to be how the code actually loads things (usually), and also Races always work better at the bottom despite it seeming like they'd be second or third with this method.
I still suggest people sort stuff, partially because it actually does help in some regards due to all the special rules that have been found, most if not all of which are included here.
Also because it makes it SIGNIFICANTLY easier to spot conflicts between similar mods and/or find ones that are commonly just broken. If you're running Nature's Pretty Sweet for example, that mod as of writing this is currently a major save killer, and it's easier to spot it if it's with all your other map generation mods near the top, instead of halfway down between Androids and VGP.
However, having your modlist order be based exactly on a mod by mod guide is probably an exercise in frustration, since mods keep adding new stuff all the time and sometimes stuff wants to swap places to work correctly for no apparent reason because it happens to be on YOUR computer instead of someone elses. Therefore any loss of sanity is in no way the fault of this guide. ;)

### An explanation of how this works code wise;

*"Keep in mind that not all mod conflicts will be solved by shuffling load order around. Sometimes mods are just incompatible until the mod authors put in effort to fix their mods.*

*Sometimes mods will just be incompatible.*

*As with most things, the truth is a bit more fine-grained. It's true that "Core, Mod 1, Mod 2, Mod 3" is the load order, and the last mod "wins", but the actual load order is a bit different.*

*- XML*

*- xpath*

*- C#*

*The game first loads all XML (defs, mostly) from Core, Mod 1, Mod 2, Mod 3*

*Then it applies all xpath patches from Mod 1, Mod 2, Mod 3*

*Then it loads the C# from Mod 1, Mod 2, Mod 3*

*Core doesn't use xpath or load any C#, so they're not in that list. The C# for RimWorld is already loaded by that point, roughly speaking.*

*So if Mod 3 overwrites something in XML, but Mod 2 overwrites it in xpath and Mod 1 overwrites it in C#, it's Mod 1 that wins -- even though Mod 3 and Mod 2 come after it in the load order.*

*There are a few things that matter with load order:*

*- Does the mod require a different mod? Examples of that are mods that require HugsLib, Proper Shotguns, Turret Extensions, Alien Races, JecsTools, whatever. If you are missing a dependency, you'll notice: You get a nice red error saying something like
`Could not find type named TurretExtensions.CompProperties_Upgradable from node <A lot of XML>` and missing a dependency like that will put the entire game in a corrupted and unplayable state.*

*And then there is another insidious thing some XML mods do: overwrite (abstract) bases. For that, I refer you to https://github.com/RimWorld-CCL-Reborn/AllYourBase. This is something that's still unfortunately very frequently done, and it can cause havoc.*

*The C# summary slightly diverts from the truth. It even depends on how they instantiate the mod; there are two or three possible hooks and they happen at different times. Most mods that mess about with Defs will all have to do it in the second or third hook.*

*There's `inherit from mod`, which happens before Defs are loaded. Generally mods can't screw around with Defs in there.*

*There's the `staticconstructoronstartup` annotation which happens after Defs are loaded. This is where mods would screw around with Defs, for the most part.*

*Finally there's Hugslibs' `ondefsloaded`, which is exactly like a `staticconstructoronstartup`, but it runs after the `staticconstructoronstartup` utility is done.*

*and fwiw: that's just the Defs side of the equation*

*I won't even mention the harmony conflicts (which are way harder to detect) or runtime conflicts (which sometimes get logged, but not nearly always)*

*take the `world edit` mod: I can't remember which page it was, but basically if you click `next` somewhere and from there on you get redirected to `world edit`'s version of whatever the next screen would've been.*

*There's like.. almost zero chance of detecting that programmatically"*

The below picture is an image to use as quick reference. It is not a replacement for the guide if you have not read it yet.