RimWorld mod (1.7) that makes slavery an everyday part of the rim. First mod under the Blax Gaming label. Needs Harmony. Works with any DLC combination, core only included; the slave features need Ideology.
- 🔁 **Buy as slave or colonist (1.2).** In the trade window, "Joins as slave / Joins as colonist" on a pawn the trader sells is a button: click to switch, and the price updates (a slave costs 60% of the colonist price, as in vanilla). Unwaveringly loyal pawns can only be bought as slaves. A setting picks what new stock starts as: the vanilla 25/75 roll, always slave or always colonist. Stands down while Trade as Slave or Colonist is active. Needs Ideology. `Source/BlaxSlaves/BuyMode.cs`
- 🤝 **Every trader buys captives (1.2).** Visitor groups, the Empire's caravans (Royalty) and modded traders without a humanlike stock generator get one, so anyone you trade with buys your slaves and prisoners. Works without any DLC (then for prisoners). Optional, needs Ideology: factions whose ideoligion rejects slavery refuse, except their own people (ransom). Slave stock ignores colony size, so settlements keep selling slaves to big colonies. `Source/BlaxSlaves/TraderBuyers.cs`
- 💰 **Price sliders (1.2).** What slaves cost and what captives fetch, both vanilla 60% by default (30 to 100%). Above vanilla, a captive's sale price is capped at 90% of what the same trader would charge you for that pawn as a slave, so buy-low-sell-high loops don't pay. Needs Ideology: without it vanilla prices captives at full value, so there is no slave price to adjust. `Source/BlaxSlaves/SlavePrices.cs`
- 🐪 **Slavers are common.** The three vanilla slavers (outlander "slaver" caravan, tribal "slaver" caravan, orbital "slave ship") get commonality 2 instead of 1, and big colonies keep seeing them at half weight instead of zero. They carry more: outlander 5~9, tribal 4~7, slave ship 6~10 (vanilla 2~4). Every other caravan and orbital trader has a ~50% chance of 1~2 slaves, settlements stock 1~4. Works without any DLC; without Ideology the pawns you buy join as colonists. `Patches/BlaxSlaves_Traders.xml`
- 🔥 **Branding.** "Brand" surgery for colony slaves (adults, Medicine 2, never fails). The brand remembers its owner (shown as "slave brand (Owner)"), slows suppression loss by 15%, gives the slave a -3 "branded" mood and a fresh torso burn. "Rebrand" burns your mark over another owner's. `Defs/BlaxSlaves_Brand.xml`, `Source/BlaxSlaves/Brand.cs`
- 🏷️ **Trader slaves come branded.** 35% of adult slaves in trader stock carry the trader faction's brand (orbital ships: a random faction).
- 🏃 **Runaways come back.** A slave with your brand who escapes (slave rebellion, or a caravan whose last free member dies) is tracked. If the faction they end up with is hostile, they keep them. Otherwise, after 3~10 days (80% chance) a non-hostile faction returns them as your slave, walking in (tribal/medieval) or by drop pod. `Source/BlaxSlaves/Runaways.cs`
- 😌 **Harming slaves doesn't upset colonists.** Executing, harvesting, selling (trade or gift pod), banishing, butchering, blinding, gibbeting a slave gives free colonists no negative thoughts. Deaths only count when the colony caused them: a slave killed by raiders, animals or disease is mourned normally. Branded pawns count too unless they became free colonists. Pacifists (Kind, or incapable of violence) still mind, family still grieves, and the banish dialog shows the reduced cost. `Source/BlaxSlaves/SlaveHarm.cs`
- ⏳ **Time as a slave (1.2).** A Records tab entry, and "Enslaved for ..." in the slave tab (counted from the moment 1.2 is installed). `Source/BlaxSlaves/TimeAsSlave.cs`
⚙️ Mod settings for all the numbers and toggles, in tabs (Trade, General, Compat). Without Ideology, the settings that need it show greyed out with a "needs Ideology" note. The Compat tab lists active mods that Blax Slaves replaces, so you know what you can unsubscribe.
### DLC support
Blax Slaves works with any combination of DLCs, core only included, and lists none as a dependency.
- **Ideology** is what makes slaves. Without it, buying as slave or colonist, the anti-slavery refusal, the price sliders and everything under Slaves stay off, and their settings show greyed out with a "needs Ideology" note. Every trader still buys your prisoners, and the slaver changes still apply.
- **A save made with Ideology** loads without it. Leftover slaves and brands are treated the way vanilla treats them: no branding, no runaway returns or letters, no mood protection, no time counting. A pawn a trader still holds from that save joins as a colonist when you buy it, never as a slave.
- **Royalty** adds the Empire: its caravans buy captives too, and its orbital and settlement traders carry slaves.
- **Biotech** adds children: "always slave" covers them, brands are for adults only.
- **Anomaly** and **Odyssey**: Blax Slaves uses none of their content.
- ✔️ War Crimes Expanded 2 torture and Harvest Organs Post Mortem autopsies count as slave harm when their mods are active.
- ✔️ Hospitality visitor groups never take a runaway who is due to be returned.
- ✔️ No Sympathy For Prisoners already removes slavery and execution precept thoughts for everyone, pacifists included.
- ♻️ Everybody Buys Slaves and [SYR] More Slaves can stay installed but aren't needed any more; with More Slaves, its extra 3~5 slaves per trader stack on ours.
- 🧩 [Blax Castes](https://steamcommunity.com/sharedfiles/filedetails/?id=3848261054), [Blax Zones](https://steamcommunity.com/sharedfiles/filedetails/?id=3848261160) and [Blax Defaults](https://steamcommunity.com/sharedfiles/filedetails/?id=3848261264) are optional companions on the Workshop. Blax Slaves binds the Castes and Zones APIs by reflection when they are loaded and works the same without them. Crimes and punishments, for slaves too, are planned in [Blax Laws](https://forgejo.blax.at/blax-software/rimworld-blax-laws).
`RimWorldDir` and `HarmonyDir` in the csproj point at the Steam install and the Harmony mod; override them with `-p:RimWorldDir=...` elsewhere.
RimWorld 1.7 no longer runs on Unity/Mono. It runs on .NET 10 (CoreCLR) with Ludeon's own engine ("Waylith"):
-`Assembly-CSharp.dll` and `UnityStubs.dll` (Rect, Color...) sit in the install root, and target `net10.0`.
- Harmony for 1.7 is the Harmony mod's `1.7/Assemblies/0Harmony.dll` (3.0-rc.7, Workshop 2009463077). Reference it, don't ship it. Parameterless `PatchAll()` is obsolete in Harmony 3.
- In game, the Harmony mod swaps in a Waylith method-body backend (`HarmonyMod.RuntimeIL.dll`). Check `Player.log` for `[Blax Slaves] N patches applied` and Harmony's `runtime-body provider` line.
- Patches are applied from a `[StaticConstructorOnStartup]` class, one class at a time, so one broken target can't disable the rest.
`Tools/workshop-upload.ps1` updates the Workshop item from the command line (and creates it for a mod that has none yet). A small tool (`Tools/WorkshopUpload`) uses the Steamworks.NET build and `steam_api64.dll` that ship with RimWorld and attaches to the running, logged-in Steam client as RimWorld, so it needs no password, no game window and no dev mode. The same tool ships in every Blax Gaming mod.
The dry run and `-Check` upload nothing. The script stages only what players need (About, 1.7, Defs, Patches, Languages) in `%TEMP%`, sets the tags the game would (Mod plus the supported versions), the title from About.xml and the preview from `About/Preview.png`. The change note is every CHANGELOG.md entry newer than the version in `Tools/workshop-published.txt`, which a successful upload updates; commit it afterwards.
- the shipped files are committed and pushed, and the top CHANGELOG.md entry matches `modVersion` in About.xml;
- two `Tests/run-tests.ps1` runs from this checkout passed after the last change to the shipped files, one with every installed DLC and one with `-NoDlc` (`BlaxSlavesTestResults.all.txt` and `BlaxSlavesTestResults.nodlc.txt` in `%TEMP%\BlaxSlavesTest`), with no mod errors logged outside the tests;
-`About/Preview.png` is under 1 MB;
- the description fits Steam's 8000-byte limit, every forgejo.blax.at link in it opens without a login, and every `[img]` host sends an `Access-Control-Allow-Origin` header. Steam loads description images cross-origin and shows a broken image otherwise. Forgejo's raw URLs send no such header, so the images are served from `cdn.blax.at/blax-gaming/slaves/`, which does.
The Workshop page is `docs/workshop-description.txt` (Steam BBCode). Its art is rendered from `Source/Art` (see `Source/Art/README.md`), and `docs/workshop-media.md` lists the in-game clips worth recording. `-DescriptionOnly -DescriptionFile docs\workshop-description.txt` replaces just the text, with no build, no content upload and no change note.
The in-game route still works: `Tools/workshop-stage.ps1` swaps the junction for a clean copy, upload from Mods > Blax Slaves > Advanced... > Update on Steam Workshop (dev mode), then `Tools/workshop-stage.ps1 -Done` restores the junction. The game's uploader resets the title from About.xml and never updates the description.
`Tests/BlaxSlavesTests` is a separate test mod. `Tests/run-tests.ps1` builds both projects, links the test mod into the game's Mods folder for the run, and starts RimWorld headless (`-headless -quicktest -blaxslavestests`, no window) with its own save data folder in `%TEMP%\BlaxSlavesTest`, so your mod list, saves and settings stay untouched. The suite runs in a quick-test colony, saves and reloads the game, runs the persistence tests, writes `BlaxSlavesTestResults.txt` and quits. It takes about a minute and needs Steam running.
`-Compat` also loads the installed mods Blax Slaves has compat code for (Hospitality, Harvest Organs Post Mortem, War Crimes Expanded 2, SYR More Slaves, Everybody Buys Slaves, Trade as Slave or Colonist); tests whose assumptions those mods change skip or relax only that assertion and say why. By default every installed DLC is loaded; `-NoDlc` runs core only and `-Dlc Royalty,Biotech` loads only the DLCs named. A test that needs a DLC skips with "needs Ideology" (or the DLC it needs) when it is off, and the DLC-off tests check that those features stay off. The results file has a `DLCS` line right after `BEGIN`, and each run also leaves a copy per DLC set (`BlaxSlavesTestResults.all.txt`, `.nodlc.txt`, `.dlc-<names>.txt`). `-AllowWhileRunning` runs it next to an open RimWorld, with the test game at below-normal priority; a lock file keeps two runs from overlapping. Exit code 0 means all passed, 1 failures, 2 the run didn't finish (see `game.log` in the data folder).
Tests are `public static void` methods marked `[BlaxTest("area: what", phase: 1)]`, using `T` for assertions and `Fixtures` for pawns, ticks and memories. Phase 2 runs after the save and reload; carry ThingIDs through `T.Carry`.
Useful 1.7 switches for manual runs: `-quicktest` (straight into a generated colony), `-headless`, `-savedatafolder=<dir>`, `-QuitAfterBoot`, `-NoFileLog`.
---
## Made by Blax
[](https://www.blax.at)
🛠️ **Blax Gaming** is a project of **[Blax Software](https://www.blax.at)**, an Austrian software practice. We write Austrian-quality code in many fields: web platforms, mobile apps, backends, infrastructure, and the mods we play in our own colonies. Need something built? 👉 [www.blax.at](https://www.blax.at)