From 3a57b9b7d6926cf026334c7985a6fe059e3ccc53 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 15 Jun 2026 17:32:19 +0100 Subject: [PATCH] Resolve blueprint factions by typed key --- .voidbot/state/aetheria.cc | Bin 107388 -> 109309 bytes Aetheria.State/README.md | 4 ++++ Assets/Scripts/Gameplay/ActionGameManager.cs | 5 +++-- .../EntityConstructionBlueprintProjector.cs | 16 +++++++++++++++- docs/aetheria-perfect-machine-map.md | 8 +++++--- 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 113659591121684d524f5e02dcdb6acc95b9aebc..7b27f05358816d5a8e85f83a4bfb4ae310986e03 100644 GIT binary patch delta 1495 zcmaJ>y>A>v6xTS`iJ*`u#EFzBh$#q?rR>G$ON;|3A|GHO8n6F)I_A0{zfibEi(64kIeNASVJEHq&c-b)+(j83p4|5xUskpN(xg5 zPg9{-q;g9$t=@r>75)SR+C#QoW=oV@Qfx~4ipzwCDowdHr%QT|0P}h^Qt62XBLHJ5 zY*(v1>CzP@Sg&ZVR$7fnTq?YVBZ0gqypP+xGSsS)S*=>mqnZ?rIf$rv--0yg-|+jZ zsKCm98mO^c2nszE2CYGiN<_$PVlMhA1S(gu6bk=Qv(D38FrNzw@8(Qk9$uhvZgX@n zW5%FlrmJ$C#5NRSvKp`(L32x)mlLSklz_`(uZczHv8l{LsC1@uHJeAMlRLOdj`fGb z>s^rO(k5Um6N)JXs&n))#aSJ18BH|Hx@ZSln6ZRe7>(2rg9aIbx6p5|wD$I4Fwcy$ zPED@S5g$>m4I;(VDk%yYfzo_qPdHHy;{%W((hm0mjN@vkhb2muI1!i0$U`<0(LyF^ zgeZMa+WeZyu&eYc#O9-|&k^nL^5D-mPi_aKabWs0b7Y>JxOh)PrtX^@!RunUI6*%Z z`H*F$7oGuf4k|t)r3b&XmJjWnvgH2gkz@4C|Av1u*ReZf&aE6L^3X82COv6mz0R3? zW0oA5qb#;)YS?8mfr?4u4!=*HakqNpM&nfZin}>Ojy$oa)wQ_&QZSw5F>e?-~ThA>lF08qWjvT+Sw|396#N7Fc0jjDw+Zn|p2y?48K<|_R3&v^q zrk;-q?Nnb-5aIdrJKZ@)P92yYKlpjyiSm%1Z7#IV)))7Ox`dFbYuj*J9}_h$SGW1_ XU2?N7wadG_``umgV1Hd(YOVbXhS?zw delta 194 zcmex+mF>?lwhhaexQtA!OwII6OwFSvGKx-Dn9s;I`7~22OxVl_Bs@8vxe6` (e.Position, e.EquippableItem)).ToArray(); blueprint.CargoBays = entity.CargoBays.Select(e => (e.Position, e.EquippableItem)).ToArray(); blueprint.DockingBays = entity.DockingBays.Select(e => (e.Position, e.EquippableItem)).ToArray(); @@ -77,7 +78,7 @@ public static class EntityConstructionBlueprintProjector private static void Restore(ItemManager itemManager, Zone zone, EntityConstructionBlueprint blueprint, Entity entity, bool instantiate = false) { entity.Name = blueprint.Name; - entity.Faction = zone?.Galaxy?.ResolveFaction(blueprint.Faction); + entity.Faction = ResolveFaction(zone?.Galaxy, blueprint); entity.Children = blueprint.Children.Select(c => { var child = InstantiateFromBlueprint(itemManager, zone, c, instantiate); @@ -110,6 +111,18 @@ public static class EntityConstructionBlueprintProjector return (items.Select(i => i.GetBehavior()).ToList(), items.ToList()); }).ToArray(); } + + private static Faction ResolveFaction(Galaxy galaxy, EntityConstructionBlueprint blueprint) + { + return galaxy == null + ? null + : galaxy.ResolveFactionByKey(blueprint.FactionKey) ?? galaxy.ResolveFaction(blueprint.Faction); + } + + private static string CorporationKey(Guid id) + { + return id == Guid.Empty ? "" : $"aetheria.corporation:legacy:{id:D}"; + } } public class ShipConstructionBlueprint : EntityConstructionBlueprint @@ -140,6 +153,7 @@ public abstract class EntityConstructionBlueprint public EntityConstructionBlueprint[] Children; public EntitySettings Settings; public Guid Faction; + public string FactionKey; public int[][] WeaponGroups; private int _price; diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index f6212ee5e..b48bed494 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -915,9 +915,11 @@ First Aetheria surfaces to publish: - Done: move `Galaxy` faction selection and name generation to the typed runtime catalog; legacy `Faction`/`NameFile` catalog entries no longer decide generated sector factions or zone names. - - Done: move entity faction restore to `Galaxy.ResolveFaction`, so legacy - `Faction` catalog entries no longer decide runtime faction references - after generation. + - Done: move entity faction restore to `Galaxy.ResolveFactionByKey` through + `EntityConstructionBlueprint.FactionKey`, so typed loadout readback and + entity construction resolve corporation identity by typed key first. The + old blueprint `Faction` GUID remains compatibility/fallback for callers + that have not yet been lowered. - Done: move package and canonical manufacturer/corporation/name-file lookup to typed keys (`ManufacturerKey`, `CorporationKey`, `GeonameFileKey`, and `NameFileKey`), and move loadout manufacturer-distance weighting to