Skip to content

Repository files navigation

RimACG - Autonomous Colony Governor (RimWorld 1.6 Scaffold)

This repository contains the first loadable mod foundation for the Autonomous Colony Governor project.

Project goal

Autonomous Colony Governor (ACG) aims to automate high-level colony governance while remaining deterministic and safe:

  • deterministic action generation/ranking for identical inputs
  • incremental, dirty-flag-driven state extraction
  • bounded planning/execution budgets
  • optional AI integration behind strict guardrails

This repo started as scaffold, and now includes a working early-game autonomous bootstrap slice.

Current architecture scaffold

Source/ is organized to match the implementation spec:

  • Mod/ - RimWorld mod entry + settings
  • Engine/ - GameComponent, WorldComponent, MapComponent, patch gateway, capability registry
  • State/ - snapshots, blackboard, dirty-channel model
  • Extraction/ - snapshot builder adapters
  • Planning/ - planner interfaces, scheduler, budget/depth models, planner stubs
  • Execution/ - actions, deterministic candidate buffering, validation, execution, cooldown map
  • UI/ - governor window/state placeholders
  • AI/ - disabled/no-op AI policy bridge + packet/validator stubs
  • Metrics/ - metrics and panel model placeholders
  • Utils/ - deterministic comparer utility

Minimal runtime tick pipeline

GovernorMapComponent.MapComponentTick() executes this deterministic shell:

  1. mark/drain dirty flags
  2. build colony snapshot
  3. run scheduled planners
  4. deterministic candidate sort
  5. validate actions
  6. execute approved batch (safe stub behavior)

Deterministic action sort tuple:

  • Priority (desc)
  • Urgency (desc)
  • Confidence (desc)
  • PlannerId (asc)
  • CreatedTick (asc)
  • ActionId (asc)

Visual Studio project (included)

A ready-to-open Visual Studio solution is included at:

  • RimACG.sln

The project is preconfigured to:

  • target .NET Framework 4.7.2
  • compile all Source/**/*.cs files
  • output RimACG.dll directly to Assemblies/
  • reference RimWorld managed assemblies via RimWorldManagedDir

If RimWorld is not beside this repo, set RimWorldManagedDir in Visual Studio MSBuild properties or build with:

  • msbuild RimACG.sln /p:RimWorldManagedDir="C:\path\to\RimWorldWin64_Data\Managed"

Build instructions (external)

RimWorld assemblies are proprietary and intentionally not committed here.

1) Create project

Create a C# class library project:

  • Target framework: .NET Framework 4.7.2
  • Output assembly: RimACG.dll
  • Include all Source/**/*.cs

2) Add references from local RimWorld install

Add references to:

  • Assembly-CSharp.dll
  • UnityEngine.CoreModule.dll
  • UnityEngine.dll (toolchain-dependent)

Common install paths:

  • Steam (Windows):
    • C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\
  • Steam (Linux):
    • ~/.steam/steam/steamapps/common/RimWorld/RimWorldLinux_Data/Managed/

3) Build and copy

  • Build in Release mode.
  • Copy output DLL to:
    • Assemblies/RimACG.dll

4) Load test in RimWorld 1.6

  • Place this mod folder in your RimWorld Mods/ directory.
  • Enable Autonomous Colony Governor in mod list.
  • Start or load a colony map and confirm no startup errors.

AI policy status

AI integration is intentionally disabled/no-op in this milestone:

  • AiPolicyBridge.IsEnabled returns false
  • settings expose Enable AI policy bridge, but bridge remains stubbed for safety

Development notes

  • PatchGateway is a safe placeholder only (no heavy Harmony behavior yet).
  • Structural bootstrap planner now emits real construction/zone/mining actions.
  • See IMPLEMENTATION_STATUS.md for implemented/deferred scope.
  • See NEXT_STEPS_PROMPT.md for a ready-to-use continuation prompt.

About

Rimworld Autonomous Colony Governor

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages