From e9372ce4c4e1c9a22e22d3e760b424d5628af6dc Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 15 Jun 2026 01:49:45 +0100 Subject: [PATCH] Use item keys only in runtime commits --- .voidbot/state/aetheria.cc | Bin 93601 -> 94710 bytes Aetheria.State.Unity.Smoke/Program.cs | 9 --------- .../AetheriaRuntimeCommitLogApplier.cs | 10 +++++----- Aetheria.State/README.md | 2 +- Assets/Scripts/Gameplay/ActionBarSlot.cs | 12 ------------ Assets/Scripts/Gameplay/ActionGameManager.cs | 9 +-------- .../AetheriaRuntimeStateCommitDocument.cs | 15 --------------- docs/aetheria-perfect-machine-map.md | 8 ++++---- 8 files changed, 11 insertions(+), 54 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 16fea513c11a46fad27fcfd2b81cdf4609f72a39..9953bfc7835eb031c6510c99f51d87540bb81da9 100644 GIT binary patch delta 2187 zcmbVOPfQ&}7DnA2n^ERTL?0X-ueXoVPRYy^-CWb!HZL zr12d*deLs;9vh>!#u#J5fp`)VJ@lgVq+kyi&o-$sBr?0e{u=-Y;OvX$Y%WJNSCr7MH|g=D2=Pj3VH za{2Hcdb1WVpK`y99pQOgW3HKpIc2`)x_U!}o=0SL{psm+mki;B$L_lubCrbW=2$f+ ze7Bna*l`K>Hqh0X3d0wC$cVG!vP8A?Tu1m?5=UcSU|0BMCgBWU6YeWK0hq>Fi9-S| z{7F_OPIZFz;TJ>K-R+%__=ID&pCt0UD>R-Vvdr{7+iOWK91vYmc|0iy6`^H8^g=B{h7%W9TpVjR)}yCq8w zlqO`6Yxo3GxGB}tSY|$x0F`2gLH(K&H^p9L4ha>5ng#r)&!s0(0o7<+Wg1sVLY^16 z3~JTYfKekUoJmG3KyFpxK^{l9<~pOzwbt(ZX{a<)26V>4Cw_GO``%H57XCb521rov z5!*LRi6(u?v81lcRE{O$x<%s5MHkl|t8Jhs#w|Q(xfYWBFGcPmz*NhC&+wn4b)DmL zti&YqofN=OZ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#jP?{8URvA3E@?}Cm)H>H{ zjJc3byMJ+iXtK$x7uiew&wqVucz%A3>lRvgc6|}r!giIA&L`v#LPmqUtOM-rgyLbM zc_C-^j(n(pegCHu_kD~#5xVD7AUL0W@#M?>Xa4@|_{ozmaAU|B>yq@ZHhJI{8<@qp z-^8ke`LX-i>HO_6wwl))te#&ESdZ=I-v;c#o!{()) .Select(resource => new AetheriaBodyResource { - ItemKey = ReferenceKey(resource.ItemKey, "aetheria.item_definition", resource.ItemDefinitionLegacyId ?? ""), + ItemKey = resource.ItemKey ?? "", Amount = resource.Amount }) .ToArray(); @@ -464,7 +464,7 @@ public static class AetheriaRuntimeCommitLogApplier Heatstroke = entity.Heatstroke, Hypothermia = entity.Hypothermia, FactionKey = ReferenceKey("aetheria.corporation", entity.CorporationLegacyId ?? ""), - HullItemKey = ReferenceKey(entity.HullItemKey, "aetheria.item_definition", entity.HullItemDefinitionLegacyId ?? ""), + HullItemKey = entity.HullItemKey ?? "", Equipment = ToEntityItemSlots(entity.Equipment), CargoBays = ToEntityItemSlots(entity.CargoBays), DockingBays = ToEntityItemSlots(entity.DockingBays), @@ -624,7 +624,7 @@ public static class AetheriaRuntimeCommitLogApplier return (consumables ?? Array.Empty()) .Select(consumable => new AetheriaActiveConsumableSnapshot { - ItemKey = ReferenceKey(consumable.ItemKey, "aetheria.item_definition", consumable.ItemDefinitionLegacyId ?? ""), + ItemKey = consumable.ItemKey ?? "", Quality = consumable.Quality, RemainingDuration = consumable.RemainingDuration, Duration = consumable.Duration @@ -666,7 +666,7 @@ public static class AetheriaRuntimeCommitLogApplier { ControlPath = binding.ControlPath ?? "", Kind = binding.Kind ?? "", - TargetKey = ReferenceKey(binding.ItemKey, "aetheria.item_definition", binding.ItemDefinitionLegacyId ?? ""), + TargetKey = binding.ItemKey ?? "", EquipmentIndex = binding.EquipmentIndex, BehaviorIndex = binding.BehaviorIndex, WeaponGroup = binding.WeaponGroup diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index 622325cb4..a3bbf20ae 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -15,7 +15,7 @@ The typed runtime state model is split into player settings, loadout templates, run state, zone state, entity snapshots, item slots, weapon groups, action-bar bindings, stat grids, and runtime session documents. Runtime checkpoints include current action-bar bindings as stable typed targets: input control -path, binding kind, item definition reference, equipment index, behavior index, +path, binding kind, item key, equipment index, behavior index, or weapon-group index. They also include current faction relationship rows as typed corporation references plus relationship tokens and numeric standings. Zone checkpoints include typed orbit and body rows for generated celestial diff --git a/Assets/Scripts/Gameplay/ActionBarSlot.cs b/Assets/Scripts/Gameplay/ActionBarSlot.cs index ef942590b..c4b1b926d 100644 --- a/Assets/Scripts/Gameplay/ActionBarSlot.cs +++ b/Assets/Scripts/Gameplay/ActionBarSlot.cs @@ -97,8 +97,6 @@ public class ActionBarConsumableBinding : ActionBarBinding public string TargetItemKey => Guid.TryParse(Target?.LegacyId, out var legacyId) ? AetheriaRuntimeItemReference.FromLegacyId(legacyId) : ""; - public string TargetItemDefinitionLegacyId => Target?.LegacyId ?? ""; - } public class ActionBarGearBinding : ActionBarBinding @@ -112,16 +110,6 @@ public class ActionBarGearBinding : ActionBarBinding public int BehaviorIndex => Item?.Behaviors == null ? -1 : Array.IndexOf(Item.Behaviors, Behavior); - public string TargetItemDefinitionLegacyId - { - get - { - return AetheriaRuntimeItemReference.ToLegacyId(TargetItemKey) is var legacyId && legacyId != Guid.Empty - ? legacyId.ToString("D") - : ""; - } - } - public string TargetItemKey => Item?.EquippableItem?.ItemKey ?? ""; public ActionBarGearBinding(Entity entity, ActionBarSlot slot, EquippedItem item, IActivatedBehavior behavior) : base(entity, slot) diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index e3e8da81c..dc988d891 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -521,7 +521,6 @@ public class ActionGameManager : MonoBehaviour return new AetheriaRuntimeLoadoutItemCommit { - ItemDefinitionLegacyId = item.ItemId == Guid.Empty ? "" : item.ItemId.ToString("D"), ItemKey = item.ItemKey, Quality = item is CraftedItemInstance crafted ? crafted.Quality : 1.0, Durability = item is EquippableItem equippable ? equippable.Durability : 1.0, @@ -569,7 +568,6 @@ public class ActionGameManager : MonoBehaviour { ControlPath = slot.ControlPath ?? "", Kind = "consumable", - ItemDefinitionLegacyId = consumable.TargetItemDefinitionLegacyId, ItemKey = consumable.TargetItemKey }; case ActionBarGearBinding gear: @@ -577,7 +575,6 @@ public class ActionGameManager : MonoBehaviour { ControlPath = slot.ControlPath ?? "", Kind = "gear", - ItemDefinitionLegacyId = gear.TargetItemDefinitionLegacyId, ItemKey = gear.TargetItemKey, EquipmentIndex = gear.EquipmentIndex, BehaviorIndex = gear.BehaviorIndex @@ -677,7 +674,6 @@ public class ActionGameManager : MonoBehaviour .OrderBy(pair => pair.Key) .Select(pair => new AetheriaRuntimeBodyResourceCommit { - ItemDefinitionLegacyId = LegacyId(pair.Key), ItemKey = AetheriaRuntimeItemReference.FromLegacyId(pair.Key), Amount = pair.Value }) @@ -709,7 +705,6 @@ public class ActionGameManager : MonoBehaviour .OrderBy(pair => pair.Key) .Select(pair => new AetheriaRuntimeBodyResourceCommit { - ItemDefinitionLegacyId = LegacyId(pair.Key), ItemKey = AetheriaRuntimeItemReference.FromLegacyId(pair.Key), Amount = pair.Value }) @@ -824,7 +819,6 @@ public class ActionGameManager : MonoBehaviour Heatstroke = entity.Heatstroke, Hypothermia = entity.Hypothermia, CorporationLegacyId = entity.Faction?.ID.ToString("D") ?? "", - HullItemDefinitionLegacyId = entity.Hull?.ItemId == Guid.Empty ? "" : entity.Hull.ItemId.ToString("D"), HullItemKey = entity.Hull?.ItemKey ?? "", Equipment = ProjectEquippedSlots(entity.Equipment), CargoBays = ProjectEquippedSlots(entity.CargoBays), @@ -1187,7 +1181,6 @@ public class ActionGameManager : MonoBehaviour return entity.ActiveConsumables? .Select(effect => new AetheriaRuntimeActiveConsumableCommit { - ItemDefinitionLegacyId = effect.Item?.ItemId == Guid.Empty ? "" : effect.Item.ItemId.ToString("D"), ItemKey = effect.Item?.ItemKey ?? "", Quality = effect.Item?.Quality ?? 1.0, RemainingDuration = effect.RemainingDuration, @@ -1340,7 +1333,7 @@ public class ActionGameManager : MonoBehaviour { item ??= new AetheriaRuntimeLoadoutItemCommit(); return new AetheriaRuntimeLoadoutItemSnapshot( - ReferenceKey(item.ItemKey, "aetheria.item_definition", item.ItemDefinitionLegacyId ?? ""), + item.ItemKey ?? "", item.Quality, item.Durability, item.Quantity, diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs index e001c76d7..892d5033b 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateCommitDocument.cs @@ -173,9 +173,6 @@ namespace GameCult.Aetheria.State.Unity [MessagePackObject] public sealed class AetheriaRuntimeLoadoutItemCommit { - [Key(0)] - public string ItemDefinitionLegacyId { get; set; } = ""; - [Key(1)] public double Quality { get; set; } = 1.0; @@ -258,9 +255,6 @@ namespace GameCult.Aetheria.State.Unity [Key(1)] public string Kind { get; set; } = ""; - [Key(2)] - public string ItemDefinitionLegacyId { get; set; } = ""; - [Key(3)] public int EquipmentIndex { get; set; } = -1; @@ -389,9 +383,6 @@ namespace GameCult.Aetheria.State.Unity [MessagePackObject] public sealed class AetheriaRuntimeBodyResourceCommit { - [Key(0)] - public string ItemDefinitionLegacyId { get; set; } = ""; - [Key(1)] public double Amount { get; set; } @@ -542,9 +533,6 @@ namespace GameCult.Aetheria.State.Unity [Key(8)] public string CorporationLegacyId { get; set; } = ""; - [Key(9)] - public string HullItemDefinitionLegacyId { get; set; } = ""; - [Key(10)] public IReadOnlyList Equipment { get; set; } = Array.Empty(); @@ -659,9 +647,6 @@ namespace GameCult.Aetheria.State.Unity [MessagePackObject] public sealed class AetheriaRuntimeActiveConsumableCommit { - [Key(0)] - public string ItemDefinitionLegacyId { get; set; } = ""; - [Key(1)] public double Quality { get; set; } = 1.0; diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 6055ec893..079a53ece 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -496,11 +496,11 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. - The dead Unity `NameFile` projection class has been deleted. Runtime name generation reads `AetheriaRuntimeNameFile` records from the typed catalog facade; legacy `GameData/NameFile/*.msgpack` remains migration input only. -- Pending Unity runtime commit envelopes now carry typed item keys for loadout - items, action-bar targets, body resources, entity hulls, and active +- Pending Unity runtime commit envelopes now carry typed item keys only for + loadout items, action-bar targets, body resources, entity hulls, and active consumables. The older `ItemDefinitionLegacyId` and - `HullItemDefinitionLegacyId` fields remain compatibility import/export - fields; the applier prefers `ItemKey`/`HullItemKey` whenever present. + `HullItemDefinitionLegacyId` fields have been deleted from the pending commit + contract; the applier no longer reconstructs item keys from legacy item GUIDs. Corporation legacy IDs still translate to typed corporation record keys at the commit boundary. - Entity restore and loadout manufacturer-distance weighting no longer read