Use typed catalog for galaxy names

This commit is contained in:
Meta Vens 2026-06-13 12:54:26 +01:00
commit ede38228bc
6 changed files with 35 additions and 9 deletions

Binary file not shown.

View file

@ -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

View file

@ -5,7 +5,8 @@
"MessagePack",
"Unity.Mathematics",
"UniRx",
"Ink"
"Ink",
"GameCult.Aetheria.State.Unity"
],
"includePlatforms": [],
"excludePlatforms": [],

View file

@ -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<Faction, MarkovNameGenerator> _nameGenerators = new Dictionary<Faction, MarkovNameGenerator>();
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<string> log,
Action<string> 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<string> 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<string> 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<NameFile>(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

View file

@ -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,

View file

@ -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<T>.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.