Nekogod-DSPPowerPriority icon

DSPPowerPriority

Configurable priority buckets for DSP power generation and energy exchanger discharge, with optional limits on exchanger charging sources.

By Nekogod
Last updated 10 hours ago
Total downloads 1
Total rating 0 
Categories Optimization Power Quality of Life
Dependency string Nekogod-DSPPowerPriority-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

xiaoye97-BepInEx-5.4.17 icon
xiaoye97-BepInEx

BepInEx5.4.17 mod plugin framework, Mod框架

Preferred version: 5.4.17

README

DSP Power Priority

Adds configurable priority dispatch to Dyson Sphere Program power networks.

Instead of all generators sharing load equally, each general source type is assigned to a priority bucket. Lower-numbered buckets are used first. Sources with the same priority share load proportionally, preserving DSP's normal behaviour within that bucket.

Designed for DSP 0.10.34.x and BepInEx 5.4.17.

Default priorities

Source Default priority
Wind, solar, ray receivers and geothermal 1
Energy exchangers while discharging 2
Mini fusion plants, artificial stars and thermal plants burning configured high-grade fuel 3
Ordinary thermal generation 4

With the defaults, renewable/non-fuel generation is used first, then accumulator discharge through energy exchangers, then high-grade fuel generation, and ordinary thermal generation last.

Priority numbers do not need to be consecutive. Equal numbers mean equal priority.

For example, setting both EnergyExchangers and HighGradeFuelGeneration to 2 causes them to share the same priority bucket and split the required load proportionally.

Configuration

The config file is generated at:

BepInEx/config/lee.dsp.powerpriority.cfg

Priorities

[Priorities]

NonFuelGeneration = 1
EnergyExchangers = 2
HighGradeFuelGeneration = 3
LowGradeThermalGeneration = 4
  • NonFuelGeneration - Wind turbines, solar panels, ray receivers and geothermal plants.
  • EnergyExchangers - Energy exchangers while discharging charged accumulators.
  • HighGradeFuelGeneration - Mini fusion plants, artificial stars and thermal plants burning a configured high-grade fuel.
  • LowGradeThermalGeneration - Other thermal power plant fuels such as coal, energetic graphite, oil and hydrogen.

Values below 1 are treated as priority 1.

High-grade thermal fuels

[Classification]

HighGradeThermalFuelIds = 1801

A comma-separated list of item IDs which cause an ordinary thermal power plant to use the HighGradeFuelGeneration priority instead of LowGradeThermalGeneration.

The default, 1801, is the vanilla Hydrogen Fuel Rod.

This also allows modded fuels to be classified without changing the mod code.

Energy exchanger charging

[EnergyExchanger]

ChargingMaxSourcePriority = 0

Controls which priority buckets may be brought online solely to charge energy exchangers.

  • 0 - Unrestricted. Matches vanilla charging behaviour and is the default.
  • Positive value - Only source priorities up to and including this number may provide the additional generation needed for exchanger charging.

For example, with the default priorities:

ChargingMaxSourcePriority = 3

allows exchanger charging to use non-fuel generation and high-grade fuel generation, but prevents priority-4 ordinary thermal generation from being started solely to charge accumulators.

This setting does not stop lower-priority generators from serving normal factory demand.

How dispatch works

Suppose a network has:

  • Priority 1 capacity: 600 MW
  • Priority 2 capacity: 800 MW
  • Priority 3 capacity: 2 GW
  • Demand: 1 GW

The result is:

  • Priority 1: 100%
  • Priority 2: 50%
  • Priority 3: 0%

Every supplier within the partially used bucket shares that bucket's load proportionally.

Performance

The mod does not replace PowerSystem.GameTick.

It leaves DSP's generator capacity calculation, fuel consumption, ray receiver behaviour, accumulator logic, statistics, animations and other power-system processing intact, and changes only the dispatch ratios used for power suppliers.

The current implementation performs one lightweight additional scan of the generators and energy exchangers in each active power network. It does not repeat DSP's EnergyCap_* calculations, uses no LINQ in the simulation path, and does not allocate per tick.

Compatibility

Built against Dyson Sphere Program 0.10.34.x.

The Harmony transpiler validates the expected power-system dispatch structure before applying its changes. If a future DSP update changes that structure, the mod is designed to leave vanilla dispatch intact and log an error rather than apply a partial patch.

Installation

Install with r2modman / Thunderstore Mod Manager, or place the compiled DLL in a folder under:

Dyson Sphere Program/BepInEx/plugins/