feat: auto-gate radiators on heat network surplus
Radiators and Thermal Canister Missile launchers pull from the same heat pool with identical NetworkResourceOutput settings, and priorities.rules defines no ordering for heat. A constantly-running radiator therefore spends missile ammunition to make steam. Gate radiator dissipation on three network signals instead of the raw PowerToggle: a 98%/94% hysteresis band on the thermal battery, whether any launcher is actually set to thermal ammo, and an override driven by the engine's own OverflowHeatStorage as a safety net. Storage fullness causes no damage on its own -- only overflow does, and only above 350 status per tile -- so the band sits high deliberately to keep the network full as a missile reserve. Signal polarity is "hold", not "vent", so any ship missing a broadcaster falls back to vanilla behaviour. Includes an offline validation suite that resolves every patch target, component reference and component Type against the installed game data, since all three otherwise fail only as a crash on game load. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oLWY1G6S8U35bi2FxVWni
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// ABOUT ME
|
||||
// A single component merged into the Missile Launcher. It broadcasts, over the
|
||||
// heat network, whether this launcher is currently set to Thermal Canister
|
||||
// Missiles.
|
||||
//
|
||||
// Why it exists: banking heat is only worth anything if something on the ship
|
||||
// actually spends heat as ammunition. On a ship with no thermal launchers,
|
||||
// holding the heat network near full buys nothing, so the radiators should just
|
||||
// behave as they do in vanilla. Radiators treat the absence of this broadcast
|
||||
// as permission to vent freely.
|
||||
//
|
||||
// ThermalMissilesToggle is the launcher's own vanilla mode toggle
|
||||
// (ModeToggle, Mode = MissileType, OnMode = 4), so this signal follows the
|
||||
// player's ammunition selection live, including mid-battle switches.
|
||||
|
||||
NetworkedThermalAmmoUser
|
||||
{
|
||||
Type = NetworkToggle
|
||||
ToggleSource = ThermalMissilesToggle
|
||||
Categories = [ auto_radiator_ammo_user ]
|
||||
IncludeInPhysical = true
|
||||
IncludeInBlueprints = false
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// ABOUT ME
|
||||
// Components merged into base_part_overclock, the shared base for every
|
||||
// overclockable part. They form the mod's safety net.
|
||||
//
|
||||
// Why it exists: the threshold band on the thermal battery is a prediction. It
|
||||
// can be wrong -- if the ship generates heat faster than its radiators can
|
||||
// clear it, or if heat pipe topology cannot deliver to the batteries quickly
|
||||
// enough, heat overflows regardless of what percentage the band is set to.
|
||||
//
|
||||
// OverflowHeatStorage is the engine's own ground truth for that: heat only ever
|
||||
// reaches it when the network has already refused the heat, which is the exact
|
||||
// moment the part starts cooking itself. Any part in that state forces every
|
||||
// radiator on the network to vent, ignoring the band entirely.
|
||||
//
|
||||
// The timer holds the signal for a few seconds so a stream of per-tick overflow
|
||||
// events becomes one steady "vent now" rather than a flicker.
|
||||
|
||||
Overflow_VentTimer
|
||||
{
|
||||
Type = Timer
|
||||
Duration = 3
|
||||
StartExpired = true
|
||||
StartTrigger = OverflowHeatStorage
|
||||
ResetTrigger = OverflowHeatStorage
|
||||
}
|
||||
|
||||
Overflow_NetworkedForceVent
|
||||
{
|
||||
Type = NetworkToggle
|
||||
ToggleSource = Overflow_VentTimer
|
||||
Categories = [ auto_radiator_force_vent ]
|
||||
IncludeInPhysical = true
|
||||
IncludeInBlueprints = false
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
// ABOUT ME
|
||||
// Components merged into the Radiator. They combine the three network signals
|
||||
// this mod broadcasts into a single gate, AutoPowerToggle, which mod.rules then
|
||||
// substitutes for the radiator's vanilla PowerToggle on the parts of the
|
||||
// radiator that actually dissipate heat.
|
||||
//
|
||||
// The player's manual on/off switch (PowerToggle) is preserved and still wins:
|
||||
// a radiator the player has switched off stays off. The automation can only
|
||||
// idle a radiator the player has left on.
|
||||
//
|
||||
// A radiator vents when ANY of these hold:
|
||||
// - the heat network is not asking it to hold (no battery, or battery full)
|
||||
// - no launcher on the network is using thermal ammunition
|
||||
// - some part is overflowing heat right now (safety net, overrides all)
|
||||
|
||||
HoldVentReceiver
|
||||
{
|
||||
Type = NetworkToggleReceiver
|
||||
Categories = [ auto_radiator_hold ]
|
||||
Mode = Any
|
||||
AllowUncategorized = false
|
||||
}
|
||||
|
||||
ThermalAmmoReceiver
|
||||
{
|
||||
Type = NetworkToggleReceiver
|
||||
Categories = [ auto_radiator_ammo_user ]
|
||||
Mode = Any
|
||||
AllowUncategorized = false
|
||||
}
|
||||
|
||||
ForceVentReceiver
|
||||
{
|
||||
Type = NetworkToggleReceiver
|
||||
Categories = [ auto_radiator_force_vent ]
|
||||
Mode = Any
|
||||
AllowUncategorized = false
|
||||
}
|
||||
|
||||
NotHolding
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ HoldVentReceiver ]
|
||||
Mode = None
|
||||
}
|
||||
|
||||
NoThermalAmmo
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ ThermalAmmoReceiver ]
|
||||
Mode = None
|
||||
}
|
||||
|
||||
VentAllowed
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ NotHolding, NoThermalAmmo, ForceVentReceiver ]
|
||||
Mode = Any
|
||||
}
|
||||
|
||||
// The replacement gate. PowerToggle is the radiator's vanilla UIToggle, so the
|
||||
// player's switch remains the master control.
|
||||
AutoPowerToggle
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ PowerToggle, VentAllowed ]
|
||||
Mode = All
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
// ABOUT ME
|
||||
// Components merged into the Thermal Battery. The battery is the ship's heat
|
||||
// gauge, so it is what decides whether the heat network has surplus worth
|
||||
// venting, and broadcasts that decision to every radiator on the network.
|
||||
//
|
||||
// Polarity is deliberate: the battery broadcasts "HOLD" (do not vent), not
|
||||
// "vent". A ship with no thermal battery therefore has no broadcaster, every
|
||||
// radiator's receiver reads off, and radiators behave exactly as in vanilla.
|
||||
//
|
||||
// Heat storage fullness causes no damage on its own -- damage only occurs when
|
||||
// the network refuses heat and it overflows onto the producing part
|
||||
// (base_part_overclock.rules: HeatDistributionStorage adds InOrder, network
|
||||
// first, OverflowHeatStorage second). So the band sits high on purpose, keeping
|
||||
// the network full as a deep ammunition reserve for Thermal Canister Missiles.
|
||||
|
||||
// Vent when the battery is essentially full.
|
||||
VentCeiling
|
||||
{
|
||||
Type = ThresholdToggle
|
||||
ValueFrom = HeatStorage
|
||||
MinAmount = 98%
|
||||
}
|
||||
|
||||
// Stop venting once there is real headroom again.
|
||||
VentFloor
|
||||
{
|
||||
Type = ThresholdToggle
|
||||
ValueFrom = HeatStorage
|
||||
MaxAmount = 94%
|
||||
}
|
||||
|
||||
VentCeilingTrigger
|
||||
{
|
||||
Type = ToggleTrigger
|
||||
Toggle = VentCeiling
|
||||
TriggerWhenOn = true
|
||||
TriggerWhenOff = false
|
||||
}
|
||||
|
||||
VentFloorTrigger
|
||||
{
|
||||
Type = ToggleTrigger
|
||||
Toggle = VentFloor
|
||||
TriggerWhenOn = true
|
||||
TriggerWhenOff = false
|
||||
}
|
||||
|
||||
// The deadband: latches on at the ceiling, stays on until the floor is reached.
|
||||
// Without this the radiators would chatter on and off at the threshold.
|
||||
VentLatch
|
||||
{
|
||||
Type = TriggeredToggle
|
||||
OnTrigger = VentCeilingTrigger
|
||||
OffTrigger = VentFloorTrigger
|
||||
}
|
||||
|
||||
// OR the raw ceiling back in, so a ship that loads already above the ceiling
|
||||
// vents immediately instead of waiting for a threshold crossing that never comes.
|
||||
VentActive
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ VentLatch, VentCeiling ]
|
||||
Mode = Any
|
||||
}
|
||||
|
||||
HoldVent
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ VentActive ]
|
||||
Mode = None
|
||||
}
|
||||
|
||||
NetworkedHoldVent
|
||||
{
|
||||
Type = NetworkToggle
|
||||
ToggleSource = HoldVent
|
||||
Categories = [ auto_radiator_hold ]
|
||||
IncludeInPhysical = true
|
||||
IncludeInBlueprints = false
|
||||
}
|
||||
Reference in New Issue
Block a user