From c24553879396cac6e4d0285fcfae163e7db0942a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 15 Jun 2026 01:12:22 +0100 Subject: [PATCH] Use typed item keys in server item decisions --- .voidbot/state/aetheria.cc | Bin 92479 -> 92944 bytes .../ServerShared/Agents/Tasks/HaulingTask.cs | 4 +--- Assets/Scripts/ServerShared/Entity.cs | 2 +- .../Scripts/ServerShared/LoadoutGenerator.cs | 4 +--- docs/aetheria-perfect-machine-map.md | 3 +++ 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index abd2372b19b9b1f80628a9392d8bae26e2995a53..04673968ee5a67f24ce88a927a210da3368da7e9 100644 GIT binary patch delta 1718 zcmaJ?PiP%Q9Cn%}ZN#)mjER93eg}J~ylnDb@{%S>Ff}DU4JEW`jS*Yt?aq5|$nMT| zW;XGOkbvM(t#jCe2PrBQ|3D#1K!k!&P&{a(2mvo1D#b%Y@Zizk>?V165`{g@%-a`Lm_Z+&T2d@qMe~L&e4G2;F<-n#Ok1U5c^bf5rSkD zCRyk*byLMbKxKXFql-;dD~v{Xuqs6y@vxeMDhrvU8XNk8dLq^kNw&;ItOn8>RwauS z%K;5NsL|NRBG6PVW%p|;t4ss;Sg5(KLnu}NkAtp9*s+8VpR)+H#4-guRGLu_LI%nt3 zCtxrk#fv^FP$0gXxtCP z64H1$qDrCa7KN^H1#Ya(wJ&;Bzn&I2JB`qkwmmK1k~bh$LOk6t%bqnF(xs}VPQso| z2Kkpa95~Nb4)Uwpasin0F3 z=6hY{McFYmzGEEZe{e9;Tu;UFiwxnR2P&zMuUdrf%%LF3-LY<}PFC=@a?@7mbL zB~|yojcjf#oHouvo4IxGsA(^BuFwDWO~;Y!4tyvspLlc%Bdpb+HLM!k=U(&ccJJiC z&cgp>7HzO2w(}__AEWHDOvK^!++UxZAY;i}50TzvyOZ>_L;A|dI85F>LLN`nI?3^5 z?I>y6nC>FOEtL${Rau3QRdGJcC^p)60@C=N&0<#aatEch`0AI+a@4p(k3vzadq zne07t=DYxbW;tM(_C3KD#!X#ilckwNcV)RtPIi;YwyY|l-Q-kTB@J9+x=C($f2blU zyx2tpP;f;Mai0OczaDpWBS09acfRXS-s~aJx9@!~7RMGp(6ow9q#Jj7$Z+ei&zgX4 z{M}C;d-_;&iTR6VpY}+BDDxp_zU2?Y=SZ%{*u3 z?dFNF^dcUWcUVtK!BP+p!X6?b)=R-6*guCtXel0~2X6(hg5T`hE!pB}-+nXmeZPM* zU)&qHes|=DE2Zb=&(F@Co?kqDa@Jp*ncw`8&EjyFx6@S&jBhf9YeFtlhOHQ2*e zC0vZU_yeF^=r#s6%HDX=?#=Ao9@Hu)jxi%DG&stD4RoH4MMEz+_n8 z7#AAHWZ)^JGD2gZrS!J*n$bY%gz_U12n$avm=!`tabS47ZP%Y5=(i@fBox*Yq_?z`f(}}x*0AEj6m^U}Fd-Fx_ z#9L#-d-B`mBl};jQ}eU# TaskType.Haul; @@ -12,7 +10,7 @@ public class HaulingTask : AgentTask public Entity Target; - public Guid ItemType; + public string ItemKey; public int Quantity; } diff --git a/Assets/Scripts/ServerShared/Entity.cs b/Assets/Scripts/ServerShared/Entity.cs index a3b56c0a1..d8b159b6e 100644 --- a/Assets/Scripts/ServerShared/Entity.cs +++ b/Assets/Scripts/ServerShared/Entity.cs @@ -404,7 +404,7 @@ public abstract class Entity public void GenerateWeaponGroups() { foreach (var group in Weapons - .GroupBy(w => w.Item.EquippableItem.ItemId) + .GroupBy(w => w.Item.EquippableItem.ItemKey) .OrderBy(wg=>wg.Average(w=>w.Range)) .Select((weapons, index) => (weapons, index))) { diff --git a/Assets/Scripts/ServerShared/LoadoutGenerator.cs b/Assets/Scripts/ServerShared/LoadoutGenerator.cs index d0eac04f5..045ebbe57 100644 --- a/Assets/Scripts/ServerShared/LoadoutGenerator.cs +++ b/Assets/Scripts/ServerShared/LoadoutGenerator.cs @@ -336,9 +336,7 @@ public class LoadoutGenerator var itemRow = previousItems.FirstOrDefault(i => FitsHardpoint(i, hardpoint)); var previousItem = itemRow == null ? null - : Guid.TryParse(itemRow.LegacyId, out var previousItemId) - ? entity.Equipment.FirstOrDefault(item => item.EquippableItem.ItemId == previousItemId) - : null; + : entity.Equipment.FirstOrDefault(item => item.EquippableItem.ItemKey == itemRow.ItemKey); itemRow ??= RandomCatalogItem(RuntimeItemCandidateKind.Gear, hardpoint, 2); if (itemRow == null) ItemManager.Log($"No compatible item found for entity {hardpoint.Type} hardpoint!"); else diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 88dba9479..abaee19fd 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -1349,6 +1349,9 @@ First Aetheria surfaces to publish: Unity gameplay, HUD, inventory, trade, ship, and zone helper lookups off `ItemId`/`FindItemByLegacyId` detours. Legacy item lookup remains only as a catalog/migration compatibility API. + - Done: move server-shared weapon grouping, generated loadout previous-item + reuse, and hauling task item target identity off derived item GUIDs and + onto typed `ItemKey` strings. - Done: delete the dead `ItemManager.GetRuntimeItemProjection` bridge after loadout generation stopped hydrating selected typed rows into `EquippableItemData` merely to instantiate equipment.