From fcd5df7449dce4e87ad955179732672ed0101d10 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 11:03:30 +0100 Subject: [PATCH] Demote runtime DTO MessagePack metadata --- .voidbot/state/aetheria.cc | Bin 24755 -> 25901 bytes Assets/Scripts/ServerShared/EntitySettings.cs | 4 +- Assets/Scripts/ServerShared/ItemInstance.cs | 36 +++----------- Assets/Scripts/ServerShared/Ship.cs | 8 --- Assets/Scripts/ServerShared/ZoneData.cs | 47 +----------------- docs/aetheria-perfect-machine-map.md | 29 ++++++----- 6 files changed, 25 insertions(+), 99 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 520ee7436e773fbc6507c338ebec25549b461a2d..69e01a3561b41f63173b0feee52c083fe955d192 100644 GIT binary patch delta 1800 zcmaJ?&u`pB6lRmqq-`oem83-q^i`tt2hMJ`2?^u|Euv9L3f*l~MI0F0Z|x!Wj5Raf z;2u~ZF1>>P0#pzZ0tvLY3L$ae!l}I=wcCV{E_Tt)Ndu@58xwMqu-#U^1K6d+9t+u-TWn(s%cfOWRW5Wo8(-($88_x!e?oIk0XpUKiRh;UNs{00%lDPaI&vhj(eN z$vS8Z7l8&LA(A3M1s+o>tIxjXeuAEH;D+E*IB*p+Iy(@Aegk6{l><`M`ythIB=}s> zZ@iDX3El8@%s^qxxTq+%G|{6IAyLu}pid3EAyLdXCQl7O?h5cz#a!Y{DmieAm^y$3 zZimn^pY$rpBoWI{E$E63kv7=;&Y-Xp9yX@yQpRYQZxz#qN6`osi7z0+fO#1yVAvp% zLCco~V3Q?C+PN6AJ}0gT%j|TZ6=)*iz}{S0NJSN^u-%HwG?LOJsEZy;H5SYDQl*H8 zRn(9yBMX#p!pv6$en5c80u~A(f%0Go6iY%)XDFElA-rGUy;SyGVjlU%o)v*by#KQ+ zr6HOml7||&Y5vR#x!2<);xvIIdhloyKQ-W`Mw7v08V!8dK}@VVvTxVV@YW9_QVT@~trC?c>p{qLg~W%1id@r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EntitySettings.cs index dac16fcea..571c0ed92 100644 --- a/Assets/Scripts/ServerShared/EntitySettings.cs +++ b/Assets/Scripts/ServerShared/EntitySettings.cs @@ -1,10 +1,8 @@ using System; -using MessagePack; -[MessagePackObject, Serializable] +[Serializable] public class EntitySettings { - [Key(0)] public float ShutdownPerformance = .1f; public EntitySettings Copy() diff --git a/Assets/Scripts/ServerShared/ItemInstance.cs b/Assets/Scripts/ServerShared/ItemInstance.cs index 287313b23..677b53c84 100644 --- a/Assets/Scripts/ServerShared/ItemInstance.cs +++ b/Assets/Scripts/ServerShared/ItemInstance.cs @@ -7,55 +7,33 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection; -//using JM.LinqFaster; -using MessagePack; -using MessagePack.Formatters; using Unity.Mathematics; using static Unity.Mathematics.math; -[Union(0, typeof(SimpleCommodity)), - Union(1, typeof(CompoundCommodity)), - Union(2, typeof(EquippableItem)), - Union(3, typeof(ConsumableItem))] public abstract class ItemInstance { - [Key(0)] public DatabaseLink Data; - [Key(1)] public ItemRotation Rotation; + public DatabaseLink Data; + public ItemRotation Rotation; } -[Union(0, typeof(CompoundCommodity)), - Union(1, typeof(EquippableItem)), - Union(2, typeof(ConsumableItem))] public abstract class CraftedItemInstance : ItemInstance { - [Key(2)] public float Quality; - - //[Key(3)] public List Ingredients = new List(); - - //[Key(4)] public Guid Blueprint; - - //[Key(3)] public string Name; - - //[Key(4)] public Guid SourceEntity; + public float Quality; } -[MessagePackObject] public class CompoundCommodity : CraftedItemInstance { } -[MessagePackObject] public class SimpleCommodity : ItemInstance { - [Key(2)] public int Quantity; + public int Quantity; } -[MessagePackObject] public class EquippableItem : CraftedItemInstance { - [Key(7)] public float Durability; - [Key(8)] public bool OverrideShutdown; + public float Durability; + public bool OverrideShutdown; } -[MessagePackObject] public class ConsumableItem : CraftedItemInstance { -} \ No newline at end of file +} diff --git a/Assets/Scripts/ServerShared/Ship.cs b/Assets/Scripts/ServerShared/Ship.cs index e8acb925a..fa13dfcb3 100644 --- a/Assets/Scripts/ServerShared/Ship.cs +++ b/Assets/Scripts/ServerShared/Ship.cs @@ -7,21 +7,13 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection; -using MessagePack; using UniRx; using Unity.Mathematics; using static Unity.Mathematics.math; using quaternion = Unity.Mathematics.quaternion; -[MessagePackObject] public class Ship : Entity { - - // [Key("bindings")] public Dictionary Bindings = new Dictionary(); - //[IgnoreMember] public int HullHardpointCount; - - // [IgnoreMember] public Dictionary Contacts = new Dictionary(); - // [IgnoreMember] public Targetable Target; public Entity HomeEntity; public float2 MovementDirection; public bool IsPlayerShip; diff --git a/Assets/Scripts/ServerShared/ZoneData.cs b/Assets/Scripts/ServerShared/ZoneData.cs index 5163c9225..ad0a737c7 100644 --- a/Assets/Scripts/ServerShared/ZoneData.cs +++ b/Assets/Scripts/ServerShared/ZoneData.cs @@ -5,7 +5,6 @@ using System; using System.Collections; using System.Collections.Generic; -using MessagePack; using UniRx; using Unity.Mathematics; using static Unity.Mathematics.math; @@ -22,140 +21,96 @@ public class ZonePack public double Time; } -[MessagePackObject, - Union(0, typeof(PlanetData)), - Union(1, typeof(AsteroidBeltData)), - Union(2, typeof(GasGiantData)), - Union(3, typeof(SunData))] public abstract class BodyData : DatabaseEntry, INamedEntry { - [Key(1)] public string Name = ""; - [Key(2)] public Guid Orbit; - [Key(3)] public float Mass = 0; - [Key(4)] public Dictionary Resources = new Dictionary(); - [Key(5)] public float BodyRadiusMultiplier = 1; - [Key(6)] public float GravityRadiusMultiplier = 1; - [Key(7)] public float GravityDepthMultiplier = 1; - [Key(8)] public float GravityDepthExponent = 16; - [IgnoreMember] public string EntryName + public string EntryName { get => Name; set => Name = value; } } -[MessagePackObject] public class PlanetData : BodyData { } -[MessagePackObject] public class AsteroidBeltData : BodyData { - [Key(9)] public Asteroid[] Asteroids; } -[MessagePackObject] public class GasGiantData : BodyData { - [Key(9)] public float FirstOffsetDomainRotationSpeed = 1; - [Key(10)] public float FirstOffsetRotationSpeed = 1; - [Key(11)] public float SecondOffsetDomainRotationSpeed = 1; - [Key(12)] public float SecondOffsetRotationSpeed = 1; - [Key(13)] public float AlbedoRotationSpeed = 1; - [Key(14)] public float WaveRadiusMultiplier = 1; - [Key(15)] public float WaveDepthMultiplier = 1; - [Key(16)] public float WaveDepthExponent = 8; - [Key(17)] public float WaveSpeedMultiplier = 8; - [Key(18)] public List MaterialOverrides = new List(); - [Key(19)] public float4[] Colors = new float4[0]; } public class SunData : GasGiantData { - [Key(20)] public float3 LightColor = float3.zero; - [Key(21)] public float3 FogTintColor = float3.zero; - [Key(22)] public float LightRadiusMultiplier = 1; } -[MessagePackObject] public class Asteroid { - [Key(0)] public float Distance; - [Key(1)] public float Phase; - [Key(2)] public float Size; - [Key(3)] public float RotationSpeed; } -[MessagePackObject] public class OrbitData : DatabaseEntry { - [Key(1)] public Guid Parent; - [Key(2)] public float Distance; - [Key(3)] public float Phase; - [Key(4)] public float2 FixedPosition = float2.zero; - // [Key(4)] - // public float Period; - public static float2 Evaluate(float phase) { phase *= PI * 2; diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 912e086df..d522d74b2 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -18,8 +18,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. ## Current Mechanism - Unity client/runtime lives under `Assets/`. Gameplay still reads the legacy - item/name catalog through `ActionGameManager.LegacyCatalog`, which is now the - only runtime entrypoint that calls `LegacyCatalogBoundary.GetCatalog`. + item/name catalog through a private `ActionGameManager` boot helper, which is + now the only runtime entrypoint that calls `LegacyCatalogBoundary.GetCatalog`. `ActionGameManager` no longer owns a global legacy cache. Local run saves, loadouts, player settings files, zone files, and generated keyboard layout caches no longer write bespoke durable files. The legacy `PlayerSettings` @@ -37,8 +37,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. `PlayerSettings.msgpack`, `.loadout`, `.zone`, and `GameData/KeyboardLayouts/*.msgpack` authority paths are disabled or deleted. The old `SavedGame`/`SavedZone` DTOs and `Galaxy` save-loader constructor are - deleted. The dead `SavedStory` JSON DTO is deleted. `ZonePack` and - `EntityPack` remain as runtime construction/loadout snapshots, but no longer + deleted. The dead `SavedStory` JSON DTO is deleted. `ZonePack`, body/orbit + zone runtime data, item-instance runtime data, `Ship`, and `EntitySettings` + remain as runtime construction/loadout/session projections, but no longer declare themselves as MessagePack persistence documents. - `Aetheria.State` now expands `AetheriaPlayerSettings` beyond an active-run pointer into the typed Verse replacement for `PlayerSettings.msgpack`: player @@ -60,12 +61,12 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. `EntityPack` serialization. Unity has not wired its save/loadout UI to this document yet, so the old in-memory `EntityPack` path is still a runtime construction helper, not durable authority. -- `ActionGameManager.LegacyCatalog` is the Unity runtime's single public legacy - catalog access point. It delegates to `LegacyCatalogBoundary`, which opens - `LegacyCatalogCache` as the only concrete pull-only catalog cache. Runtime - consumers receive `ILegacyCatalogReader`, so old MessagePack backing stores - may hydrate in-memory domain objects for the current Unity runtime, but this - path cannot push or delete legacy files. The legacy backing-store +- The private `ActionGameManager` catalog boot helper delegates to + `LegacyCatalogBoundary`, which opens `LegacyCatalogCache` as the only + concrete pull-only catalog cache. Runtime consumers receive + `ILegacyCatalogReader`, so old MessagePack backing stores may hydrate + in-memory domain objects for the current Unity runtime, but this path cannot + push or delete legacy files. The legacy backing-store write/realtime APIs and public cache mutation methods have been deleted; only backing-store pull hydration can populate it. The backing-store serializer methods are also deleted, so the legacy cache implementation exposes @@ -155,9 +156,11 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. Sprite, and Texture2D are deleted. Keyboard layout DTOs are plain runtime parse/display models, not MessagePack save shapes. `PlayerSettings` is a plain session-local runtime object until typed Verse settings are imported - into Unity. The global scene-load MessagePack resolver hook is deleted. The - slime compute settings path no longer serializes its local parameter struct - for change detection. + into Unity. `ZoneData` body/orbit DTOs, `ItemInstance` DTOs, + `EntitySettings`, and `Ship` are also plain runtime/session projections now, + not MessagePack persistence shapes. The global scene-load MessagePack + resolver hook is deleted. The slime compute settings path no longer + serializes its local parameter struct for change detection. - The dead story compiled-JSON cache sketch and its SHA helper are deleted; story compilation currently reads Ink source directly until a typed Verse story/cache document exists.