From ede38228bc49de93b5742536b181b4f554e55d60 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 12:54:26 +0100 Subject: [PATCH] Use typed catalog for galaxy names --- .voidbot/state/aetheria.cc | Bin 28952 -> 29414 bytes Aetheria.State/README.md | 4 ++++ .../ServerShared/Aetheria.Shared.Unity.asmdef | 3 ++- Assets/Scripts/ServerShared/Galaxy.cs | 21 +++++++++++++----- Assets/Scripts/UI/MainMenu.cs | 2 ++ docs/aetheria-perfect-machine-map.md | 14 +++++++++--- 6 files changed, 35 insertions(+), 9 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 63aa979a3e5bff0b5f99d697f2810c4665e16a59..48e84e40ffe03e7651aa3dfe6851a92129b4c978 100644 GIT binary patch delta 1125 zcmZWp-Afcv6wg&Oqk=>QN%IFWr~mzJ(WJl-I+79Q#1EY_ug6E9Mi;Ug3g_tS)<;T-=00^_jUL2ZqtwNO>Z|d2MYPg zkuhW9-01S7rmpC7=0O9Qh!Ng=J4HsvVq||yU#9rFdZMM&KQK8@J-S{YjQT(vU?8Y+ zIU|g(5dqYa(UYN`DdVN-QP;11O{PuGq!OX2xRA-{t=%P2S#}W z7nodFlDJ3(i4tx{ABTo77+VUMLzEdVu)Z-43fy;onl9(P)bcYl}g^CpkLX=wp6}?;S-1xNw>xzhwDHm-taYUAQ z=vl;f9W)dgBI_))!P*fN5b(O;XZLJqWS}ARf+sel>wRv4C(jTrP`eV`3O7t36eAP@ zQ;R*zDxOW$6?w=kDk^9yRfIFIf_Ibn{P`nJjriVY3t{-~!Vz?{_mGKIP zN?cq8TYlL$T|GEl?mu$zuX2PsVjcZaVk6Ig+GX5-F2LT2o)(Trg@vxe3yaic#0M5) zd1Ul(cJQQ@#!0equb0LfD7zLQ!}{rgXy;OHW82~;USyamTDv7f-$&N9l`DelM2Sy> zMqPA6>$OUjYi`-S3vqfn905MEa+#CXBuyxws#I6-eja~2ORK$eyB%$@rrLN!JA0$f z?g1^VX(l?~+Izx%hog!G{?Ws0 zuoJYKMoYmT5G*1GHWp%GZ_0=w2-=DIANcmikzhG*-}k-m``+81KSrK>AK80Zs}VndlAmyvd3szZ6k#lQMJ=%1s~}3hu^S!J&MOd>J@rRIxBT1hi>rAer;ZfY4lugU3rWpxb>+ zf}?Ry3LT>f@}ETeXR5vd3wHKu1s6yxkZ7y=2TV`a?zBh$M$HA@+` zxi;E)L%o#ZdKd*96{R|MmtouF`)KHh3zQn;8<}uw$eE%uxT!*H8q5uWC`b z$KJV#6IphcJ?_XpoSL2{JtafJa<7N&&Mp<6FVzb4^p|5-2G^#O$%XSPxHB%eV8a;F zgE?xwh)FrGA>myR9^?eXK3$x(H{Fxfw`&oa#`~Z#rlD|SB&5+`Vd?j2`xzScf(32kC}MVS=GL>);N9(0mEk2f=j?uOqIk92`RP~K`{MN5ZTq)ev$A~L h{$g@i?BM@Uv-kZ6LtF=0Saoogf2fS-Q`?=+`akRLHX;B3 diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index be28b0ac0..226fd6f3e 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -93,6 +93,10 @@ consumers, exposes typed behavior payload read models, and can read the published Eve catalog surface. It does not deserialize legacy `DatabaseEntry` objects and does not write state. Unity can use this as the first package boundary once CultLib/Eve runtime packaging is available. +`Galaxy` now consumes this package-owned runtime catalog for name generation, +so generated zone names come from `aetheria.name_file.v2` records instead of +legacy `NameFile` documents. Faction selection still uses legacy `Faction` +objects until that domain model has a typed runtime replacement. `Aetheria.State.Smoke` writes and reopens full typed player settings plus a typed loadout template in addition to world, catalog, run state, zone state, and diff --git a/Assets/Scripts/ServerShared/Aetheria.Shared.Unity.asmdef b/Assets/Scripts/ServerShared/Aetheria.Shared.Unity.asmdef index 2c6d78df4..ea3ce104d 100644 --- a/Assets/Scripts/ServerShared/Aetheria.Shared.Unity.asmdef +++ b/Assets/Scripts/ServerShared/Aetheria.Shared.Unity.asmdef @@ -5,7 +5,8 @@ "MessagePack", "Unity.Mathematics", "UniRx", - "Ink" + "Ink", + "GameCult.Aetheria.State.Unity" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/Scripts/ServerShared/Galaxy.cs b/Assets/Scripts/ServerShared/Galaxy.cs index af7742a46..da8fa4623 100644 --- a/Assets/Scripts/ServerShared/Galaxy.cs +++ b/Assets/Scripts/ServerShared/Galaxy.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using DataStructures.ViliWonka.Heap; +using GameCult.Aetheria.State.Unity; using Ink.Runtime; using MIConvexHull; using JM.LinqFaster; @@ -33,6 +34,7 @@ public class Galaxy private GalaxyZone[] _exitPath; private Dictionary _nameGenerators = new Dictionary(); private readonly ItemManager _itemManager; + private readonly AetheriaRuntimeCatalogSnapshot _runtimeCatalog; public GalaxyZone[] ExitPath { @@ -49,11 +51,13 @@ public class Galaxy SectorBackgroundSettings background, NameGeneratorSettings nameGeneratorSettings, ItemManager itemManager, + AetheriaRuntimeCatalogSnapshot runtimeCatalog, Action log, Action progressCallback = null, uint seed = 0) { _itemManager = itemManager; + _runtimeCatalog = runtimeCatalog ?? throw new InvalidOperationException("Galaxy generation requires the typed Aetheria runtime catalog."); IsPrelude = false; Background = background; Log = log; @@ -81,7 +85,7 @@ public class Galaxy CalculateFactionInfluence(progressCallback); - GenerateNames(itemManager, nameGeneratorSettings, ref random, progressCallback); + GenerateNames(nameGeneratorSettings, ref random, progressCallback); progressCallback?.Invoke("Done!"); if(progressCallback!=null) Thread.Sleep(500); // Inserting Delay to make it seem like it's doing more work lmao @@ -97,6 +101,7 @@ public class Galaxy SectorBackgroundSettings background, NameGeneratorSettings nameGeneratorSettings, ItemManager itemManager, + AetheriaRuntimeCatalogSnapshot runtimeCatalog, PlayerSettings playerSettings, DirectoryInfo narrativeDirectory, Action log, @@ -104,6 +109,7 @@ public class Galaxy uint seed = 0) { _itemManager = itemManager; + _runtimeCatalog = runtimeCatalog ?? throw new InvalidOperationException("Galaxy generation requires the typed Aetheria runtime catalog."); IsPrelude = true; Background = background; @@ -189,7 +195,7 @@ public class Galaxy CalculateFactionInfluence(progressCallback); - GenerateNames(itemManager, nameGeneratorSettings, ref random, progressCallback); + GenerateNames(nameGeneratorSettings, ref random, progressCallback); // progressCallback?.Invoke("Weaving Narrative"); // var processor = new StoryProcessor(playerSettings, narrativeDirectory, this, ref random, Log); @@ -280,8 +286,7 @@ public class Galaxy } } - private void GenerateNames(ItemManager itemManager, - NameGeneratorSettings nameGeneratorSettings, + private void GenerateNames(NameGeneratorSettings nameGeneratorSettings, ref Random random, Action progressCallback = null) { @@ -290,7 +295,13 @@ public class Galaxy progressCallback?.Invoke($"Feeding Markov Chains: {i + 1} / {Factions.Length}"); //if(progressCallback!=null) Thread.Sleep(250); // Inserting Delay to make it seem like it's doing more work lmao var faction = Factions[i]; - _nameGenerators[faction] = new MarkovNameGenerator(ref random, itemManager.GetCatalogEntry(faction.GeonameFile).Names, nameGeneratorSettings); + var nameFile = _runtimeCatalog.FindNameFileByLegacyId(faction.GeonameFile.ToString()); + if (nameFile == null || nameFile.Names.Count == 0) + { + throw new InvalidOperationException($"Typed catalog has no name file for faction {faction.Name} ({faction.GeonameFile})."); + } + + _nameGenerators[faction] = new MarkovNameGenerator(ref random, nameFile.Names, nameGeneratorSettings); } // Generate zone name using the owner's name generator, otherwise assign catalogue ID diff --git a/Assets/Scripts/UI/MainMenu.cs b/Assets/Scripts/UI/MainMenu.cs index 5c4e4172b..1bf958386 100644 --- a/Assets/Scripts/UI/MainMenu.cs +++ b/Assets/Scripts/UI/MainMenu.cs @@ -118,6 +118,7 @@ public class MainMenu : MonoBehaviour Settings.SectorBackgroundSettings, Settings.NameGeneratorSettings, ActionGameManager.ItemManager, + ActionGameManager.RuntimeCatalog, Debug.Log, setState); Observable.NextFrame().Subscribe(_ => @@ -144,6 +145,7 @@ public class MainMenu : MonoBehaviour Settings.TutorialBackgroundSettings, Settings.NameGeneratorSettings, ActionGameManager.ItemManager, + ActionGameManager.RuntimeCatalog, ActionGameManager.PlayerSettings, ActionGameManager.GameDataDirectory.CreateSubdirectory("Narrative"), Debug.Log, diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 85177a7b5..7e796fb7e 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -93,9 +93,10 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. `ItemManager` for manufacturer display; it resolves the manufacturer through the package-owned `ActionGameManager.RuntimeCatalog` typed snapshot. - `Galaxy` generation no longer accepts `ILegacyCatalogReader`. Sector and - tutorial generation receive `ItemManager` and use the same narrow catalog - lookup port for factions and name files. `ActionGameManager` now has a - private legacy catalog boot helper that feeds only `ItemManager`; + tutorial generation still receive `ItemManager` for legacy `Faction` objects, + but name generation now receives the package-owned typed runtime catalog and + resolves full name arrays from `aetheria.name_file.v2` records. `ActionGameManager` + now has a private legacy catalog boot helper that feeds only `ItemManager`; menu/generation paths no longer receive the legacy reader directly. - `DatabaseLink.Value` can resolve legacy links only after `LegacyCatalogBoundary` binds the pull-only catalog cache. Legacy catalog @@ -136,6 +137,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. that package source and owns the full `Aetheria.State` mapper plus Eve surface read path for .NET smokes. Neither is a simulation owner and neither writes state. + `Aetheria.Shared.Unity` references this package directly so `Galaxy` can + consume typed name files without loading legacy `NameFile` documents. - `AetheriaCatalogSurfaceProjector` now emits the first provider-owned Eve surface from typed catalog state. The importer materializes a `gamecult.eve.surface.v1` catalog operator document at @@ -174,6 +177,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. - The old IMGUI DB inspector under `Assets/Scripts/CultCache/Editor/` has been deleted. `NameTools` can still clean/generate names, but legacy NameFile `.msgpack` export is disabled. +- Galaxy name generation no longer reads legacy `NameFile` entries through + `ItemManager`; it requires the typed runtime catalog opened from + `GameData/aetheria-world.cc`. - MessagePack is no longer used as a runtime object-cloning shortcut for `EntitySettings`, and UI/player-settings startup no longer registers the old MessagePack resolver. Resolver registration is confined to legacy catalog @@ -379,6 +385,8 @@ First Aetheria surfaces to publish: - Done: add a Unity-facing typed catalog read facade and smoke proving it can read the materialized `.cc` catalog plus Eve surface without the legacy catalog reader. + - Done: move `Galaxy` name generation to the typed runtime catalog; legacy + `NameFile` entries no longer decide generated zone names. - Replace `ActionGameManager` cache bootstrap with the new state runtime. - Convert domain references from GUID/base-class patterns to typed record refs.