Maintenance Bureau Plus Damage Tax Roadmap¶
Seven-step build plan for v1 of the Bureau of Colonial Structural Integrity design (Building Maintenance Inspector damage tax + passive auto-repair), the original design behind the Maintenance Bureau Plus mod. The mod has since replaced it at v1 scope with an LLM-gated global repair event and no placed device (Plans/MaintenanceBureauPlus/RESEARCH.md), so this is not that mod's current plan. Reach for this recipe when starting a new auto-repair-style device mod that clones a vanilla prefab, adds logic channels, runs a scan loop, posts chat reports, and ships with BepInEx config.
When to use¶
- Building a BepInEx plugin that clones a vanilla device (Mirrored Devices cloning pattern, without mirroring) and adds behaviour on top.
- Adding logic channels (
On,Setting,Mode,Ratio,Quantity) to a cloned device. - Running a timer-based periodic scan across
Thing.AllThingsthat filters, sums damage, consumes materials, and reducesDamageStatevalues. - Shipping inspector-style chat messages: daily report, incident alert, overdue invoice, long no-damage streak.
Prerequisites¶
- BepInEx + Harmony + StationeersLaunchPad baseline wired up per ModProjectSetup.md.
- Familiarity with the Mirrored Devices cloning pattern and the game's
SourcePrefabs/MultiConstructorregistration flow.
Steps¶
v1: Bureau of Colonial Structural Integrity Damage Tax (Passive Auto-Repair)¶
- Scaffold BepInEx plugin (1 hour)
- Plugin class, Harmony init, config binds
-
Reference: Battery Backup Light structure
-
Clone vanilla device (2 hours)
- Implement Mirrored Devices cloning pattern (sans mirroring)
- Pick source device (Decision 1)
-
Register with SourcePrefabs, add to MultiConstructor, register localization
-
Add logic channels (2 hours)
- Patch
CanLogicRead/GetLogicValue/SetLogicValue/CanLogicWrite -
Channels: On, Setting (threshold), Mode (priority), Ratio (damage %), Quantity (total damage)
-
Implement repair loop (3 hours)
- Timer-based periodic scan (every in-game day)
- Iterate
Thing.AllThings, filter structures, sum damage - Calculate material cost based on damage type and structure material
- Search storage containers for materials, consume them
-
Reduce DamageState values proportionally
-
Inspector chat messages (2 hours)
- Inspector name assignment and persistence
- Message templates for: daily report, incident alert, overdue invoice, long no-damage streak
-
Post to chat via game's messaging system
-
Config system (1 hour)
-
All rates, thresholds, toggles via BepInEx Config
-
Testing (ongoing)
- Single player, multiplayer (dedicated server), save/load cycles
Verification¶
- Step 2: confirm the cloned device appears in the kit's build menu alongside the source device and its name matches the localization entry.
- Step 3: drop an IC10 test script that reads / writes each logic channel on the cloned device; verify all five are reachable.
- Step 4: snapshot a representative damaged structure's
DamageStatebefore and after a scan cycle; confirm damage decreases proportionally and the corresponding material was consumed from a nearby container. - Step 5: check chat after a full day elapses; verify the daily report fires.
- Step 7: save / load cycle. Confirm the cloned device's state (logic channel values, inspector state) persists across save and load. Test on a dedicated server to catch server-only code paths.
Pitfalls¶
- Server-side only for the scan loop:
DamageState.Damage()checksGameManager.RunSimulation. Thing.AllThingscan be large; filter early (structures only, damaged only) to avoid per-frame work scaling linearly with world size.- Save / load of a cloned prefab relies on
Animator.StringToHash(name)producing a deterministic PrefabHash. Pick a stable name and keep it stable across versions. If the mod is removed, things with unknown PrefabHash fail to load (silently disappear or cause errors). Device.AllDevicescan contain duplicates,AtmosphericsManager.AllAtmospherescan contain nulls, power calculations can produceNaN, the power tick runs on a background thread (cannot useUnityEngine.Random), and atmosphere may be null until a player logs in on dedicated servers. Guard accordingly.
Verification history¶
- 2026-04-20: page created from the Research migration; verbatim content lifted from F0239 (
Plans/RepairPrototype/plan.md:881-912). - 2026-09-22: renamed from
BCSIImplementationRoadmap.md(title "BCSI v1 Implementation Roadmap") toMaintenanceBureauPlusDamageTaxRoadmap.md. BCSI was the design's acronym for the Bureau of Colonial Structural Integrity (Plans/MaintenanceBureauPlus/Plans/RepairArchive/plan.md:114), the design that became Maintenance Bureau Plus, and the repo does not use invented acronyms for mod names. The acronym is spelled out in the intro and in the Steps heading; the name now uses the mod's name plus the design's own concept name, "Damage Tax". The intro gained one sentence saying the mod replaced this design at v1 scope (Plans/MaintenanceBureauPlus/RESEARCH.md:3, 122, 154); both new sources are in the frontmatter. The original source pathPlans/RepairPrototype/plan.mdno longer exists: the archive moved toPlans/MaintenanceBureauPlus/Plans/RepairArchive/plan.md, whose section 16 (lines 502-509) is now a stub that links here. No claim was re-verified or changed, so the section stamps stay as they were. Links updated: theResearch/INDEX.mdrow (moved to its alphabetical place) andPlans/MaintenanceBureauPlus/Plans/RepairArchive/plan.md:509, whose relative path had also gone stale when the archive moved two folders deeper.
Open questions¶
None at creation.