From 21d5cbdf79f8feb2b1df4672d42469bd07931b2b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 16:13:32 +0100 Subject: [PATCH] Persist thruster state in typed snapshots --- .voidbot/state/aetheria.cc | Bin 85610 -> 85577 bytes Aetheria.State.Smoke/Program.cs | 16 +++++++++++++- Aetheria.State.Unity.Smoke/Program.cs | 20 ++++++++++++++++-- .../AetheriaRuntimeCommitLogApplier.cs | 5 ++++- .../AetheriaRuntimeStateDocuments.cs | 9 ++++++++ Assets/Scripts/Gameplay/ActionGameManager.cs | 9 ++++++++ .../Runtime/AetheriaRuntimeCatalogSnapshot.cs | 11 +++++++++- .../Runtime/AetheriaRuntimeCatalogStore.cs | 10 +++++++-- .../AetheriaRuntimeStateCommitDocument.cs | 9 ++++++++ docs/aetheria-perfect-machine-map.md | 5 ++++- 10 files changed, 86 insertions(+), 8 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index dcaaeb5f9f306a7fcfc161de4c92471a874e63e5..9dedb5f8ac69329554fe0ba86b2e75e8350c6744 100644 GIT binary patch delta 536 zcmaDghxOzf)(y*;xD1V~42|`S%`KuPGKx+<%G3=Lu`mLQnMNGjW94rcqJk6Rc z+cjAjEzBj95>rbuQj0PZbxSgeN{dTUi*$=i5=&C27w|C}O}_7>DD4&kl~72`OU%hn zS12gTFDT6^&dkr7{=%Bki0S6v>9RJA;sywH6`92fnRx}JB{~YJWr;bZK=V=*Am-}; zO#!m=iwaAp7uzuIXZ$kV*p|^j0A{;Fa(-S(QGU+!23y8@4w#YCIqet?7@tqKvSZYj zf(a@l0`1X{MTeysC_1M1 tIx+5t3Yi!fK;w*UdZ9C8K3v!stn$AzV(hxOGQ)(y*;xD3p!42|_n%?+a_GKx+<%G3=Pu>gzYGgrYxEFfw)SQHp_n>AUs zYqBs}m`kfBrj}%+7G);t=4R$)=B4YFFt4-$_x@#TP6W0+don zOfJbROI0XIEJ{x;nf~0G(J1m3BTrCio#p(rsgeR`4&<9^1^)0J!)9e5$` zgIQc;%UI8aFn;<^TSf!M`_r}T81=;v!cf)vV8e>-7~9w&rc7tHXG~#?o}OXPsA7tw z9PT8%js%;w#-1@kDIlOIKPxpE=wW0-P(nz grid.Name == "temperature" && grid.Values.Length == 2 && grid.Values[1] == 281.0) && @@ -724,7 +738,7 @@ 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 != 7 || + packageEntities[0].BehaviorStates.Count != 8 || packageEntities[0].BehaviorStates[3].CapacitorCharge != 7.5 || packageEntities[0].BehaviorStates[4].AetherDriveRpmY != 900.0 || packageEntities[0].BehaviorStates[4].AetherDriveMaximumRpm != 2400.0 || @@ -732,6 +746,8 @@ try packageEntities[0].BehaviorStates[5].ResourceScannerScanDuration != 3.5 || packageEntities[0].BehaviorStates[6].MiningToolAsteroidBeltId != "smoke:body" || packageEntities[0].BehaviorStates[6].MiningToolRange != 275.0 || + packageEntities[0].BehaviorStates[7].ThrusterAxis != 0.8 || + packageEntities[0].BehaviorStates[7].ThrusterThrust != 125.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 2105fb259..f1eef0479 100644 --- a/Aetheria.State/AetheriaRuntimeCommitLogApplier.cs +++ b/Aetheria.State/AetheriaRuntimeCommitLogApplier.cs @@ -507,7 +507,10 @@ public static class AetheriaRuntimeCommitLogApplier ResourceScannerScanDuration = state.ResourceScannerScanDuration, MiningToolAsteroidBeltId = state.MiningToolAsteroidBeltId ?? "", MiningToolAsteroidIndex = state.MiningToolAsteroidIndex, - MiningToolRange = state.MiningToolRange + MiningToolRange = state.MiningToolRange, + ThrusterAxis = state.ThrusterAxis, + ThrusterThrust = state.ThrusterThrust, + ThrusterTorque = state.ThrusterTorque }) .ToArray(); } diff --git a/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs b/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs index 1aebc97f5..8714e05cf 100644 --- a/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs +++ b/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs @@ -766,6 +766,15 @@ public sealed class AetheriaBehaviorStateSnapshot [Key(39)] public double MiningToolRange { get; set; } + + [Key(40)] + public double ThrusterAxis { get; set; } + + [Key(41)] + public double ThrusterThrust { get; set; } + + [Key(42)] + public double ThrusterTorque { get; set; } } [MessagePackObject] diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index f5480677f..3a50a9b94 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -927,6 +927,15 @@ public class ActionGameManager : MonoBehaviour MiningToolRange = miningTool.Range }; } + else if (behavior is Thruster thruster) + { + state = new AetheriaRuntimeBehaviorStateCommit + { + ThrusterAxis = thruster.Axis, + ThrusterThrust = thruster.Thrust, + ThrusterTorque = thruster.Torque + }; + } 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 b136ba0ac..cbff4d1f2 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogSnapshot.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogSnapshot.cs @@ -1107,7 +1107,10 @@ namespace GameCult.Aetheria.State.Unity double resourceScannerScanDuration, string miningToolAsteroidBeltId, int miningToolAsteroidIndex, - double miningToolRange) + double miningToolRange, + double thrusterAxis, + double thrusterThrust, + double thrusterTorque) { OwnerKind = ownerKind; OwnerIndex = ownerIndex; @@ -1149,6 +1152,9 @@ namespace GameCult.Aetheria.State.Unity MiningToolAsteroidBeltId = miningToolAsteroidBeltId; MiningToolAsteroidIndex = miningToolAsteroidIndex; MiningToolRange = miningToolRange; + ThrusterAxis = thrusterAxis; + ThrusterThrust = thrusterThrust; + ThrusterTorque = thrusterTorque; } public string OwnerKind { get; } @@ -1191,5 +1197,8 @@ namespace GameCult.Aetheria.State.Unity public string MiningToolAsteroidBeltId { get; } public int MiningToolAsteroidIndex { get; } public double MiningToolRange { get; } + public double ThrusterAxis { get; } + public double ThrusterThrust { get; } + public double ThrusterTorque { get; } } } diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs index 7199f3c9d..80687e8f2 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs @@ -897,7 +897,10 @@ namespace GameCult.Aetheria.State.Unity var miningToolAsteroidBeltId = ReadFieldString(ref reader, behaviorFields, 37); var miningToolAsteroidIndex = ReadFieldInt32(ref reader, behaviorFields, 38); var miningToolRange = ReadFieldDouble(ref reader, behaviorFields, 39); - SkipRemaining(ref reader, behaviorFields, 40); + var thrusterAxis = ReadFieldDouble(ref reader, behaviorFields, 40); + var thrusterThrust = ReadFieldDouble(ref reader, behaviorFields, 41); + var thrusterTorque = ReadFieldDouble(ref reader, behaviorFields, 42); + SkipRemaining(ref reader, behaviorFields, 43); behaviorStates[behavior] = new AetheriaRuntimeBehaviorStateSnapshot( ownerKind, ownerIndex, @@ -938,7 +941,10 @@ namespace GameCult.Aetheria.State.Unity resourceScannerScanDuration, miningToolAsteroidBeltId, miningToolAsteroidIndex, - miningToolRange); + miningToolRange, + thrusterAxis, + thrusterThrust, + thrusterTorque); } return behaviorStates; diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs index b3d0df802..da1a6fbe0 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs @@ -815,5 +815,14 @@ namespace GameCult.Aetheria.State.Unity [Key(39)] public double MiningToolRange { get; set; } + + [Key(40)] + public double ThrusterAxis { get; set; } + + [Key(41)] + public double ThrusterThrust { get; set; } + + [Key(42)] + public double ThrusterTorque { get; set; } } } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 26909caa8..245a3daf7 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -174,7 +174,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. state is no longer trapped inside live behavior memory. Resource scanners publish target body id, asteroid index, scan timer, range, minimum density, and scan duration rows. Mining tools publish asteroid belt id, asteroid - index, and evaluated range rows. + index, and evaluated range rows. Thrusters publish analog axis input, + evaluated thrust, and torque rows. `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. @@ -815,6 +816,8 @@ First Aetheria surfaces to publish: - Done: extend behavior state rows for MiningTool asteroid belt id, asteroid index, and range, so active mining target state is typed snapshot/readback state. + - Done: extend behavior state rows for Thruster axis, thrust, and torque, + so analog propulsion state is typed snapshot/readback state. - 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.