Make canonical Unity client buildable and typed-state seeded

This commit is contained in:
Meta Vens 2026-07-12 07:25:09 +01:00
commit b4e2f1fcc7
13 changed files with 89 additions and 11 deletions

View file

@ -44,9 +44,8 @@ public sealed class AetheriaUnityClient : MonoBehaviour
private static void CreateView()
{
var pipeline = UniversalRenderPipelineAsset.Create();
GraphicsSettings.defaultRenderPipeline = pipeline;
QualitySettings.renderPipeline = pipeline;
if (GraphicsSettings.currentRenderPipeline is not UniversalRenderPipelineAsset)
throw new InvalidOperationException("Aetheria Unity requires the project-configured Universal Render Pipeline asset.");
var cameraObject = new GameObject("Main Camera") { tag = "MainCamera" };
var camera = cameraObject.AddComponent<Camera>();
cameraObject.AddComponent<UniversalAdditionalCameraData>().renderPostProcessing = true;

View file

@ -2,12 +2,15 @@ using System.IO;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using UnityEngine.SceneManagement;
public static class AetheriaUnityBuild
{
public static void BuildWindows()
{
EnsureRenderPipeline();
const string scenePath = "Assets/Aetheria.unity";
var scene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
new GameObject("Aetheria Unity Client").AddComponent<AetheriaUnityClient>();
@ -21,4 +24,40 @@ public static class AetheriaUnityBuild
if (report.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded)
throw new System.InvalidOperationException("Aetheria Unity build failed: " + report.summary.result);
}
private static void EnsureRenderPipeline()
{
const string settingsDirectory = "Assets/Settings";
const string rendererPath = settingsDirectory + "/AetheriaUniversalRenderer.asset";
const string pipelinePath = settingsDirectory + "/AetheriaUniversalRenderPipeline.asset";
if (!AssetDatabase.IsValidFolder(settingsDirectory))
AssetDatabase.CreateFolder("Assets", "Settings");
var renderer = AssetDatabase.LoadAssetAtPath<UniversalRendererData>(rendererPath);
if (renderer == null)
{
renderer = ScriptableObject.CreateInstance<UniversalRendererData>();
renderer.name = "Aetheria Universal Renderer";
AssetDatabase.CreateAsset(renderer, rendererPath);
}
var pipeline = AssetDatabase.LoadAssetAtPath<UniversalRenderPipelineAsset>(pipelinePath);
if (pipeline == null)
{
pipeline = ScriptableObject.CreateInstance<UniversalRenderPipelineAsset>();
pipeline.name = "Aetheria Universal Render Pipeline";
AssetDatabase.CreateAsset(pipeline, pipelinePath);
}
var serialized = new SerializedObject(pipeline);
var rendererList = serialized.FindProperty("m_RendererDataList");
rendererList.arraySize = 1;
rendererList.GetArrayElementAtIndex(0).objectReferenceValue = renderer;
serialized.FindProperty("m_DefaultRendererIndex").intValue = 0;
serialized.ApplyModifiedPropertiesWithoutUndo();
EditorUtility.SetDirty(pipeline);
GraphicsSettings.defaultRenderPipeline = pipeline;
QualitySettings.renderPipeline = pipeline;
AssetDatabase.SaveAssets();
}
}

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6d8cacdee90ec28468309ce67d880eca
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0f71fbcaedd8dfd41901262f38b2970a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cddf5d6d804ca7449a09c71a7eb69794
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -9,6 +9,6 @@
"org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-source-v1.0.3-r2",
"org.gamecult.eve.plugin-fields": "https://github.com/GameCult/EvePlugins.git?path=/plugins/eve-plugin-fields/unity/org.gamecult.eve.plugin-fields#eve-plugin-fields-unity-v0.1.1",
"org.gamecult.eve.surface": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.1.0",
"org.gamecult.eve.unity-scene": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#b112acb34d1e2561f1e770a9088bd0123e6614ab"
"org.gamecult.eve.unity-scene": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#2ed4e263ee266617f827bc606304ad221ea6c00b"
}
}

View file

@ -142,7 +142,7 @@
"hash": "e10821f1cc81f619479c6507438f6a097d1f0ce2"
},
"org.gamecult.eve.unity-scene": {
"version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#b112acb34d1e2561f1e770a9088bd0123e6614ab",
"version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#2ed4e263ee266617f827bc606304ad221ea6c00b",
"depth": 0,
"source": "git",
"dependencies": {
@ -151,7 +151,7 @@
"org.gamecult.eve.surface": "0.1.0",
"com.unity.mathematics": "1.3.2"
},
"hash": "b112acb34d1e2561f1e770a9088bd0123e6614ab"
"hash": "2ed4e263ee266617f827bc606304ad221ea6c00b"
},
"com.unity.modules.assetbundle": {
"version": "1.0.0",

Binary file not shown.

Binary file not shown.

View file

@ -13,7 +13,9 @@ powershell -ExecutionPolicy Bypass -File .\scripts\run-aetheria-unity.ps1
The launcher builds the provider's Unity AssetBundle, starts the Aetheria daemon,
builds this project, and opens the standalone client. Close the client window to
stop the daemon.
stop the daemon. A new writable client run is materialized by
`Aetheria.State.Import` from the provider-owned legacy catalog inputs into the
current typed CultCache schema; source catalog data is not mutated by play.
Configuration is supplied through `EVEUNITY_RENDEZVOUS_ENDPOINT` and
`EVEUNITY_SURFACE_ID`. The defaults are `rudp://127.0.0.1:3076` and

View file

@ -10,7 +10,9 @@ $project = Join-Path $root "Aetheria.Unity"
$artifacts = Join-Path $project "Build\Logs"
$clientExe = Join-Path $project "Build\Windows\Aetheria.exe"
$daemonProject = Join-Path $root "Aetheria.State.Daemon\Aetheria.State.Daemon.csproj"
$importProject = Join-Path $root "Aetheria.State.Import\Aetheria.State.Import.csproj"
$state = Join-Path $project "Build\aetheria-unity.cc"
$stateRecords = "$state.records"
New-Item -ItemType Directory -Force $artifacts | Out-Null
if (-not $SkipBuild) {
@ -38,6 +40,12 @@ if (-not $SkipBuild) {
}
if (-not (Test-Path $clientExe)) { throw "Client executable not found. Run without -SkipBuild first." }
if (-not (Test-Path $stateRecords)) {
dotnet run --project $importProject -- $root $state
if ($LASTEXITCODE -ne 0 -or -not (Test-Path $stateRecords)) {
throw "Aetheria typed state import failed with exit code $LASTEXITCODE"
}
}
$daemonLog = Join-Path $artifacts "daemon.log"
$daemon = Start-Process dotnet -ArgumentList @(
"run", "--project", $daemonProject, "--",