From 6479f6fcfafb18e9955f4b1630a6fd13915b9a0f Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 15 Jun 2026 19:54:54 +0100 Subject: [PATCH] Bypass config for AetherDrive --- .voidbot/state/aetheria.cc | Bin 125702 -> 128137 bytes Aetheria.State/README.md | 10 +- .../ServerShared/Behaviors/AetherDrive.cs | 120 ++++++------------ .../ServerShared/Behaviors/Behaviors.cs | 15 +++ Assets/Scripts/ServerShared/ItemManager.cs | 35 +---- docs/aetheria-perfect-machine-map.md | 10 +- 6 files changed, 70 insertions(+), 120 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index a932cbd92fde8ca5b6e36427ca382713dd1e72f9..09423f081464e10b4e7f520484172ab795a8ed73 100644 GIT binary patch delta 1463 zcmZuxO=w+36lRiOT7PTX{8$Vfp^K)x-|FjY6S3IDO2L#6Q;<>@lY7s*Z^*qfFEewK zJU2lqg;J5it;{0m#=lxcTTz1`)-38qaN$A|rL6^BxNFvx;F)*ti;v>!a?js)&Ud~u z=YHuu|99`z54*Nko*pS5EF7v$9=BAGkG6sTyVpsu-|@7&b)Z}c`$WQL!i4lWCac0n282dV*MAt7R7gW3 zEW&1yhgcXMfg=v7%`0RT4N^FQw7-NH_w3pM+~e_RcEVO>WvZeIH7RdJA9+QFj(@Vf_yi)M+|PN4;dz z&T`@F!rAvwdh4%@jTBF5uru$H(nG9uc)mM4dvbz2X*Z9M{-dQ+c%4mT5sK5X@D;<| zL=AUVPUCoX*j=5zu*l7r^nsQNpTa!%L3rT!yJR=ViErO}hx8TK^Q|7Kj*%wt+o>hG zz?8rf(ycj46qG_j3--q^iMGW{sJVX%gzm_PGN3w=DB>2fT^%E{&fiatCf~g=)EhWL z4Nbm3u_w9pYOnq4C&HY+k9?C{JU2)RcJ5a)@Yvyz^yw;BpQ#)^RI%4SBZIm7jHll> zEYNRXPATE+6L-Fl*9|V@3}xJ91GUd?JLeOT@AZF0SBE0^6%dSUA~3t9eyyuK}+pn5Rb=pI-Zy+c;FKiD=^ GPyY)-1skXU delta 211 zcmeBt$=-I2eZw*)E+Y#oBXd1tQ`4x4jG~i|GIhg5%niXJ`OH-?5es9m2nUNi)2)-u znk?HjSr}&rFbZxz8p8OmlY3QWUUF$tVo7Fx-gNz!jG}y|A%;N1A?6z!PQJh_2{p;Y z& _axis = clamp(value, -1, 1); } - public AetherDrive(AetherDriveConfig data, EquippedItem item) : base(data, item) + public AetherDrive(RuntimeBehaviorDefinition definition, EquippedItem item) : base(definition, item) { - _rotorDiameter = data.RotorDiameter; - _rotorMass = data.RotorMass; - _maximumRpm = data.MaximumRpm; - _couplingLambda = data.CouplingLambda; - _lambdaMultiplier = data.LambdaMultiplier; - _couplingEfficiency = data.CouplingEfficiency; - _torque = data.Torque; - _torqueProfile = data.TorqueProfile; - _energyDraw = data.EnergyDraw; - _passiveCoupling = data.PassiveCoupling; - _rpmAudioParameter = data.RpmAudioParameter; - _torqueRatioAudioParameter = data.TorqueRatioAudioParameter; - Particles = data.Particles; + _rotorDiameter = definition.Float3(1); + _rotorMass = definition.Float3(2); + _maximumRpm = definition.PerformanceStat(3, null); + _couplingLambda = definition.Float3(4); + _lambdaMultiplier = definition.PerformanceStat(5, null); + _couplingEfficiency = definition.PerformanceStat(6, null); + _torque = definition.PerformanceStat(7, null); + _torqueProfile = definition.BezierCurve(8, null); + _energyDraw = definition.PerformanceStat(9, null); + _passiveCoupling = definition.PerformanceStat(10, null); + _rpmAudioParameter = definition.UInt(11); + _torqueRatioAudioParameter = definition.UInt(12); + Particles = definition.String(13); + RegisterAetherDriveStats(); } - public AetherDrive(AetherDriveConfig data, ConsumableItemEffect item) : base(data, item) + public AetherDrive(RuntimeBehaviorDefinition definition, ConsumableItemEffect item) : base(definition, item) { - _rotorDiameter = data.RotorDiameter; - _rotorMass = data.RotorMass; - _maximumRpm = data.MaximumRpm; - _couplingLambda = data.CouplingLambda; - _lambdaMultiplier = data.LambdaMultiplier; - _couplingEfficiency = data.CouplingEfficiency; - _torque = data.Torque; - _torqueProfile = data.TorqueProfile; - _energyDraw = data.EnergyDraw; - _passiveCoupling = data.PassiveCoupling; - _rpmAudioParameter = data.RpmAudioParameter; - _torqueRatioAudioParameter = data.TorqueRatioAudioParameter; - Particles = data.Particles; + _rotorDiameter = definition.Float3(1); + _rotorMass = definition.Float3(2); + _maximumRpm = definition.PerformanceStat(3, null); + _couplingLambda = definition.Float3(4); + _lambdaMultiplier = definition.PerformanceStat(5, null); + _couplingEfficiency = definition.PerformanceStat(6, null); + _torque = definition.PerformanceStat(7, null); + _torqueProfile = definition.BezierCurve(8, null); + _energyDraw = definition.PerformanceStat(9, null); + _passiveCoupling = definition.PerformanceStat(10, null); + _rpmAudioParameter = definition.UInt(11); + _torqueRatioAudioParameter = definition.UInt(12); + Particles = definition.String(13); + RegisterAetherDriveStats(); + } + + private void RegisterAetherDriveStats() + { + RegisterPerformanceStat(nameof(MaximumRpm), _maximumRpm); + RegisterPerformanceStat("LambdaMultiplier", _lambdaMultiplier); + RegisterPerformanceStat("CouplingEfficiency", _couplingEfficiency); + RegisterPerformanceStat("Torque", _torque); + RegisterPerformanceStat("EnergyDraw", _energyDraw); + RegisterPerformanceStat("PassiveCoupling", _passiveCoupling); } public override bool Execute(float dt) diff --git a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs index 371028100..85efdd8b3 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs @@ -229,6 +229,16 @@ public sealed class RuntimeBehaviorDefinition return _fields.TryGetValue(key, out var value) ? (float)value.NumberValue : fallback; } + public uint UInt(int key, uint fallback = 0) + { + return _fields.TryGetValue(key, out var value) ? checked((uint)value.NumberValue) : fallback; + } + + public float3 Float3(int key, float3 fallback = default) + { + return _fields.TryGetValue(key, out var value) ? ToFloat3(value) : fallback; + } + public string String(int key, string fallback = "") { return _fields.TryGetValue(key, out var value) ? value.StringValue ?? "" : fallback; @@ -309,6 +319,11 @@ public sealed class RuntimeBehaviorDefinition return new float4(ChildFloat(value, 0), ChildFloat(value, 1), ChildFloat(value, 2), ChildFloat(value, 3)); } + private static float3 ToFloat3(AetheriaRuntimeBehaviorValue value) + { + return new float3(ChildFloat(value, 0), ChildFloat(value, 1), ChildFloat(value, 2)); + } + private static float ChildFloat(AetheriaRuntimeBehaviorValue value, int index) { return value.Children.Count > index ? (float)value.Children[index].NumberValue : 0; diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index b7cad3705..ac3670a2f 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -93,6 +93,7 @@ public class ItemManager switch (payload.Kind) { case "Cockpit": return new Cockpit(definition, item); + case "AetherDrive": return new AetherDrive(definition, item); case "Capacitor": return new Capacitor(definition, item); case "Cooldown": return new Cooldown(definition, item); case "EnergyDraw": return new EnergyDraw(definition, item); @@ -126,6 +127,7 @@ public class ItemManager switch (payload.Kind) { case "Cockpit": return new Cockpit(definition, effect); + case "AetherDrive": return new AetherDrive(definition, effect); case "Capacitor": return new Capacitor(definition, effect); case "Cooldown": return new Cooldown(definition, effect); case "EnergyDraw": return new EnergyDraw(definition, effect); @@ -157,7 +159,6 @@ public class ItemManager { switch (payload.Kind) { - case "AetherDrive": return Configure(new AetherDriveConfig(), payload, ApplyAetherDriveConfig); case "AutoWeapon": return Configure(new AutoWeaponConfig(), payload, ApplyInstantWeaponConfig); case "ChargedWeapon": return Configure(new ChargedWeaponConfig(), payload, ApplyChargedWeaponConfig); case "ConstantWeapon": return Configure(new ConstantWeaponConfig(), payload, ApplyConstantWeaponConfig); @@ -178,23 +179,6 @@ public class ItemManager return config; } - private static void ApplyAetherDriveConfig(AetherDriveConfig config, BehaviorPayloadReader reader) - { - config.RotorDiameter = reader.Float3(1, config.RotorDiameter); - config.RotorMass = reader.Float3(2, config.RotorMass); - config.MaximumRpm = reader.PerformanceStat(3, config.MaximumRpm); - config.CouplingLambda = reader.Float3(4, config.CouplingLambda); - config.LambdaMultiplier = reader.PerformanceStat(5, config.LambdaMultiplier); - config.CouplingEfficiency = reader.PerformanceStat(6, config.CouplingEfficiency); - config.Torque = reader.PerformanceStat(7, config.Torque); - config.TorqueProfile = reader.BezierCurve(8, config.TorqueProfile); - config.EnergyDraw = reader.PerformanceStat(9, config.EnergyDraw); - config.PassiveCoupling = reader.PerformanceStat(10, config.PassiveCoupling); - config.RpmAudioParameter = reader.UInt(11, config.RpmAudioParameter); - config.TorqueRatioAudioParameter = reader.UInt(12, config.TorqueRatioAudioParameter); - config.Particles = reader.String(13, config.Particles); - } - private static void ApplyWeaponConfig(WeaponConfig config, BehaviorPayloadReader reader) { config.DamageType = reader.Enum(1, config.DamageType); @@ -317,11 +301,6 @@ public class ItemManager return _fields.TryGetValue(key, out var value) ? checked((int)value.NumberValue) : fallback; } - public uint UInt(int key, uint fallback = 0) - { - return _fields.TryGetValue(key, out var value) ? checked((uint)value.NumberValue) : fallback; - } - public string ItemKey(int key, string fallback = "") { return _fields.TryGetValue(key, out var value) && @@ -346,11 +325,6 @@ public class ItemManager return (T)System.Enum.ToObject(typeof(T), checked((int)value.NumberValue)); } - public float3 Float3(int key, float3 fallback = default) - { - return _fields.TryGetValue(key, out var value) ? ToFloat3(value) : fallback; - } - public float4[] Float4Array(int key, float4[] fallback) { return _fields.TryGetValue(key, out var value) @@ -404,11 +378,6 @@ public class ItemManager }; } - private static float3 ToFloat3(AetheriaRuntimeBehaviorValue value) - { - return new float3(ChildFloat(value, 0), ChildFloat(value, 1), ChildFloat(value, 2)); - } - private static float4 ToFloat4(AetheriaRuntimeBehaviorValue value) { return new float4(ChildFloat(value, 0), ChildFloat(value, 1), ChildFloat(value, 2), ChildFloat(value, 3)); diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 3bf41138e..7781171e6 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -333,9 +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. + Reactor, Radiator, Sensor, StatModifier, and AetherDrive 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 @@ -1485,6 +1485,10 @@ First Aetheria surfaces to publish: stats, curves, enum, scalar, and stat-reference fields directly, and live behavior instances explicitly expose the stat names used by `StatModifier`. + - Done: delete `AetherDriveConfig`. `RuntimeBehaviorDefinition` now reads + rotor geometry, RPM/coupling/torque/energy/passive-coupling stats, torque + curve, audio parameters, and particle prefab path directly; the remaining + `RuntimeBehaviorConfig` bridge is weapon-family-only. - Done: delete `LegacyPayloadKeyAttribute` from live Unity source after importer constants and explicit typed mappers became the only migrated field-key authorities.