From 0ffbaf9ce8b33d6855bf056a7b3295e2740c0fc1 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 15:55:03 +0100 Subject: [PATCH] Persist AetherDrive state in typed snapshots --- .voidbot/state/aetheria.cc | Bin 85513 -> 85638 bytes Aetheria.State.Smoke/Program.cs | 27 +++++++++++++ Aetheria.State.Unity.Smoke/Program.cs | 30 +++++++++++++- .../AetheriaRuntimeCommitLogApplier.cs | 14 ++++++- .../AetheriaRuntimeStateDocuments.cs | 36 +++++++++++++++++ Assets/Scripts/Gameplay/ActionGameManager.cs | 18 +++++++++ .../Runtime/AetheriaRuntimeCatalogSnapshot.cs | 38 +++++++++++++++++- .../Runtime/AetheriaRuntimeCatalogStore.cs | 28 ++++++++++++- .../AetheriaRuntimeStateCommitDocument.cs | 36 +++++++++++++++++ docs/aetheria-perfect-machine-map.md | 7 +++- 10 files changed, 227 insertions(+), 7 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 3a6966779db7b06bbc255b65359183ecab0e0023..c52f00738c3a4c78b26673d9608ebd386437b9fd 100644 GIT binary patch delta 1063 zcmaJ=&ubGw6lP*0{wUIdBKY$K1Y1lK+nN@{tfnbSTZ*M9Lh&+gCfTvOGt10u+KN!5 zAc%O7fOFAaL_O$1Pd%y!PyPihLeCyOdh_jW)23FuEbRL+?|a|(y(cfTk6&d!zRese z4PPz|7X~j~oO@1=wZ3JZZbwQGt@U@2vC&@2jK@?>@g^J4 zh8kwWBV?$xIhI?#UP*G}aSoI;QWZ7Rno9w7>KY9~E`UcdX_i7(gL@2rxKyA84Yel? zHZADF8`q~i*dQlnBLS|*-1$&)f$cO5nW#bM6uQWD9*n0VZEogac4j&c0S1F8NPj3c zr0IbgSIjjD8qWNh1|#MGYz4V zO)eVX${^roz?Y2}t%k!m9I_HLQ<+h=8R<7g*ST%cOQWp<-X&Xb=ux*!#I${~Hds5l6=XmCB$o(W?gI^;|im7~J0I^+~UgNAw3*8qi(D(d^p zhZL$CFKag)a%Y*{4r@s8j`FF4@YyC)w1Jf1lYe7s%lm(Ix9CL%3m;gM*BGuk%j&wd z@>;R_dcLAHYyB83PfpD!c^`eCcMaO@Q*@gI6$!&p?j4sV=13KeJ<>Xo!{_bT< z$N2bkdLoscNb8#g(j9zid2k>}X|F)~1HV=6WPB4fdJ{={5i&b%#0PasiBhck%20ONI7L6@_#1jRu$JhUNh0+LZrR=5Je z>oWDia;a0@`lgT1ke*w6hC#_e*ZxO&h#{(-hH(CZ;ALTk17&uUSfrwiYL+QSHO?~| z*T7*Qd=pm@EMBcT3T$rqRb)yIffAHS*YvbO_4247XcMZW5VEE(zBqq^55KcXVi`dO9?bO@|chdHdQ zx3c6|Td0fvktIh@4w=0uqZ3yZ6w&;6qaYpINK>JVp{u9PkmW1ICC`pDNtTwVZWOGc zpk;&-k9$A@BHBR2Dn^rfi#5}jS$G*sG6-&e=?>1;dpdXV2V|@_m!DnpxUtXwwh2@k z;ix^#ncD~lhN6Ua3$+S9k6xIcH$DiHGS;;T`!{GYDlls|&M-@jtzqo>hdDxD1{*)e z^z|G`cSVHacKUISJnDM0i(hB*DPJkF*&En@W3AKMCQ19^pPUDlhjPb SHR~UWWTT_Ad6iQWSAPL#p;WN| diff --git a/Aetheria.State.Smoke/Program.cs b/Aetheria.State.Smoke/Program.cs index 261cf273a..eb583e3c6 100644 --- a/Aetheria.State.Smoke/Program.cs +++ b/Aetheria.State.Smoke/Program.cs @@ -251,6 +251,28 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s LockTargetEntityKey = entityKey.ToString() } ], + BehaviorStates = + [ + new AetheriaBehaviorStateSnapshot + { + OwnerKind = "equipment", + OwnerIndex = 0, + BehaviorIndex = 0, + BehaviorKind = "AetherDrive", + AetherDriveAxisX = 0.5, + AetherDriveAxisY = -0.25, + AetherDriveAxisZ = 0.75, + AetherDriveThrustX = 12.0, + AetherDriveThrustY = 6.0, + AetherDriveThrustZ = 3.0, + AetherDriveRpmX = 1200.0, + AetherDriveRpmY = 900.0, + AetherDriveRpmZ = 450.0, + AetherDriveMaximumRpm = 2400.0, + AetherDriveThrustDirectionX = 1.5, + AetherDriveThrustDirectionY = -0.5 + } + ], StatGrids = [ new AetheriaEntityStatGrid @@ -512,6 +534,11 @@ await using (var reopened = await AetheriaStateNode.OpenAsync(statePath, "aether entitySnapshot.WeaponStates[0].BehaviorKind != "LockWeapon" || entitySnapshot.WeaponStates[0].LockProgress != 0.65 || entitySnapshot.WeaponStates[0].LockTargetEntityKey != entityKey.ToString() || + entitySnapshot.BehaviorStates.Length != 1 || + entitySnapshot.BehaviorStates[0].BehaviorKind != "AetherDrive" || + entitySnapshot.BehaviorStates[0].AetherDriveAxisX != 0.5 || + entitySnapshot.BehaviorStates[0].AetherDriveRpmY != 900.0 || + entitySnapshot.BehaviorStates[0].AetherDriveMaximumRpm != 2400.0 || entitySnapshot.StatGrids.Length != 1 || entitySnapshot.StatGrids[0].Values.Length != 4) { diff --git a/Aetheria.State.Unity.Smoke/Program.cs b/Aetheria.State.Unity.Smoke/Program.cs index 5f67eb775..9fffce4cb 100644 --- a/Aetheria.State.Unity.Smoke/Program.cs +++ b/Aetheria.State.Unity.Smoke/Program.cs @@ -481,6 +481,25 @@ try CapacitorCharge = 7.5, CapacitorCapacity = 10.0, CapacitorEfficiency = 0.95 + }, + new AetheriaRuntimeBehaviorStateCommit + { + OwnerKind = "equipment", + OwnerIndex = 4, + BehaviorIndex = 0, + BehaviorKind = "AetherDrive", + AetherDriveAxisX = 0.5, + AetherDriveAxisY = -0.25, + AetherDriveAxisZ = 0.75, + AetherDriveThrustX = 12.0, + AetherDriveThrustY = 6.0, + AetherDriveThrustZ = 3.0, + AetherDriveRpmX = 1200.0, + AetherDriveRpmY = 900.0, + AetherDriveRpmZ = 450.0, + AetherDriveMaximumRpm = 2400.0, + AetherDriveThrustDirectionX = 1.5, + AetherDriveThrustDirectionY = -0.5 } }, StatGrids = new[] @@ -601,7 +620,7 @@ try entity.WeaponStates[3].BehaviorKind == "LockWeapon" && entity.WeaponStates[3].LockProgress == 0.65 && entity.WeaponStates[3].LockTargetEntityKey == "global:aetheria.run_state.smoke-run.zone.0.entity.0.v1" && - entity.BehaviorStates.Length == 4 && + entity.BehaviorStates.Length == 5 && entity.BehaviorStates[0].BehaviorKind == "Sensor" && entity.BehaviorStates[0].Pinging && entity.BehaviorStates[0].PingRadius == 1200.0 && @@ -613,6 +632,11 @@ try entity.BehaviorStates[3].BehaviorKind == "Capacitor" && entity.BehaviorStates[3].CapacitorCharge == 7.5 && entity.BehaviorStates[3].CapacitorEfficiency == 0.95 && + entity.BehaviorStates[4].BehaviorKind == "AetherDrive" && + entity.BehaviorStates[4].AetherDriveAxisX == 0.5 && + entity.BehaviorStates[4].AetherDriveRpmY == 900.0 && + entity.BehaviorStates[4].AetherDriveMaximumRpm == 2400.0 && + entity.BehaviorStates[4].AetherDriveThrustDirectionY == -0.5 && entity.WeaponGroups.Length == 1 && entity.StatGrids.Length == 2 && entity.StatGrids.Any(grid => grid.Name == "temperature" && grid.Values.Length == 2 && grid.Values[1] == 281.0) && @@ -668,8 +692,10 @@ try packageEntities[0].WeaponStates[2].AmmoIntervalProgress != 0.6 || packageEntities[0].WeaponStates[3].LockProgress != 0.65 || packageEntities[0].WeaponStates[3].LockTargetEntityKey != "global:aetheria.run_state.smoke-run.zone.0.entity.0.v1" || - packageEntities[0].BehaviorStates.Count != 4 || + packageEntities[0].BehaviorStates.Count != 5 || packageEntities[0].BehaviorStates[3].CapacitorCharge != 7.5 || + packageEntities[0].BehaviorStates[4].AetherDriveRpmY != 900.0 || + packageEntities[0].BehaviorStates[4].AetherDriveMaximumRpm != 2400.0 || packageEntities[0].StatGrids.Count != 2 || packageEntities[0].StatGrids.All(grid => grid.Name != "temperature" || grid.Values.Count != 2 || grid.Values[1] != 281.0)) { diff --git a/Aetheria.State/AetheriaRuntimeCommitLogApplier.cs b/Aetheria.State/AetheriaRuntimeCommitLogApplier.cs index 8979557ae..e9ba509b4 100644 --- a/Aetheria.State/AetheriaRuntimeCommitLogApplier.cs +++ b/Aetheria.State/AetheriaRuntimeCommitLogApplier.cs @@ -486,7 +486,19 @@ public static class AetheriaRuntimeCommitLogApplier ReactorLoadRatio = state.ReactorLoadRatio, CapacitorCharge = state.CapacitorCharge, CapacitorCapacity = state.CapacitorCapacity, - CapacitorEfficiency = state.CapacitorEfficiency + CapacitorEfficiency = state.CapacitorEfficiency, + AetherDriveAxisX = state.AetherDriveAxisX, + AetherDriveAxisY = state.AetherDriveAxisY, + AetherDriveAxisZ = state.AetherDriveAxisZ, + AetherDriveThrustX = state.AetherDriveThrustX, + AetherDriveThrustY = state.AetherDriveThrustY, + AetherDriveThrustZ = state.AetherDriveThrustZ, + AetherDriveRpmX = state.AetherDriveRpmX, + AetherDriveRpmY = state.AetherDriveRpmY, + AetherDriveRpmZ = state.AetherDriveRpmZ, + AetherDriveMaximumRpm = state.AetherDriveMaximumRpm, + AetherDriveThrustDirectionX = state.AetherDriveThrustDirectionX, + AetherDriveThrustDirectionY = state.AetherDriveThrustDirectionY }) .ToArray(); } diff --git a/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs b/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs index 5627cc911..da379161e 100644 --- a/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs +++ b/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs @@ -703,6 +703,42 @@ public sealed class AetheriaBehaviorStateSnapshot [Key(18)] public double CapacitorEfficiency { get; set; } + + [Key(19)] + public double AetherDriveAxisX { get; set; } + + [Key(20)] + public double AetherDriveAxisY { get; set; } + + [Key(21)] + public double AetherDriveAxisZ { get; set; } + + [Key(22)] + public double AetherDriveThrustX { get; set; } + + [Key(23)] + public double AetherDriveThrustY { get; set; } + + [Key(24)] + public double AetherDriveThrustZ { get; set; } + + [Key(25)] + public double AetherDriveRpmX { get; set; } + + [Key(26)] + public double AetherDriveRpmY { get; set; } + + [Key(27)] + public double AetherDriveRpmZ { get; set; } + + [Key(28)] + public double AetherDriveMaximumRpm { get; set; } + + [Key(29)] + public double AetherDriveThrustDirectionX { get; set; } + + [Key(30)] + public double AetherDriveThrustDirectionY { get; set; } } [MessagePackObject] diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 1ca57ff5c..dd66e9b9c 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -884,6 +884,24 @@ public class ActionGameManager : MonoBehaviour CapacitorEfficiency = capacitor.Efficiency }; } + else if (behavior is AetherDrive drive) + { + state = new AetheriaRuntimeBehaviorStateCommit + { + AetherDriveAxisX = drive.Axis.x, + AetherDriveAxisY = drive.Axis.y, + AetherDriveAxisZ = drive.Axis.z, + AetherDriveThrustX = drive.Thrust.x, + AetherDriveThrustY = drive.Thrust.y, + AetherDriveThrustZ = drive.Thrust.z, + AetherDriveRpmX = drive.Rpm.x, + AetherDriveRpmY = drive.Rpm.y, + AetherDriveRpmZ = drive.Rpm.z, + AetherDriveMaximumRpm = drive.MaximumRpm, + AetherDriveThrustDirectionX = drive.ThrustDirection.x, + AetherDriveThrustDirectionY = drive.ThrustDirection.y + }; + } if (state == null) continue; diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogSnapshot.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogSnapshot.cs index cfcbcccd5..8e18c9cb4 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogSnapshot.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogSnapshot.cs @@ -1086,7 +1086,19 @@ namespace GameCult.Aetheria.State.Unity double reactorLoadRatio, double capacitorCharge, double capacitorCapacity, - double capacitorEfficiency) + double capacitorEfficiency, + double aetherDriveAxisX, + double aetherDriveAxisY, + double aetherDriveAxisZ, + double aetherDriveThrustX, + double aetherDriveThrustY, + double aetherDriveThrustZ, + double aetherDriveRpmX, + double aetherDriveRpmY, + double aetherDriveRpmZ, + double aetherDriveMaximumRpm, + double aetherDriveThrustDirectionX, + double aetherDriveThrustDirectionY) { OwnerKind = ownerKind; OwnerIndex = ownerIndex; @@ -1107,6 +1119,18 @@ namespace GameCult.Aetheria.State.Unity CapacitorCharge = capacitorCharge; CapacitorCapacity = capacitorCapacity; CapacitorEfficiency = capacitorEfficiency; + AetherDriveAxisX = aetherDriveAxisX; + AetherDriveAxisY = aetherDriveAxisY; + AetherDriveAxisZ = aetherDriveAxisZ; + AetherDriveThrustX = aetherDriveThrustX; + AetherDriveThrustY = aetherDriveThrustY; + AetherDriveThrustZ = aetherDriveThrustZ; + AetherDriveRpmX = aetherDriveRpmX; + AetherDriveRpmY = aetherDriveRpmY; + AetherDriveRpmZ = aetherDriveRpmZ; + AetherDriveMaximumRpm = aetherDriveMaximumRpm; + AetherDriveThrustDirectionX = aetherDriveThrustDirectionX; + AetherDriveThrustDirectionY = aetherDriveThrustDirectionY; } public string OwnerKind { get; } @@ -1128,5 +1152,17 @@ namespace GameCult.Aetheria.State.Unity public double CapacitorCharge { get; } public double CapacitorCapacity { get; } public double CapacitorEfficiency { get; } + public double AetherDriveAxisX { get; } + public double AetherDriveAxisY { get; } + public double AetherDriveAxisZ { get; } + public double AetherDriveThrustX { get; } + public double AetherDriveThrustY { get; } + public double AetherDriveThrustZ { get; } + public double AetherDriveRpmX { get; } + public double AetherDriveRpmY { get; } + public double AetherDriveRpmZ { get; } + public double AetherDriveMaximumRpm { get; } + public double AetherDriveThrustDirectionX { get; } + public double AetherDriveThrustDirectionY { get; } } } diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs index dd9934efe..c7c8f29b8 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs @@ -876,7 +876,19 @@ namespace GameCult.Aetheria.State.Unity var capacitorCharge = ReadFieldDouble(ref reader, behaviorFields, 16); var capacitorCapacity = ReadFieldDouble(ref reader, behaviorFields, 17); var capacitorEfficiency = ReadFieldDouble(ref reader, behaviorFields, 18); - SkipRemaining(ref reader, behaviorFields, 19); + var aetherDriveAxisX = ReadFieldDouble(ref reader, behaviorFields, 19); + var aetherDriveAxisY = ReadFieldDouble(ref reader, behaviorFields, 20); + var aetherDriveAxisZ = ReadFieldDouble(ref reader, behaviorFields, 21); + var aetherDriveThrustX = ReadFieldDouble(ref reader, behaviorFields, 22); + var aetherDriveThrustY = ReadFieldDouble(ref reader, behaviorFields, 23); + var aetherDriveThrustZ = ReadFieldDouble(ref reader, behaviorFields, 24); + var aetherDriveRpmX = ReadFieldDouble(ref reader, behaviorFields, 25); + var aetherDriveRpmY = ReadFieldDouble(ref reader, behaviorFields, 26); + var aetherDriveRpmZ = ReadFieldDouble(ref reader, behaviorFields, 27); + var aetherDriveMaximumRpm = ReadFieldDouble(ref reader, behaviorFields, 28); + var aetherDriveThrustDirectionX = ReadFieldDouble(ref reader, behaviorFields, 29); + var aetherDriveThrustDirectionY = ReadFieldDouble(ref reader, behaviorFields, 30); + SkipRemaining(ref reader, behaviorFields, 31); behaviorStates[behavior] = new AetheriaRuntimeBehaviorStateSnapshot( ownerKind, ownerIndex, @@ -896,7 +908,19 @@ namespace GameCult.Aetheria.State.Unity reactorLoadRatio, capacitorCharge, capacitorCapacity, - capacitorEfficiency); + capacitorEfficiency, + aetherDriveAxisX, + aetherDriveAxisY, + aetherDriveAxisZ, + aetherDriveThrustX, + aetherDriveThrustY, + aetherDriveThrustZ, + aetherDriveRpmX, + aetherDriveRpmY, + aetherDriveRpmZ, + aetherDriveMaximumRpm, + aetherDriveThrustDirectionX, + aetherDriveThrustDirectionY); } return behaviorStates; diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs index 15064495a..d326acda9 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs @@ -752,5 +752,41 @@ namespace GameCult.Aetheria.State.Unity [Key(18)] public double CapacitorEfficiency { get; set; } + + [Key(19)] + public double AetherDriveAxisX { get; set; } + + [Key(20)] + public double AetherDriveAxisY { get; set; } + + [Key(21)] + public double AetherDriveAxisZ { get; set; } + + [Key(22)] + public double AetherDriveThrustX { get; set; } + + [Key(23)] + public double AetherDriveThrustY { get; set; } + + [Key(24)] + public double AetherDriveThrustZ { get; set; } + + [Key(25)] + public double AetherDriveRpmX { get; set; } + + [Key(26)] + public double AetherDriveRpmY { get; set; } + + [Key(27)] + public double AetherDriveRpmZ { get; set; } + + [Key(28)] + public double AetherDriveMaximumRpm { get; set; } + + [Key(29)] + public double AetherDriveThrustDirectionX { get; set; } + + [Key(30)] + public double AetherDriveThrustDirectionY { get; set; } } } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 658c1c9c6..c8b379c9b 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -169,7 +169,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. plus target entity reference. Sensor, radiator, reactor, and capacitor behaviors publish typed state rows for ping state, radiator temperature/throughput, reactor draw/load, and - capacitor charge/capacity/efficiency. + capacitor charge/capacity/efficiency. Aether drives publish typed axis, + thrust, RPM, maximum RPM, and thrust-direction rows, so rotor simulation + state is no longer trapped inside live behavior memory. `RuntimeEntityBlueprint` still exists for construction/loadout projection, but those live hull grids and session scalars are not blueprint fields and cannot be restored by the old blueprint projector path. @@ -801,6 +803,9 @@ First Aetheria surfaces to publish: - Done: extend run checkpoint commits and smoke coverage to carry typed behavior state rows for sensor ping state plus radiator, reactor, and capacitor runtime internals. + - Done: extend behavior state rows for AetherDrive axis, thrust, RPM, + maximum RPM, and thrust direction, so drive rotor state has a typed + snapshot/readback path. - Done: cut live simulation grids out of `RuntimeEntityBlueprint`; loadout and construction templates no longer capture or restore temperature, armor, max-armor, or hull-conductivity state.