diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 0f07ebe8c..bbef38d09 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs index 5cf4227d2..66562a6b2 100644 --- a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs +++ b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs @@ -16,9 +16,40 @@ public interface IRuntimeItemCatalogReader public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemCatalogReader { private readonly Dictionary _items; - private static readonly IReadOnlyDictionary BehaviorTypesByUnionKey = typeof(BehaviorData) - .GetCustomAttributes() - .ToDictionary(attribute => attribute.Key, attribute => attribute.SubType); + private static readonly IReadOnlyDictionary BehaviorTypesByUnionKey = new Dictionary + { + { 0, typeof(GuidedWeaponData) }, + { 1, typeof(LauncherData) }, + { 2, typeof(ReactorData) }, + { 3, typeof(RadiatorData) }, + { 4, typeof(StatModifierData) }, + { 5, typeof(SensorData) }, + { 6, typeof(ReflectorData) }, + { 7, typeof(ShieldData) }, + { 8, typeof(ThrusterData) }, + { 9, typeof(WearData) }, + { 10, typeof(VelocityConversionData) }, + { 11, typeof(VelocityLimitData) }, + { 12, typeof(AetherDriveData) }, + { 15, typeof(CooldownData) }, + { 16, typeof(HeatData) }, + { 18, typeof(ItemUsageData) }, + { 20, typeof(SwitchData) }, + { 21, typeof(TriggerData) }, + { 22, typeof(VisibilityData) }, + { 23, typeof(ThermotoggleData) }, + { 24, typeof(EnergyDrawData) }, + { 26, typeof(MiningToolData) }, + { 28, typeof(ResourceScannerData) }, + { 31, typeof(CapacitorData) }, + { 32, typeof(CockpitData) }, + { 33, typeof(HeatStorageData) }, + { 34, typeof(TurretControllerData) }, + { 35, typeof(InstantWeaponData) }, + { 36, typeof(ConstantWeaponData) }, + { 37, typeof(ChargedWeaponData) }, + { 38, typeof(AutoWeaponData) } + }; public AetheriaRuntimeItemCatalog(AetheriaRuntimeCatalogSnapshot catalog) { diff --git a/Assets/Scripts/ServerShared/Agents/Tasks/AgentTask.cs b/Assets/Scripts/ServerShared/Agents/Tasks/AgentTask.cs index 7bbeaa099..f5aad3e20 100644 --- a/Assets/Scripts/ServerShared/Agents/Tasks/AgentTask.cs +++ b/Assets/Scripts/ServerShared/Agents/Tasks/AgentTask.cs @@ -3,26 +3,16 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ using System; -using System.Collections; -using System.Collections.Generic; -using MessagePack; -[MessagePackObject, - Union(0, typeof(StationTowing)), - Union(1, typeof(Mining)), - Union(2, typeof(Survey)), - Union(3, typeof(HaulingTask))] + public abstract class AgentTask : DatabaseEntry { - [Key(1)] public int Priority; - [Key(2)] public Guid Zone; - [Key(3)] public bool Reserved; - [IgnoreMember] public abstract TaskType Type { get; } + public abstract TaskType Type { get; } } public enum TaskType diff --git a/Assets/Scripts/ServerShared/Agents/Tasks/HaulingTask.cs b/Assets/Scripts/ServerShared/Agents/Tasks/HaulingTask.cs index 89fb2adbf..38b893fc9 100644 --- a/Assets/Scripts/ServerShared/Agents/Tasks/HaulingTask.cs +++ b/Assets/Scripts/ServerShared/Agents/Tasks/HaulingTask.cs @@ -3,22 +3,16 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ using System; -using System.Collections; -using System.Collections.Generic; -using MessagePack; + public class HaulingTask : AgentTask { public override TaskType Type => TaskType.Haul; - [Key(4)] public Entity Origin; - [Key(5)] public Entity Target; - [Key(6)] public Guid ItemType; - [Key(7)] public int Quantity; } diff --git a/Assets/Scripts/ServerShared/Agents/Tasks/Mining.cs b/Assets/Scripts/ServerShared/Agents/Tasks/Mining.cs index 32cf9a300..7734489ff 100644 --- a/Assets/Scripts/ServerShared/Agents/Tasks/Mining.cs +++ b/Assets/Scripts/ServerShared/Agents/Tasks/Mining.cs @@ -3,14 +3,10 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ using System; -using System.Collections; -using System.Collections.Generic; -using MessagePack; -[MessagePackObject] + public class Mining : AgentTask { - [IgnoreMember] public override TaskType Type => TaskType.Mine; + public override TaskType Type => TaskType.Mine; - [Key(4)] public Guid Asteroids; -} \ No newline at end of file +} diff --git a/Assets/Scripts/ServerShared/Agents/Tasks/StationTowing.cs b/Assets/Scripts/ServerShared/Agents/Tasks/StationTowing.cs index 711abded7..f138f74aa 100644 --- a/Assets/Scripts/ServerShared/Agents/Tasks/StationTowing.cs +++ b/Assets/Scripts/ServerShared/Agents/Tasks/StationTowing.cs @@ -3,20 +3,14 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ using System; -using System.Collections; -using System.Collections.Generic; -using MessagePack; -[MessagePackObject] + public class StationTowing : AgentTask { - [IgnoreMember] public override TaskType Type => TaskType.Tow; + public override TaskType Type => TaskType.Tow; - [Key(4)] public OrbitalEntity Station; - [Key(5)] public Guid OrbitParent; - [Key(6)] public float OrbitDistance; } diff --git a/Assets/Scripts/ServerShared/Agents/Tasks/Survey.cs b/Assets/Scripts/ServerShared/Agents/Tasks/Survey.cs index 261e364c7..44f957245 100644 --- a/Assets/Scripts/ServerShared/Agents/Tasks/Survey.cs +++ b/Assets/Scripts/ServerShared/Agents/Tasks/Survey.cs @@ -3,14 +3,11 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ using System; -using System.Collections; using System.Collections.Generic; -using MessagePack; -[MessagePackObject] + public class Survey : AgentTask { - [IgnoreMember] public override TaskType Type => TaskType.Explore; + public override TaskType Type => TaskType.Explore; - [Key(4)] public List Planets; -} \ No newline at end of file +} diff --git a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs index 7245f9d47..333fea738 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs @@ -145,45 +145,7 @@ public abstract class PersistentBehaviorData { } -[Inspectable, - Union(0, typeof(GuidedWeaponData)), - Union(1, typeof(LauncherData)), - Union(2, typeof(ReactorData)), - Union(3, typeof(RadiatorData)), - Union(4, typeof(StatModifierData)), - Union(5, typeof(SensorData)), - Union(6, typeof(ReflectorData)), - Union(7, typeof(ShieldData)), - Union(8, typeof(ThrusterData)), - Union(9, typeof(WearData)), - Union(10, typeof(VelocityConversionData)), - Union(11, typeof(VelocityLimitData)), - Union(12, typeof(AetherDriveData)), - // Union(14, typeof(TowingControllerData)), - Union(15, typeof(CooldownData)), - Union(16, typeof(HeatData)), - // Union(17, typeof(HitscanData)), - Union(18, typeof(ItemUsageData)), - //Union(19, typeof(RadianceData)), - Union(20, typeof(SwitchData)), - Union(21, typeof(TriggerData)), - Union(22, typeof(VisibilityData)), - Union(23, typeof(ThermotoggleData)), - Union(24, typeof(EnergyDrawData)), - // Union(25, typeof(MiningControllerData)), - Union(26, typeof(MiningToolData)), - // Union(27, typeof(SurveyControllerData)), - Union(28, typeof(ResourceScannerData)), - // Union(29, typeof(WanderControllerData)), - // Union(30, typeof(HaulingControllerData)), - Union(31, typeof(CapacitorData)), - Union(32, typeof(CockpitData)), - Union(33, typeof(HeatStorageData)), - Union(34, typeof(TurretControllerData)), - Union(35, typeof(InstantWeaponData)), - Union(36, typeof(ConstantWeaponData)), - Union(37, typeof(ChargedWeaponData)), - Union(38, typeof(AutoWeaponData))] +[Inspectable] public abstract class BehaviorData { [Inspectable, Key(0)] @@ -196,4 +158,4 @@ public abstract class BehaviorData { return base.ToString().FormatTypeName(); } -} \ No newline at end of file +} diff --git a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs index 330931739..4b1d3e6a9 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs @@ -9,12 +9,7 @@ using MessagePack; using Unity.Mathematics; using static Unity.Mathematics.math; -[Inspectable, - Union(0, typeof(InstantWeaponData)), - Union(1, typeof(LauncherData)), - Union(2, typeof(ConstantWeaponData)), - Union(3, typeof(ChargedWeaponData)), - RuntimeInspectable] +[Inspectable, RuntimeInspectable] public abstract class WeaponData : BehaviorData { [Inspectable, Key(1), RuntimeInspectable] diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 4758caddf..5f1f128a3 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -215,7 +215,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. plain runtime/session/config 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. + change detection. Agent task runtime shapes no longer carry MessagePack + object, union, key, or ignore metadata. They remain plain in-memory AI task + DTOs until a typed Verse task document exists. - 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. @@ -258,9 +260,10 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. owns simulation. The runtime no longer has a MessagePack catalog cache. `AetheriaRuntimeItemCatalog` materializes temporary `ItemData` DTOs from typed item records for the old simulation object model. `DatabaseEntry` no longer - carries MessagePack union metadata; remaining item/behavior DTO MessagePack - keys are temporary projection metadata until typed behavior factories replace - reflection. Item properties + carries MessagePack union metadata, and behavior type selection now uses an + explicit runtime catalog map instead of `UnionAttribute` reflection. + Remaining item/behavior DTO MessagePack keys are temporary projection metadata + until typed behavior factories replace reflection. Item properties manufacturer display is a typed snapshot consumer; loadout generation is the remaining runtime single-ID item lookup bridge. The old trade debug UI and console `give` command have been deleted. No live caller can enumerate legacy @@ -442,6 +445,10 @@ First Aetheria surfaces to publish: `LegacyItemCatalogCache`, and the runtime MessagePack deserializer path. - Done: demote `DatabaseEntry` and `DatabaseLink` from MessagePack union/object shapes to plain runtime identity/link helpers. + - Done: replace behavior union reflection with an explicit runtime catalog + behavior map and remove all live `Union(...)` annotations. + - Done: demote agent task runtime shapes from MessagePack object/key/union + metadata to plain in-memory DTOs. - Convert domain references from GUID/base-class patterns to typed record refs. - Remove runtime dependency on `ItemData` DTOs as item instance owners.