From 85eca69d37a00e67b3f6a5d2b2f0f54f55051e16 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 15 Jun 2026 17:54:59 +0100 Subject: [PATCH] Stop medium behaviors retaining configs --- .voidbot/state/aetheria.cc | Bin 115612 -> 117740 bytes Aetheria.State/README.md | 3 ++ .../ServerShared/Behaviors/Capacitor.cs | 15 ++++++---- .../Scripts/ServerShared/Behaviors/Cockpit.cs | 6 +--- .../ServerShared/Behaviors/HeatStorage.cs | 6 +--- .../ServerShared/Behaviors/MiningTool.cs | 25 ++++++++++------ .../ServerShared/Behaviors/ResourceScanner.cs | 18 ++++++++---- .../Scripts/ServerShared/Behaviors/Shield.cs | 15 ++++++---- .../Scripts/ServerShared/Behaviors/Switch.cs | 6 +--- .../ServerShared/Behaviors/Thermotoggle.cs | 15 +++++----- .../ServerShared/Behaviors/Thruster.cs | 27 ++++++++++++------ .../UI/Properties Panel/PropertiesPanel.cs | 2 +- docs/aetheria-perfect-machine-map.md | 3 ++ 13 files changed, 83 insertions(+), 58 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 7c5c1e0983d87646f3ddba9c87140866b9033c91..f29db5bbff05149b9b571291657ea14af4bde656 100644 GIT binary patch delta 1411 zcmaJ>O=w(I6y{80Vk-#|ZIe)nSFwqO$<&#onY49bNKqpcN|GXEBX{0AGw-(Vz5BfP zzQl21DE=Y1i9>rA5fnsQqxgfilQxUewHsYVSK?O0gWTIIb zrgkGc{}NT>wGi3Gg{-7P?(3dQrMZ7E)s>7GiOoW>ihGTiW8W z7f7{;b$!)tOv7Y<$MN>{O&A^6$$$8_aJ2ROi^r~g4u|?Xdtk3@!r_7K{3qUmQTyu_ zOxT-c7`E?j!r;L>-9@qPv}MPK?Qj`JAKJGUF3FLJ@%^jP@y0%9$u(Lh9f+j0F+S%q z4?XVO_PDf{P}aNM4~McrR0zynq^p<38Bt&O)w>_^vNY{xTnl-A8YBs{1lgVAC<8BQ2+n{ delta 193 zcmaDeoqbL_`-WvqTqYJ)21a^D#zs*S8AYe_A7Esge4441113EABeVGAeC8^cIuiqs zy2%_Y@=TlKn>AUsYqBuvIxx=L9`3^UuW0(x{fw&9KWt;kyiWNd^BS%QSND;{Dz$O#iOH;w`Tcgi

Item.ThermalPerformance; -} \ No newline at end of file +} diff --git a/Assets/Scripts/ServerShared/Behaviors/Switch.cs b/Assets/Scripts/ServerShared/Behaviors/Switch.cs index 078c632b8..368911124 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Switch.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Switch.cs @@ -19,17 +19,13 @@ public class SwitchConfig : RuntimeBehaviorConfig public class Switch : Behavior, IActivatedBehavior { - private SwitchConfig _data; - public bool Activated { get; set; } public Switch(SwitchConfig data, EquippedItem item) : base(data, item) { - _data = data; } public Switch(SwitchConfig data, ConsumableItemEffect item) : base(data, item) { - _data = data; } public override bool Execute(float dt) @@ -46,4 +42,4 @@ public class Switch : Behavior, IActivatedBehavior { Activated = false; } -} \ No newline at end of file +} diff --git a/Assets/Scripts/ServerShared/Behaviors/Thermotoggle.cs b/Assets/Scripts/ServerShared/Behaviors/Thermotoggle.cs index ce5b13109..f787a3a11 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Thermotoggle.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Thermotoggle.cs @@ -29,23 +29,24 @@ public class ThermotoggleConfig : RuntimeBehaviorConfig public class Thermotoggle : Behavior { public float TargetTemperature; - private ThermotoggleConfig _data; - - public ThermotoggleConfig ThermotoggleConfig => _data; + public bool Adjustable { get; } + private readonly bool _highPass; public Thermotoggle(ThermotoggleConfig data, EquippedItem item) : base(data, item) { - _data = data; TargetTemperature = data.TargetTemperature; + _highPass = data.HighPass; + Adjustable = data.Adjustable; } public Thermotoggle(ThermotoggleConfig data, ConsumableItemEffect item) : base(data, item) { - _data = data; TargetTemperature = data.TargetTemperature; + _highPass = data.HighPass; + Adjustable = data.Adjustable; } public override bool Execute(float dt) { - return Temperature < TargetTemperature ^ _data.HighPass; + return Temperature < TargetTemperature ^ _highPass; } -} \ No newline at end of file +} diff --git a/Assets/Scripts/ServerShared/Behaviors/Thruster.cs b/Assets/Scripts/ServerShared/Behaviors/Thruster.cs index 5ae503cf0..4c7b2f820 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Thruster.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Thruster.cs @@ -46,13 +46,19 @@ public class Thruster : Behavior, IAnalogBehavior set => _input = saturate(value); } - private ThrusterConfig _data; + private readonly PerformanceStat _thrust; + private readonly PerformanceStat _visibility; + private readonly PerformanceStat _heat; + private readonly PerformanceStat _energyUsage; private float _input; public Thruster(ThrusterConfig data, EquippedItem item) : base(data, item) { - _data = data; + _thrust = data.Thrust; + _visibility = data.Visibility; + _heat = data.Heat; + _energyUsage = data.EnergyUsage; ParticlesPrefab = data.ParticlesPrefab; var hullShape = ItemManager.GetRuntimeShape(Entity.Hull); var itemShape = ItemManager.GetRuntimeShape(item.EquippableItem); @@ -60,28 +66,31 @@ public class Thruster : Behavior, IAnalogBehavior var itemCenter = hullShape.Inset(itemShape, item.Position, item.EquippableItem.Rotation).CenterOfMass; var toCenter = hullCenter - itemCenter; Torque = -dot(normalize(toCenter), float2(1, 0).Rotate(item.EquippableItem.Rotation)); - Thrust = Evaluate(_data.Thrust); + Thrust = Evaluate(_thrust); } public Thruster(ThrusterConfig data, ConsumableItemEffect item) : base(data, item) { - _data = data; + _thrust = data.Thrust; + _visibility = data.Visibility; + _heat = data.Heat; + _energyUsage = data.EnergyUsage; ParticlesPrefab = data.ParticlesPrefab; Torque = 0; - Thrust = Evaluate(_data.Thrust); + Thrust = Evaluate(_thrust); } public override bool Execute(float dt) { Item.SetAudioParameter(SpecialAudioParameter.Intensity, _input); - if(_input > .01f && Entity.TryConsumeEnergy(_input * Evaluate(_data.EnergyUsage))) + if(_input > .01f && Entity.TryConsumeEnergy(_input * Evaluate(_energyUsage))) { - Thrust = Evaluate(_data.Thrust); + Thrust = Evaluate(_thrust); Entity.Velocity -= Direction.xz * _input * Thrust / Entity.Mass * dt; Entity.Direction = mul(Entity.Direction, Unity.Mathematics.float2x2.Rotate(_input * Torque * Thrust * ItemManager.GameplaySettings.TorqueMultiplier / Entity.Mass * dt)); - AddHeat(_input * Evaluate(_data.Heat) * dt); - var vis = _input * Evaluate(_data.Visibility); + AddHeat(_input * Evaluate(_heat) * dt); + var vis = _input * Evaluate(_visibility); if (!Entity.VisibilitySources.TryGetValue(this, out var existingVisibility) || vis > existingVisibility) Entity.VisibilitySources[this] = vis; return true; diff --git a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs index 8e697db32..dfea2458b 100644 --- a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs +++ b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs @@ -628,7 +628,7 @@ public class PropertiesPanel : MonoBehaviour { switch (behavior) { - case Thermotoggle thermotoggle when thermotoggle.ThermotoggleConfig.Adjustable: + case Thermotoggle thermotoggle when thermotoggle.Adjustable: AddField("Target Temperature", () => thermotoggle.TargetTemperature, temp => thermotoggle.TargetTemperature = temp); diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index d5170b282..0c12a1add 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -309,6 +309,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. config subclasses after construction. Wear, Visibility, Reflector, VelocityLimit, VelocityConversion, and ItemUsage now follow the same rule for their constructor stat/key/scalar inputs. + Capacitor, Shield, Thruster, MiningTool, ResourceScanner, Thermotoggle, + Switch, HeatStorage, and Cockpit have also dropped runtime config retention; + Thermotoggle adjustability is now owned by the live behavior instance. `StatModifier` behavior requirements and behavior-stat targets compare typed behavior kinds on the live equipped behavior instances through `AetheriaRuntimeBehaviorMetadataCatalog` instead of scanning config