Skip to content

Developer and Contributor Notes

DESKTOP-5KM6RA3\david edited this page Feb 25, 2026 · 1 revision

Developer and Contributor Notes

This page is the maintainer-focused reference for building, testing, and shipping Rimgate.

For player-facing setup and gameplay systems, start at Home.
For patch compatibility coverage, see Compatibility Matrix.

At a Glance

  • Primary gameplay/content data lives under Mod/1.6/Defs/ (XML).
  • Runtime logic lives in Source/Rimgate/ (C#).
  • Build outputs shipped to players are in Mod/1.6/ (Assemblies + AssetBundles).
  • Raw textures/audio belong in AssetsRaw/ and are bundled via the Unity builder project.
  • The wiki is a git submodule at wiki/ and has its own commit history.

Repository Layout

Path Purpose
Mod/1.6/Defs/ Core XML content (things, research, factions, incidents, etc.)
Mod/1.6/Patches/ XML patch operations (core and conditional mod compatibility)
Source/Rimgate/ C# source for runtime systems and Harmony patches
Mod/1.6/Assemblies/ Built Rimgate.dll output
AssetsRaw/ Raw texture/audio source content
UnityAssetBuilder/ Unity 2022.3 LTS project used to build AssetBundles
Mod/1.6/AssetBundles/ Generated bundle outputs consumed by the mod
wiki/ Git submodule for documentation (Rimgate.wiki.git)

Local Prerequisites

  • RimWorld 1.6 with required DLC set used by Rimgate.
  • .NET SDK available on PATH (build-assembly.ps1 runs dotnet build).
  • Unity 2022.3 LTS for asset bundle generation.
  • Recommended: Visual Studio (or equivalent) for C# debugging against the RimWorld process.

Build Workflows

Assembly only

.\build-assembly.ps1

Optional configuration:

.\build-assembly.ps1 -Configuration Debug

AssetBundles only

.\build-assetbundle.ps1

Optional Unity path override:

.\build-assetbundle.ps1 -UnityPath "C:\Program Files\Unity\Hub\Editor\6000.3.9f1\Editor\Unity.exe"

Full release build

.\build-release.ps1

Optional:

.\build-release.ps1 -Configuration Release -UnityPath "C:\Program Files\Unity\Hub\Editor\6000.3.9f1\Editor\Unity.exe"

Asset Pipeline Rules

  • Put all raw textures/audio in AssetsRaw/.
  • Do not manually place raw art/audio files under Mod/.
  • After asset edits, run build-assetbundle.ps1.
  • Treat Mod/1.6/AssetBundles/ as generated output.
  • Do not manually edit generated bundle files.

Coding and Def Conventions

XML defs

  • Follow existing folder/category structure in Mod/1.6/Defs/.
  • Use clear, consistent defName naming (Rimgate_* for mod content).
  • Reuse existing def patterns where possible instead of inventing parallel schemas.

C# source

  • Keep classes grouped by feature area (AI, Comps, Things, UI, Utilities, etc.).
  • Register XML-linked definitions centrally via Rimgate_DefOf.
  • Prefer narrowly scoped patches and avoid broad Harmony hooks when a local hook is sufficient.

Compatibility patches

  • Put optional mod integrations under Mod/1.6/Patches/ using conditional patch patterns.
  • Keep patch intent explicit (what behavior is being corrected and why).
  • Update Compatibility Matrix when new integrations are added or changed.

Testing and Validation

For XML changes

  1. Start RimWorld with Rimgate enabled.
  2. Confirm no startup XML errors.
  3. Validate the affected system in-game (buildability, jobs, inspect strings, incidents).

For C# changes

  1. Build with .\build-assembly.ps1.
  2. Launch RimWorld and reproduce the target behavior.
  3. Attach debugger if runtime behavior diverges from expected flow.

Before submitting changes

  • Verify no obvious red-error spam in logs tied to your change.
  • Re-test save/load once for stateful systems (gate links, sarcophagus state, cloning, ZPM systems).
  • If touching UI strings, verify corresponding keys in Mod/Languages/English/Keyed/Keys.xml.

Release Packaging Checklist

  1. Run .\build-release.ps1.
  2. Confirm outputs:
    • Mod/1.6/Assemblies/Rimgate.dll
    • Mod/1.6/AssetBundles/rimgate_core
  3. Upload only the Mod/ folder to Workshop distribution.
  4. Do not upload:
    • Source/
    • UnityAssetBuilder/
    • AssetsRaw/
    • raw textures/audio

Wiki Submodule Workflow

wiki/ is a submodule (Rimgate.wiki.git), so wiki updates are tracked separately.

Practical workflow:

  1. Commit page changes inside wiki/ (submodule repo).
  2. Commit the updated submodule pointer in the main repo.
  3. Push both repositories.

Common Contributor Pitfalls

  • Editing raw assets but forgetting to rebuild bundles.
  • Reporting gameplay lockouts that are actually unmet research/analysis prerequisites.
  • Assuming optional compatibility patches are active without the target mod present.
  • Forgetting that generated outputs and source assets have different ownership paths.

Clone this wiki locally