From 70c9e965a1feffe9ad6754c8177a37770a61a04d Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 15 Jun 2026 19:29:34 +0100 Subject: [PATCH] Bypass configs for heavy behaviors --- .voidbot/state/aetheria.cc | Bin 125076 -> 125702 bytes Aetheria.State/README.md | 3 + .../ServerShared/Behaviors/Behaviors.cs | 55 +++++++++++ .../ServerShared/Behaviors/Radiator.cs | 71 +++++-------- .../Scripts/ServerShared/Behaviors/Reactor.cs | 55 ++++------- .../Scripts/ServerShared/Behaviors/Sensor.cs | 93 ++++++------------ .../ServerShared/Behaviors/StatModifier.cs | 53 +++------- Assets/Scripts/ServerShared/ItemManager.cs | 51 ++-------- docs/aetheria-perfect-machine-map.md | 8 ++ 9 files changed, 166 insertions(+), 223 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 2cbfab6381fabff87dea79bdcb77fe091433e3ef..a932cbd92fde8ca5b6e36427ca382713dd1e72f9 100644 GIT binary patch delta 1010 zcmZ9L+e;Kt9LGD}FKHU$B6c}h5YnjZuBMhnrqM++UGqf*JI(xd=hQf}otfQjr7KYn zy%bDz9x5t|f-;JP)|ZfalR#3!8|uH%<*go~Gc&tkJq`0azwe*$4q(q5g_p- z)(yQb0VHbZcFkNXs^$yRNV1>LDV=hR#le&?=&=zAn=;V|lQ7X0Y+A&sV-N-gx(ql> zK~qeuPzJK4B_*6tsRmf1aj*}~_o6X=`xUAzr=~b8ff*<<85C?8eEKu04%dar2-T8U zrN9W2)#P4$5L6PU1``KSO~W!_jDm?}Ll4u4^D!+JlP!apIHrphY^jFn%%KwvpJr5v z05%djh;_mME1&_74kBO8{T?`P;V3apY^p{~Q}Bop2iy*p3apbk0}n53-X;k_(8WQT zMxsJk{9%t#dRYEw9#s^(EF5tQc;6)QZK9S5TDblN(PhxQpA5u_HoZE~v3 zKCx6Xet7X6M&0)BpV&dYtDxR%2#JRF@hiVp%TO=xTaT(5(zJ*`dk{tioeswk3HJ;7 zLfeDy8RA%!`cjN8=h|;0+wE^3i}=tiDz(oHl delta 719 zcmX|9%}Z2K6z}?xUj$~PSVpH!FfcQYI-p~2q}nx7Dg`a{#||It`98qlR?bu=0quA|yp&Npq{Tu-$8-fSDqBjcr_PS$cg znak9t7FR+hVaDO;vQT~`sZQ!Km~~_+PLa+jX+6pVs<9|0`)dEh=6Bmhb{4OP1oo16#;&%lXlwS7&~+Y>s!b7KAK_FEw1`tKjO5OEjdLJhY=%UnoU z)&5rhJb0oK8xBA%`N&MGf~r{DG!%I*p`{G2BfJ&ha6=H{L&S}+OA)iYCM z?RfRwEE!xmI-YDUJlG}u?G1D;{Iy5=!o(hV-#}zD@x`q+5ZNJp(A*b3*(djp07EgL Sw|eOZ+34u36J>|9bN>L_*9kEI diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index fcce429cd..5151a8b11 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -208,6 +208,9 @@ runtime performance stats explicitly for `StatModifier`. Capacitor, Shield, MiningTool, ResourceScanner, Thermotoggle, and Thruster now follow the same direct-definition path; the temporary config bridge no longer constructs those medium behavior classes. +Reactor, Radiator, Sensor, and StatModifier also read typed payload fields +through `RuntimeBehaviorDefinition`; the bridge no longer owns their +construction or stat reflection. `ItemManager` currently owns the explicit typed-payload-to-config bridge. Typed name-file documents are `aetheria.name_file.v2` records. They carry the legacy ID, display name, count, compact sample names for surfaces, and the full diff --git a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs index 7d6d75f19..371028100 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs @@ -247,6 +247,51 @@ public sealed class RuntimeBehaviorDefinition return _fields.TryGetValue(key, out var value) ? ToPerformanceStat(value) : fallback; } + public BezierCurve BezierCurve(int key, BezierCurve fallback) + { + if (!_fields.TryGetValue(key, out var value)) + { + return fallback; + } + + return new BezierCurve + { + Keys = value.Children.Count > 0 + ? value.Children[0].Children.Select(ToFloat4).ToArray() + : Array.Empty() + }; + } + + public StatReference StatReference(int key, StatReference fallback) + { + if (!_fields.TryGetValue(key, out var value)) + { + return fallback; + } + + return new StatReference + { + Target = ChildString(value, 1), + Stat = ChildString(value, 2) + }; + } + + public T Enum(int key, T fallback) where T : struct + { + if (!_fields.TryGetValue(key, out var value)) + { + return fallback; + } + + if (!string.IsNullOrWhiteSpace(value.StringValue) && + System.Enum.TryParse(value.StringValue, true, out T parsed)) + { + return parsed; + } + + return (T)System.Enum.ToObject(typeof(T), checked((int)value.NumberValue)); + } + private static PerformanceStat ToPerformanceStat(AetheriaRuntimeBehaviorValue value) { return new PerformanceStat @@ -259,10 +304,20 @@ public sealed class RuntimeBehaviorDefinition }; } + private static float4 ToFloat4(AetheriaRuntimeBehaviorValue value) + { + return new float4(ChildFloat(value, 0), ChildFloat(value, 1), ChildFloat(value, 2), ChildFloat(value, 3)); + } + private static float ChildFloat(AetheriaRuntimeBehaviorValue value, int index) { return value.Children.Count > index ? (float)value.Children[index].NumberValue : 0; } + + private static string ChildString(AetheriaRuntimeBehaviorValue value, int index) + { + return value.Children.Count > index ? value.Children[index].StringValue ?? "" : ""; + } } [Inspectable] diff --git a/Assets/Scripts/ServerShared/Behaviors/Radiator.cs b/Assets/Scripts/ServerShared/Behaviors/Radiator.cs index 626d1036a..4ee732dec 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Radiator.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Radiator.cs @@ -5,38 +5,6 @@ using Unity.Mathematics; using static Unity.Mathematics.math; -[Inspectable] -public class RadiatorConfig : RuntimeBehaviorConfig -{ - [Inspectable] - public PerformanceStat Emissivity = new PerformanceStat(); - - [Inspectable] - public PerformanceStat PumpedHeat = new PerformanceStat(); - - [InspectableTemperature] - public float TemperatureFloor; - - [Inspectable] - public PerformanceStat WasteHeat = new PerformanceStat(); - - [Inspectable] - public PerformanceStat EnergyUsage = new PerformanceStat(); - - [Inspectable] - public PerformanceStat ThermalMass = new PerformanceStat(); - - public override Behavior CreateInstance(EquippedItem item) - { - return new Radiator(this, item); - } - - public override Behavior CreateInstance(ConsumableItemEffect item) - { - return new Radiator(this, item); - } -} - public class Radiator : Behavior, IAlwaysUpdatedBehavior, IInitializableBehavior { public float RadiatorTemperature { get; private set; } @@ -53,23 +21,34 @@ public class Radiator : Behavior, IAlwaysUpdatedBehavior, IInitializableBehavior private readonly PerformanceStat _energyUsage; private readonly PerformanceStat _thermalMass; - public Radiator(RadiatorConfig data, EquippedItem item) : base(data, item) + public Radiator(RuntimeBehaviorDefinition definition, EquippedItem item) : base(definition, item) { - _emissivity = data.Emissivity; - _pumpedHeat = data.PumpedHeat; - _temperatureFloor = data.TemperatureFloor; - _wasteHeat = data.WasteHeat; - _energyUsage = data.EnergyUsage; - _thermalMass = data.ThermalMass; + _emissivity = definition.PerformanceStat(1, new PerformanceStat()); + _pumpedHeat = definition.PerformanceStat(2, new PerformanceStat()); + _temperatureFloor = definition.Float(3); + _wasteHeat = definition.PerformanceStat(4, new PerformanceStat()); + _energyUsage = definition.PerformanceStat(5, new PerformanceStat()); + _thermalMass = definition.PerformanceStat(6, new PerformanceStat()); + RegisterPerformanceStat(nameof(Emissivity), _emissivity); + RegisterPerformanceStat(nameof(PumpedHeat), _pumpedHeat); + RegisterPerformanceStat(nameof(WasteHeat), _wasteHeat); + RegisterPerformanceStat(nameof(EnergyUsage), _energyUsage); + RegisterPerformanceStat("ThermalMass", _thermalMass); } - public Radiator(RadiatorConfig data, ConsumableItemEffect item) : base(data, item) + + public Radiator(RuntimeBehaviorDefinition definition, ConsumableItemEffect item) : base(definition, item) { - _emissivity = data.Emissivity; - _pumpedHeat = data.PumpedHeat; - _temperatureFloor = data.TemperatureFloor; - _wasteHeat = data.WasteHeat; - _energyUsage = data.EnergyUsage; - _thermalMass = data.ThermalMass; + _emissivity = definition.PerformanceStat(1, new PerformanceStat()); + _pumpedHeat = definition.PerformanceStat(2, new PerformanceStat()); + _temperatureFloor = definition.Float(3); + _wasteHeat = definition.PerformanceStat(4, new PerformanceStat()); + _energyUsage = definition.PerformanceStat(5, new PerformanceStat()); + _thermalMass = definition.PerformanceStat(6, new PerformanceStat()); + RegisterPerformanceStat(nameof(Emissivity), _emissivity); + RegisterPerformanceStat(nameof(PumpedHeat), _pumpedHeat); + RegisterPerformanceStat(nameof(WasteHeat), _wasteHeat); + RegisterPerformanceStat(nameof(EnergyUsage), _energyUsage); + RegisterPerformanceStat("ThermalMass", _thermalMass); } public override bool Execute(float dt) diff --git a/Assets/Scripts/ServerShared/Behaviors/Reactor.cs b/Assets/Scripts/ServerShared/Behaviors/Reactor.cs index 03c705c5f..b182b41dd 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Reactor.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Reactor.cs @@ -9,32 +9,6 @@ using UniRx; using Unity.Mathematics; using static Unity.Mathematics.math; -[Inspectable] -public class ReactorConfig : RuntimeBehaviorConfig -{ - [Inspectable] - public PerformanceStat Charge = new PerformanceStat(); - - [Inspectable] - public PerformanceStat Efficiency = new PerformanceStat(); - - [Inspectable] - public PerformanceStat OverloadEfficiency = new PerformanceStat(); - - [Inspectable] - public PerformanceStat ThrottlingFactor = new PerformanceStat(); - - public override Behavior CreateInstance(EquippedItem item) - { - return new Reactor(this, item); - } - - public override Behavior CreateInstance(ConsumableItemEffect item) - { - return new Reactor(this, item); - } -} - public class Reactor : Behavior, IOrderedBehavior, IDisposable { private readonly PerformanceStat _charge; @@ -52,20 +26,29 @@ public class Reactor : Behavior, IOrderedBehavior, IDisposable private List _subscriptions = new List(); - public Reactor(ReactorConfig data, EquippedItem item) : base(data, item) + public Reactor(RuntimeBehaviorDefinition definition, EquippedItem item) : base(definition, item) { - _charge = data.Charge; - _efficiency = data.Efficiency; - _overloadEfficiency = data.OverloadEfficiency; - _throttlingFactor = data.ThrottlingFactor; + _charge = definition.PerformanceStat(1, new PerformanceStat()); + _efficiency = definition.PerformanceStat(2, new PerformanceStat()); + _overloadEfficiency = definition.PerformanceStat(3, new PerformanceStat()); + _throttlingFactor = definition.PerformanceStat(4, new PerformanceStat()); + RegisterPerformanceStat("Charge", _charge); + RegisterPerformanceStat("Efficiency", _efficiency); + RegisterPerformanceStat("OverloadEfficiency", _overloadEfficiency); + RegisterPerformanceStat("ThrottlingFactor", _throttlingFactor); FindCapacitors(); } - public Reactor(ReactorConfig data, ConsumableItemEffect item) : base(data, item) + + public Reactor(RuntimeBehaviorDefinition definition, ConsumableItemEffect item) : base(definition, item) { - _charge = data.Charge; - _efficiency = data.Efficiency; - _overloadEfficiency = data.OverloadEfficiency; - _throttlingFactor = data.ThrottlingFactor; + _charge = definition.PerformanceStat(1, new PerformanceStat()); + _efficiency = definition.PerformanceStat(2, new PerformanceStat()); + _overloadEfficiency = definition.PerformanceStat(3, new PerformanceStat()); + _throttlingFactor = definition.PerformanceStat(4, new PerformanceStat()); + RegisterPerformanceStat("Charge", _charge); + RegisterPerformanceStat("Efficiency", _efficiency); + RegisterPerformanceStat("OverloadEfficiency", _overloadEfficiency); + RegisterPerformanceStat("ThrottlingFactor", _throttlingFactor); FindCapacitors(); } diff --git a/Assets/Scripts/ServerShared/Behaviors/Sensor.cs b/Assets/Scripts/ServerShared/Behaviors/Sensor.cs index 956fbfc00..a7913b080 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Sensor.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Sensor.cs @@ -7,47 +7,6 @@ using System.Collections.Generic; using Unity.Mathematics; using static Unity.Mathematics.math; -[Inspectable] -public class SensorConfig : RuntimeBehaviorConfig -{ - [Inspectable] - public PerformanceStat Sensitivity = new PerformanceStat(); - - [InspectableAnimationCurve] - public BezierCurve SensitivityCurve; - - [Inspectable] - public PerformanceStat PingBoost; - - [Inspectable] - public PerformanceStat PingEnergy; - - [Inspectable] - public PerformanceStat PingVisibility; - - [Inspectable] - public PerformanceStat PingRange; - - [Inspectable] - public PerformanceStat PingCooldown; - - [Inspectable] - public float PingDuration = 2; - - [Inspectable] - public float PingRadiusExponent = .5f; - - public override Behavior CreateInstance(EquippedItem item) - { - return new Sensor(this, item); - } - - public override Behavior CreateInstance(ConsumableItemEffect item) - { - return new Sensor(this, item); - } -} - public class Sensor : Behavior, IEventBehavior { private readonly PerformanceStat _sensitivity; @@ -103,30 +62,42 @@ public class Sensor : Behavior, IEventBehavior } } - public Sensor(SensorConfig data, EquippedItem item) : base(data, item) + public Sensor(RuntimeBehaviorDefinition definition, EquippedItem item) : base(definition, item) { - _sensitivity = data.Sensitivity; - _sensitivityCurve = data.SensitivityCurve; - _pingBoost = data.PingBoost; - _pingEnergy = data.PingEnergy; - _pingVisibility = data.PingVisibility; - _pingRange = data.PingRange; - _pingCooldownDuration = data.PingCooldown; - _pingDuration = data.PingDuration; - _pingRadiusExponent = data.PingRadiusExponent; + _sensitivity = definition.PerformanceStat(3, new PerformanceStat()); + _sensitivityCurve = definition.BezierCurve(4, null); + _pingBoost = definition.PerformanceStat(5, null); + _pingEnergy = definition.PerformanceStat(6, null); + _pingVisibility = definition.PerformanceStat(7, null); + _pingRange = definition.PerformanceStat(8, null); + _pingCooldownDuration = definition.PerformanceStat(9, null); + _pingDuration = definition.Float(10, 2); + _pingRadiusExponent = definition.Float(11, .5f); + RegisterPerformanceStats(); } - public Sensor(SensorConfig data, ConsumableItemEffect item) : base(data, item) + public Sensor(RuntimeBehaviorDefinition definition, ConsumableItemEffect item) : base(definition, item) { - _sensitivity = data.Sensitivity; - _sensitivityCurve = data.SensitivityCurve; - _pingBoost = data.PingBoost; - _pingEnergy = data.PingEnergy; - _pingVisibility = data.PingVisibility; - _pingRange = data.PingRange; - _pingCooldownDuration = data.PingCooldown; - _pingDuration = data.PingDuration; - _pingRadiusExponent = data.PingRadiusExponent; + _sensitivity = definition.PerformanceStat(3, new PerformanceStat()); + _sensitivityCurve = definition.BezierCurve(4, null); + _pingBoost = definition.PerformanceStat(5, null); + _pingEnergy = definition.PerformanceStat(6, null); + _pingVisibility = definition.PerformanceStat(7, null); + _pingRange = definition.PerformanceStat(8, null); + _pingCooldownDuration = definition.PerformanceStat(9, null); + _pingDuration = definition.Float(10, 2); + _pingRadiusExponent = definition.Float(11, .5f); + RegisterPerformanceStats(); + } + + private void RegisterPerformanceStats() + { + RegisterPerformanceStat("Sensitivity", _sensitivity); + RegisterPerformanceStat("PingBoost", _pingBoost); + RegisterPerformanceStat("PingEnergy", _pingEnergy); + RegisterPerformanceStat("PingVisibility", _pingVisibility); + RegisterPerformanceStat("PingRange", _pingRange); + RegisterPerformanceStat("PingCooldown", _pingCooldownDuration); } public override bool Execute(float dt) diff --git a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs index 37a8c59d0..6e9308a81 100644 --- a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs +++ b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs @@ -6,31 +6,6 @@ using System; using System.Linq; using GameCult.Aetheria.State.Unity; -[Inspectable] -public class StatModifierConfig : RuntimeBehaviorConfig -{ - [Inspectable] - public StatReference Stat = new StatReference(); - - [Inspectable] - public PerformanceStat Modifier = new PerformanceStat(); - - [Inspectable] - public StatModifierType Type; - - public string RequireBehavior; - - public override Behavior CreateInstance(EquippedItem item) - { - return new StatModifier(this, item); - } - - public override Behavior CreateInstance(ConsumableItemEffect consumable) - { - return new StatModifier(this, consumable); - } -} - [Order(-4)] public class StatModifier : Behavior, IInitializableBehavior, IDisposable, IAlwaysUpdatedBehavior { @@ -49,22 +24,26 @@ public class StatModifier : Behavior, IInitializableBehavior, IDisposable, IAlwa public bool Executed => _executed; public int TargetStatCount => _stats?.Length ?? 0; - public StatModifier(StatModifierConfig data, EquippedItem item) : base(data, item) + public StatModifier(RuntimeBehaviorDefinition definition, EquippedItem item) : base(definition, item) { - _targetBehaviorKind = data.Stat.Target; - _targetStatName = data.Stat.Stat; - _modifier = data.Modifier; - _type = data.Type; - _requiredBehaviorKind = data.RequireBehavior; + var stat = definition.StatReference(1, new StatReference()); + _targetBehaviorKind = stat.Target; + _targetStatName = stat.Stat; + _modifier = definition.PerformanceStat(2, new PerformanceStat()); + _type = definition.Enum(3, default(StatModifierType)); + _requiredBehaviorKind = definition.String(4); + RegisterPerformanceStat("Modifier", _modifier); } - public StatModifier(StatModifierConfig data, ConsumableItemEffect item) : base(data, item) + public StatModifier(RuntimeBehaviorDefinition definition, ConsumableItemEffect item) : base(definition, item) { - _targetBehaviorKind = data.Stat.Target; - _targetStatName = data.Stat.Stat; - _modifier = data.Modifier; - _type = data.Type; - _requiredBehaviorKind = data.RequireBehavior; + var stat = definition.StatReference(1, new StatReference()); + _targetBehaviorKind = stat.Target; + _targetStatName = stat.Stat; + _modifier = definition.PerformanceStat(2, new PerformanceStat()); + _type = definition.Enum(3, default(StatModifierType)); + _requiredBehaviorKind = definition.String(4); + RegisterPerformanceStat("Modifier", _modifier); } public void Initialize() diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index b69c0cc35..b7cad3705 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -100,9 +100,13 @@ public class ItemManager case "HeatStorage": return new HeatStorage(definition, item); case "ItemUsage": return new ItemUsage(definition, item); case "MiningTool": return new MiningTool(definition, item); + case "Radiator": return new Radiator(definition, item); + case "Reactor": return new Reactor(definition, item); case "Reflector": return new Reflector(definition, item); case "ResourceScanner": return new ResourceScanner(definition, item); + case "Sensor": return new Sensor(definition, item); case "Shield": return new Shield(definition, item); + case "StatModifier": return new StatModifier(definition, item); case "Switch": return new Switch(definition, item); case "Thermotoggle": return new Thermotoggle(definition, item); case "Thruster": return new Thruster(definition, item); @@ -129,9 +133,13 @@ public class ItemManager case "HeatStorage": return new HeatStorage(definition, effect); case "ItemUsage": return new ItemUsage(definition, effect); case "MiningTool": return new MiningTool(definition, effect); + case "Radiator": return new Radiator(definition, effect); + case "Reactor": return new Reactor(definition, effect); case "Reflector": return new Reflector(definition, effect); case "ResourceScanner": return new ResourceScanner(definition, effect); + case "Sensor": return new Sensor(definition, effect); case "Shield": return new Shield(definition, effect); + case "StatModifier": return new StatModifier(definition, effect); case "Switch": return new Switch(definition, effect); case "Thermotoggle": return new Thermotoggle(definition, effect); case "Thruster": return new Thruster(definition, effect); @@ -156,10 +164,6 @@ public class ItemManager case "GuidedWeapon": return Configure(new GuidedWeaponConfig(), payload, ApplyGuidedWeaponConfig); case "InstantWeapon": return Configure(new InstantWeaponConfig(), payload, ApplyInstantWeaponConfig); case "Launcher": return Configure(new LauncherConfig(), payload, ApplyLauncherConfig); - case "Radiator": return Configure(new RadiatorConfig(), payload, ApplyRadiatorConfig); - case "Reactor": return Configure(new ReactorConfig(), payload, ApplyReactorConfig); - case "Sensor": return Configure(new SensorConfig(), payload, ApplySensorConfig); - case "StatModifier": return Configure(new StatModifierConfig(), payload, ApplyStatModifierConfig); default: return null; } } @@ -191,45 +195,6 @@ public class ItemManager config.Particles = reader.String(13, config.Particles); } - private static void ApplyRadiatorConfig(RadiatorConfig config, BehaviorPayloadReader reader) - { - config.Emissivity = reader.PerformanceStat(1, config.Emissivity); - config.PumpedHeat = reader.PerformanceStat(2, config.PumpedHeat); - config.TemperatureFloor = reader.Float(3, config.TemperatureFloor); - config.WasteHeat = reader.PerformanceStat(4, config.WasteHeat); - config.EnergyUsage = reader.PerformanceStat(5, config.EnergyUsage); - config.ThermalMass = reader.PerformanceStat(6, config.ThermalMass); - } - - private static void ApplyReactorConfig(ReactorConfig config, BehaviorPayloadReader reader) - { - config.Charge = reader.PerformanceStat(1, config.Charge); - config.Efficiency = reader.PerformanceStat(2, config.Efficiency); - config.OverloadEfficiency = reader.PerformanceStat(3, config.OverloadEfficiency); - config.ThrottlingFactor = reader.PerformanceStat(4, config.ThrottlingFactor); - } - - private static void ApplySensorConfig(SensorConfig config, BehaviorPayloadReader reader) - { - config.Sensitivity = reader.PerformanceStat(3, config.Sensitivity); - config.SensitivityCurve = reader.BezierCurve(4, config.SensitivityCurve); - config.PingBoost = reader.PerformanceStat(5, config.PingBoost); - config.PingEnergy = reader.PerformanceStat(6, config.PingEnergy); - config.PingVisibility = reader.PerformanceStat(7, config.PingVisibility); - config.PingRange = reader.PerformanceStat(8, config.PingRange); - config.PingCooldown = reader.PerformanceStat(9, config.PingCooldown); - config.PingDuration = reader.Float(10, config.PingDuration); - config.PingRadiusExponent = reader.Float(11, config.PingRadiusExponent); - } - - private static void ApplyStatModifierConfig(StatModifierConfig config, BehaviorPayloadReader reader) - { - config.Stat = reader.StatReference(1, config.Stat); - config.Modifier = reader.PerformanceStat(2, config.Modifier); - config.Type = reader.Enum(3, config.Type); - config.RequireBehavior = reader.String(4, config.RequireBehavior); - } - private static void ApplyWeaponConfig(WeaponConfig config, BehaviorPayloadReader reader) { config.DamageType = reader.Enum(1, config.DamageType); diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index c6c250db6..3bf41138e 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -333,6 +333,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. Capacitor, Shield, MiningTool, ResourceScanner, Thermotoggle, and Thruster now follow the same direct-definition path, so the temporary config bridge no longer constructs those medium behavior classes. + Reactor, Radiator, Sensor, and StatModifier also read typed payload fields + through `RuntimeBehaviorDefinition`; their live stat surfaces are registered + explicitly rather than recovered through config reflection. `StatModifier` behavior requirements and behavior-stat targets compare typed behavior kinds on the live equipped behavior instances through `AetheriaRuntimeBehaviorMetadataCatalog` instead of scanning config @@ -1477,6 +1480,11 @@ First Aetheria surfaces to publish: `RuntimeBehaviorDefinition` reads their typed stats, scalar flags, and prefab path directly, and live stat-bearing behavior instances explicitly register the performance-stat names used by `StatModifier`. + - Done: delete `ReactorConfig`, `RadiatorConfig`, `SensorConfig`, and + `StatModifierConfig`. `RuntimeBehaviorDefinition` now reads their typed + stats, curves, enum, scalar, and stat-reference fields directly, and live + behavior instances explicitly expose the stat names used by + `StatModifier`. - Done: delete `LegacyPayloadKeyAttribute` from live Unity source after importer constants and explicit typed mappers became the only migrated field-key authorities.