Demote Unity config MessagePack metadata

This commit is contained in:
Meta Vens 2026-06-13 11:14:38 +01:00
commit 64e596d92d
10 changed files with 84 additions and 106 deletions

Binary file not shown.

View file

@ -3,8 +3,6 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using MessagePack;
using MessagePack.Formatters;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;

View file

@ -1,9 +1,7 @@
using System; using System;
using MessagePack;
[MessagePackObject]
public class EnumDictionary<E, T> where E : Enum public class EnumDictionary<E, T> where E : Enum
{ {
[Key(0)] public T[] Values; public T[] Values;
public EnumDictionary() public EnumDictionary()
{ {

View file

@ -1,84 +1,80 @@
using System; using System;
using MessagePack;
using Unity.Mathematics; using Unity.Mathematics;
using static Unity.Mathematics.math; using static Unity.Mathematics.math;
using static Unity.Mathematics.noise; using static Unity.Mathematics.noise;
using float2 = Unity.Mathematics.float2; using float2 = Unity.Mathematics.float2;
[Serializable, MessagePackObject] [Serializable]
public class ZoneEnvironment public class ZoneEnvironment
{ {
[Key(0)] public NebulaSettings Nebula; public NebulaSettings Nebula;
[Key(1)] public FlowSettings Flow; public FlowSettings Flow;
[Key(2)] public NoiseSettings Noise; public NoiseSettings Noise;
[Key(3)] public AmbientLightingSettings Lighting; public AmbientLightingSettings Lighting;
[Key(4)] public GridSettings Grid; public GridSettings Grid;
} }
[Serializable, MessagePackObject] [Serializable]
public class NebulaSettings public class NebulaSettings
{ {
[Key(0)] public float FillDensity; public float FillDensity;
[Key(1)] public float FillDistance; public float FillDistance;
[Key(2)] public float FillExponent; public float FillExponent;
[Key(12)] public float FillOffset; public float FillOffset;
[Key(3)] public float PatchDensity; public float PatchDensity;
[Key(4)] public float FloorOffset; public float FloorOffset;
[Key(5)] public float FloorBlend; public float FloorBlend;
[Key(6)] public float PatchBlend; public float PatchBlend;
[Key(7)] public float Luminance; public float Luminance;
[Key(13)] public float Extinction; public float Extinction;
//[Key(8)] public float TintExponent; public float TintLodExponent;
[Key(9)] public float TintLodExponent; public float SafetyDistance;
[Key(10)] public float SafetyDistance;
} }
[Serializable, MessagePackObject] [Serializable]
public class GridSettings public class GridSettings
{ {
[Key(0)] public bool Enabled; public bool Enabled;
[Key(1)] public float Offset; public float Offset;
} }
[Serializable, MessagePackObject] [Serializable]
public class AmbientLightingSettings public class AmbientLightingSettings
{ {
[Key(0)] public float DynamicSkyBoost; public float DynamicSkyBoost;
[Key(1)] public float DynamicLodHigh; public float DynamicLodHigh;
[Key(2)] public float DynamicLodLow; public float DynamicLodLow;
[Key(3)] public float DynamicIntensity; public float DynamicIntensity;
} }
[Serializable, MessagePackObject] [Serializable]
public class FlowSettings public class FlowSettings
{ {
[Key(0)] public float GlobalScale; public float GlobalScale;
[Key(1)] public float GlobalAmplitude; public float GlobalAmplitude;
[Key(2)] public float GlobalScrollSpeed; public float GlobalScrollSpeed;
[Key(3)] public float Period; public float Period;
[Key(4)] public float SlopeAmplitude; public float SlopeAmplitude;
[Key(5)] public float SwirlAmplitude; public float SwirlAmplitude;
} }
[Serializable, MessagePackObject] [Serializable]
public class NoiseSettings public class NoiseSettings
{ {
[Key(0)] public float Scale; public float Scale;
[Key(1)] public float Amplitude; public float Amplitude;
[Key(2)] public float Exponent; public float Exponent;
[Key(3)] public float Speed; public float Speed;
[Key(4)] public float SlopeExponent; public float SlopeExponent;
} }
[Union(0, typeof(PowerBrush)), [Serializable]
Union(1, typeof(SimplexBrush)),
Serializable, MessagePackObject]
public abstract class Brush public abstract class Brush
{ {
[Key(0)] public BrushLayer LayerMask; public BrushLayer LayerMask;
[Key(1)] public float Cutoff; public float Cutoff;
[Key(2)] public float Depth; public float Depth;
[Key(3)] public float EnvelopeExponent; public float EnvelopeExponent;
float powerPulse( float x, float power ) float powerPulse( float x, float power )
{ {
@ -97,7 +93,7 @@ public abstract class Brush
} }
} }
[Serializable, MessagePackObject] [Serializable]
public class PowerBrush : Brush public class PowerBrush : Brush
{ {
protected override float Evaluate(float2 world, float2 uv) protected override float Evaluate(float2 world, float2 uv)
@ -106,26 +102,25 @@ public class PowerBrush : Brush
} }
} }
[Serializable, MessagePackObject] [Serializable]
public abstract class TextureBrush : Brush public abstract class TextureBrush : Brush
{ {
[Key(4)] public float2 Frequency; public float2 Frequency;
[Key(5)] public float2 Phase; public float2 Phase;
} }
[Serializable, MessagePackObject] [Serializable]
public abstract class AnimatedBrush : TextureBrush public abstract class AnimatedBrush : TextureBrush
{ {
[Key(6)] public float AnimationSpeed; public float AnimationSpeed;
[IgnoreMember]
public float Time { get; set; } public float Time { get; set; }
} }
[Serializable, MessagePackObject] [Serializable]
public class SimplexBrush : TextureBrush public class SimplexBrush : TextureBrush
{ {
[Key(6)] public bool AbsoluteValue; public bool AbsoluteValue;
protected override float Evaluate(float2 world, float2 uv) protected override float Evaluate(float2 world, float2 uv)
{ {
@ -134,10 +129,10 @@ public class SimplexBrush : TextureBrush
} }
} }
[Serializable, MessagePackObject] [Serializable]
public class AnimatedSimplexBrush : AnimatedBrush public class AnimatedSimplexBrush : AnimatedBrush
{ {
[Key(7)] public bool AbsoluteValue; public bool AbsoluteValue;
protected override float Evaluate(float2 world, float2 uv) protected override float Evaluate(float2 world, float2 uv)
{ {
@ -146,10 +141,10 @@ public class AnimatedSimplexBrush : AnimatedBrush
} }
} }
[Serializable, MessagePackObject] [Serializable]
public class RadialWaveBrush : TextureBrush public class RadialWaveBrush : TextureBrush
{ {
[Key(7)] public float WaveExponent; public float WaveExponent;
protected override float Evaluate(float2 world, float2 uv) protected override float Evaluate(float2 world, float2 uv)
{ {

View file

@ -5,35 +5,34 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using MessagePack;
using Unity.Mathematics; using Unity.Mathematics;
using static Unity.Mathematics.math; using static Unity.Mathematics.math;
[Serializable, MessagePackObject] [Serializable]
public class ExponentialCurve public class ExponentialCurve
{ {
[Key(0), Inspectable] [Inspectable]
public float Exponent; public float Exponent;
[Key(1), Inspectable] [Inspectable]
public float Multiplier; public float Multiplier;
[Key(2), Inspectable] [Inspectable]
public float Constant; public float Constant;
public float Evaluate(float value) => Multiplier * pow(value, Exponent) + Constant; public float Evaluate(float value) => Multiplier * pow(value, Exponent) + Constant;
} }
[Serializable, MessagePackObject] [Serializable]
public class ExponentialLerp public class ExponentialLerp
{ {
[Key(0), Inspectable] [Inspectable]
public float Exponent; public float Exponent;
[Key(1), Inspectable] [Inspectable]
public float Minimum; public float Minimum;
[Key(2), Inspectable] [Inspectable]
public float Maximum; public float Maximum;
public float Evaluate(float value) => Minimum + pow(saturate(value), Exponent) * (Maximum - Minimum); public float Evaluate(float value) => Minimum + pow(saturate(value), Exponent) * (Maximum - Minimum);

View file

@ -5,12 +5,11 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using MessagePack;
using Unity.Mathematics; using Unity.Mathematics;
using static Unity.Mathematics.math; using static Unity.Mathematics.math;
using static Unity.Mathematics.noise; using static Unity.Mathematics.noise;
[Serializable, MessagePackObject(keyAsPropertyName:true)] [Serializable]
public class PlanetSettings public class PlanetSettings
{ {
public float ZoneDepthExponent; public float ZoneDepthExponent;
@ -35,7 +34,7 @@ public class PlanetSettings
public ExponentialCurve OrbitPeriod; public ExponentialCurve OrbitPeriod;
} }
[Serializable, MessagePackObject(keyAsPropertyName:true)] [Serializable]
public class GalaxyShapeSettings public class GalaxyShapeSettings
{ {
public int Arms = 4; public int Arms = 4;
@ -43,7 +42,7 @@ public class GalaxyShapeSettings
public float TwistExponent = 2; public float TwistExponent = 2;
} }
[Serializable, MessagePackObject(keyAsPropertyName:true)] [Serializable]
public class NameGeneratorSettings public class NameGeneratorSettings
{ {
public int NameGeneratorMinLength = 5; public int NameGeneratorMinLength = 5;
@ -51,7 +50,7 @@ public class NameGeneratorSettings
public int NameGeneratorOrder = 4; public int NameGeneratorOrder = 4;
} }
[Serializable, MessagePackObject(keyAsPropertyName:true)] [Serializable]
public class SectorBackgroundSettings public class SectorBackgroundSettings
{ {
public float NoiseAmplitude; public float NoiseAmplitude;
@ -85,7 +84,7 @@ public class SectorBackgroundSettings
} }
} }
[Serializable, MessagePackObject(keyAsPropertyName:true)] [Serializable]
public class SectorGenerationSettings public class SectorGenerationSettings
{ {
public float LinkDensity = .5f; public float LinkDensity = .5f;
@ -94,7 +93,7 @@ public class SectorGenerationSettings
public int BossCount; public int BossCount;
} }
[Serializable, MessagePackObject(keyAsPropertyName:true)] [Serializable]
public class TutorialGenerationSettings public class TutorialGenerationSettings
{ {
public string ProtagonistFaction; public string ProtagonistFaction;
@ -106,7 +105,7 @@ public class TutorialGenerationSettings
public int ZoneCount = 32; public int ZoneCount = 32;
} }
[Serializable, MessagePackObject(keyAsPropertyName:true)] [Serializable]
public class ZoneGenerationSettings public class ZoneGenerationSettings
{ {
public ExponentialCurve PlanetSafetyRadius; public ExponentialCurve PlanetSafetyRadius;
@ -151,7 +150,7 @@ public class ZoneGenerationSettings
public string[] NameData; public string[] NameData;
} }
[Serializable, MessagePackObject(keyAsPropertyName: true)] [Serializable]
public class GameplaySettings public class GameplaySettings
{ {
public EntitySettings DefaultEntitySettings; public EntitySettings DefaultEntitySettings;
@ -213,7 +212,7 @@ public class GameplaySettings
public float AgentFiringMinDot = .99f; public float AgentFiringMinDot = .99f;
} }
[Serializable, MessagePackObject(keyAsPropertyName: true)] [Serializable]
public class RarityTier public class RarityTier
{ {
public string Name; public string Name;

View file

@ -1,20 +1,9 @@
using MessagePack;
[MessagePackObject]
public class WwiseSoundBinding public class WwiseSoundBinding
{ {
[Key(0)]
public uint PlayEvent; public uint PlayEvent;
} }
[MessagePackObject]
public class WwiseLoopingSoundBinding : WwiseSoundBinding public class WwiseLoopingSoundBinding : WwiseSoundBinding
{ {
[Key(1)]
public uint StopEvent; public uint StopEvent;
} }
// public class WwiseParameterBinding
// {
// [Key(0)]
// public uint Parameter;
// }

View file

@ -3,7 +3,6 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using MessagePack;
using TMPro; using TMPro;
using UniRx; using UniRx;
using UnityEngine; using UnityEngine;

View file

@ -4,7 +4,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using MessagePack;
using Unity.Mathematics; using Unity.Mathematics;
using UnityEngine; using UnityEngine;
using Random = UnityEngine.Random; using Random = UnityEngine.Random;

View file

@ -157,10 +157,12 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
parse/display models, not MessagePack save shapes. `PlayerSettings` is a parse/display models, not MessagePack save shapes. `PlayerSettings` is a
plain session-local runtime object until typed Verse settings are imported plain session-local runtime object until typed Verse settings are imported
into Unity. `ZoneData` body/orbit DTOs, `ItemInstance` DTOs, into Unity. `ZoneData` body/orbit DTOs, `ItemInstance` DTOs,
`EntitySettings`, and `Ship` are also plain runtime/session projections now, `EntitySettings`, `Ship`, Unity inspector game settings, environment/volume
not MessagePack persistence shapes. The global scene-load MessagePack settings, exponential curves, Wwise bindings, and enum dictionaries are also
resolver hook is deleted. The slime compute settings path no longer plain runtime/session/config projections now, not MessagePack persistence
serializes its local parameter struct for change detection. shapes. The global scene-load MessagePack resolver hook is deleted. The slime
compute settings path no longer serializes its local parameter struct for
change detection.
- The dead story compiled-JSON cache sketch and its SHA helper are deleted; - The dead story compiled-JSON cache sketch and its SHA helper are deleted;
story compilation currently reads Ink source directly until a typed Verse story compilation currently reads Ink source directly until a typed Verse
story/cache document exists. story/cache document exists.