Demote runtime save packs to blueprints
This commit is contained in:
parent
e9431261a2
commit
ade6845e1d
13 changed files with 188 additions and 176 deletions
Binary file not shown.
|
|
@ -16,8 +16,8 @@ run state, zone state, entity snapshots, item slots, weapon groups, action-bar
|
|||
bindings, and stat grids. Player settings include player name, tutorial flag,
|
||||
story-file hash cursors, gameplay formatting, graphics preferences, input
|
||||
binding overrides, and action-bar inputs. Do not preserve `SavedGame`,
|
||||
`PlayerSettings`, or `EntityPack` as opaque payloads in the new store; they are
|
||||
source shapes for migration, not portable state authority.
|
||||
`PlayerSettings`, or runtime entity blueprints as opaque payloads in the new
|
||||
store; they are source shapes for projection, not portable state authority.
|
||||
|
||||
The Unity client no longer writes `PlayerSettings.msgpack`, `.loadout`, or
|
||||
`.zone` files. `AetheriaPlayerSettings` is the typed Verse replacement for
|
||||
|
|
@ -38,9 +38,10 @@ or mutate game state locally.
|
|||
The old `SavedGame`/`SavedZone` DTOs and `Galaxy` loader constructor have also
|
||||
been deleted; the new document family is live Verse run/zone state, not a
|
||||
bespoke save-file format.
|
||||
The dead `SavedStory` JSON DTO is gone. `ZonePack` and `EntityPack` remain
|
||||
in-memory construction/loadout snapshots for Unity runtime code, but no longer
|
||||
carry MessagePack persistence attributes.
|
||||
The dead `SavedStory` JSON DTO is gone. `RuntimeZoneBlueprint` and
|
||||
`RuntimeEntityBlueprint` remain in-memory construction/loadout projections for
|
||||
Unity runtime code, but no longer carry save-file vocabulary or MessagePack
|
||||
persistence attributes.
|
||||
|
||||
Keyboard layout rendering now reads the checked-in Unity text asset directly.
|
||||
The old generated `GameData/KeyboardLayouts/*.msgpack` cache was deleted; layout
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
public ItemManager ItemManager { get; private set; }
|
||||
public Zone Zone { get; private set; }
|
||||
public List<EntityPack> Loadouts { get; } = new List<EntityPack>();
|
||||
public List<RuntimeEntityBlueprint> LoadoutBlueprints { get; } = new List<RuntimeEntityBlueprint>();
|
||||
|
||||
private readonly (float2 direction, string name)[] _directions = {
|
||||
(float2(0, 1), "Front"),
|
||||
|
|
@ -250,32 +250,32 @@ public class ActionGameManager : MonoBehaviour
|
|||
};
|
||||
}
|
||||
|
||||
private AetheriaRuntimeLoadoutTemplateCommit ProjectLoadoutTemplate(EntityPack pack)
|
||||
private AetheriaRuntimeLoadoutTemplateCommit ProjectLoadoutTemplate(RuntimeEntityBlueprint blueprint)
|
||||
{
|
||||
return new AetheriaRuntimeLoadoutTemplateCommit
|
||||
{
|
||||
Name = pack.Name ?? "",
|
||||
Name = blueprint.Name ?? "",
|
||||
OwnerPlayerKey = $"global:aetheria.player_settings.v1",
|
||||
RootEntity = ProjectEntityLoadout(pack)
|
||||
RootEntity = ProjectEntityLoadout(blueprint)
|
||||
};
|
||||
}
|
||||
|
||||
private AetheriaRuntimeEntityLoadoutCommit ProjectEntityLoadout(EntityPack pack)
|
||||
private AetheriaRuntimeEntityLoadoutCommit ProjectEntityLoadout(RuntimeEntityBlueprint blueprint)
|
||||
{
|
||||
return new AetheriaRuntimeEntityLoadoutCommit
|
||||
{
|
||||
Name = pack.Name ?? "",
|
||||
Kind = pack is ShipPack ? "ship" : pack is OrbitalEntityPack ? "orbital" : "entity",
|
||||
FactionLegacyId = pack.Faction == Guid.Empty ? "" : pack.Faction.ToString("D"),
|
||||
Hull = ProjectLoadoutItem(pack.Hull),
|
||||
Equipment = ProjectSlots(pack.Equipment),
|
||||
CargoBays = ProjectSlots(pack.CargoBays),
|
||||
DockingBays = ProjectSlots(pack.DockingBays),
|
||||
CargoContents = ProjectCargoBays(pack.CargoContents),
|
||||
DockingBayContents = ProjectCargoBays(pack.DockingBayContents),
|
||||
DockingBayAssignments = pack.DockingBayAssignments ?? Array.Empty<int>(),
|
||||
WeaponGroups = pack.WeaponGroups?.Select(group => (IReadOnlyList<int>)group).ToArray() ?? Array.Empty<IReadOnlyList<int>>(),
|
||||
Children = pack.Children?.Select(ProjectEntityLoadout).ToArray() ?? Array.Empty<AetheriaRuntimeEntityLoadoutCommit>()
|
||||
Name = blueprint.Name ?? "",
|
||||
Kind = blueprint is RuntimeShipBlueprint ? "ship" : blueprint is RuntimeOrbitalEntityBlueprint ? "orbital" : "entity",
|
||||
FactionLegacyId = blueprint.Faction == Guid.Empty ? "" : blueprint.Faction.ToString("D"),
|
||||
Hull = ProjectLoadoutItem(blueprint.Hull),
|
||||
Equipment = ProjectSlots(blueprint.Equipment),
|
||||
CargoBays = ProjectSlots(blueprint.CargoBays),
|
||||
DockingBays = ProjectSlots(blueprint.DockingBays),
|
||||
CargoContents = ProjectCargoBays(blueprint.CargoContents),
|
||||
DockingBayContents = ProjectCargoBays(blueprint.DockingBayContents),
|
||||
DockingBayAssignments = blueprint.DockingBayAssignments ?? Array.Empty<int>(),
|
||||
WeaponGroups = blueprint.WeaponGroups?.Select(group => (IReadOnlyList<int>)group).ToArray() ?? Array.Empty<IReadOnlyList<int>>(),
|
||||
Children = blueprint.Children?.Select(ProjectEntityLoadout).ToArray() ?? Array.Empty<AetheriaRuntimeEntityLoadoutCommit>()
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -416,15 +416,15 @@ public class ActionGameManager : MonoBehaviour
|
|||
return CurrentGalaxy?.Factions == null || faction == null ? -1 : Array.IndexOf(CurrentGalaxy.Factions, faction);
|
||||
}
|
||||
|
||||
public void SaveLoadout(EntityPack pack)
|
||||
public void SaveLoadout(RuntimeEntityBlueprint blueprint)
|
||||
{
|
||||
Loadouts.RemoveAll(loadout => loadout.Name == pack.Name);
|
||||
Loadouts.Add(pack);
|
||||
LoadoutBlueprints.RemoveAll(loadout => loadout.Name == blueprint.Name);
|
||||
LoadoutBlueprints.Add(blueprint);
|
||||
try
|
||||
{
|
||||
var commit = AetheriaRuntimeStateCommitLog.QueueLoadoutTemplate(
|
||||
RuntimeStateFilePath,
|
||||
ProjectLoadoutTemplate(pack));
|
||||
ProjectLoadoutTemplate(blueprint));
|
||||
Debug.Log($"Queued Aetheria Verse loadout commit: {commit.Path}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -754,7 +754,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
nearestFaction,
|
||||
.5f);
|
||||
|
||||
var turret = EntitySerializer.Unpack(ItemManager, Zone, loadoutGenerator.GenerateTurretLoadout(), true);
|
||||
var turret = EntitySerializer.InstantiateFromBlueprint(ItemManager, Zone, loadoutGenerator.GenerateTurretLoadout(), true);
|
||||
turret.Position.xz = _currentEntity.Position.xz +
|
||||
ItemManager.Random.NextFloat2Direction() * ItemManager.Random.NextFloat(50, 500);
|
||||
turret.Zone = Zone;
|
||||
|
|
@ -786,7 +786,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
//
|
||||
// for (int i = 0; i < 8; i++)
|
||||
// {
|
||||
// var ship = EntitySerializer.Unpack(ItemManager, Zone, loadoutGenerator.GenerateShipLoadout(), true);
|
||||
// var ship = EntitySerializer.InstantiateFromBlueprint(ItemManager, Zone, loadoutGenerator.GenerateShipLoadout(), true);
|
||||
// ship.Position.xz = _currentEntity.Position.xz +
|
||||
// ItemManager.Random.NextFloat2Direction() * ItemManager.Random.NextFloat(50, 500);
|
||||
// ship.Zone = Zone;
|
||||
|
|
@ -796,7 +796,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
//
|
||||
// for (int i = 0; i < 8; i++)
|
||||
// {
|
||||
// var turret = EntitySerializer.Unpack(ItemManager, Zone, loadoutGenerator.GenerateTurretLoadout(), true);
|
||||
// var turret = EntitySerializer.InstantiateFromBlueprint(ItemManager, Zone, loadoutGenerator.GenerateTurretLoadout(), true);
|
||||
// turret.Position.xz = _currentEntity.Position.xz +
|
||||
// ItemManager.Random.NextFloat2Direction() * ItemManager.Random.NextFloat(50, 500);
|
||||
// turret.Zone = Zone;
|
||||
|
|
@ -873,7 +873,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
if (galaxyZone.Contents == null)
|
||||
{
|
||||
galaxyZone.PackedContents ??= ZoneGenerator.GenerateZone(
|
||||
galaxyZone.RuntimeBlueprint ??= ZoneGenerator.GenerateZone(
|
||||
ItemManager,
|
||||
RuntimeCatalog,
|
||||
Settings.ZoneSettings,
|
||||
|
|
@ -881,7 +881,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
galaxyZone,
|
||||
IsTutorial
|
||||
);
|
||||
galaxyZone.Contents = new Zone(ItemManager, Settings.PlanetSettings, galaxyZone.PackedContents, galaxyZone, CurrentGalaxy);
|
||||
galaxyZone.Contents = new Zone(ItemManager, Settings.PlanetSettings, galaxyZone.RuntimeBlueprint, galaxyZone, CurrentGalaxy);
|
||||
}
|
||||
Zone = galaxyZone.Contents;
|
||||
PlayMusic(MusicType.Overworld);
|
||||
|
|
@ -961,12 +961,12 @@ public class ActionGameManager : MonoBehaviour
|
|||
SectorMap.QueueZoneReveal(CurrentGalaxy.Entrance.AdjacentZones.Prepend(CurrentGalaxy.Entrance));
|
||||
PopulateLevel(CurrentGalaxy.Entrance);
|
||||
var loadoutGenerator = new LoadoutGenerator(ref ItemManager.Random, ItemManager, RuntimeCatalog, CurrentGalaxy, Zone.GalaxyZone, IsTutorial ? CurrentGalaxy.ResolveFaction(Settings.TutorialGenerationSettings.ProtagonistFaction) : null, 2);
|
||||
var ship = EntitySerializer.Unpack(
|
||||
var ship = EntitySerializer.InstantiateFromBlueprint(
|
||||
ItemManager,
|
||||
Zone,
|
||||
loadoutGenerator.GenerateShipLoadout(data => string.IsNullOrEmpty(Settings.StartingHullName) || data.Name==Settings.StartingHullName ),
|
||||
true);
|
||||
// EntitySerializer.Unpack(ItemManager, Zone, Loadouts.First(x => x.Name == StarterShipTemplate), true);
|
||||
// EntitySerializer.InstantiateFromBlueprint(ItemManager, Zone, LoadoutBlueprints.First(x => x.Name == StarterShipTemplate), true);
|
||||
((Ship) ship).IsPlayerShip = true;
|
||||
ship.Position = float3.zero;
|
||||
ship.Zone = Zone;
|
||||
|
|
|
|||
|
|
@ -6,139 +6,139 @@ using Unity.Mathematics;
|
|||
|
||||
public static class EntitySerializer
|
||||
{
|
||||
public static EntityPack Pack(Entity entity)
|
||||
public static RuntimeEntityBlueprint CaptureBlueprint(Entity entity)
|
||||
{
|
||||
EntityPack pack;
|
||||
RuntimeEntityBlueprint blueprint;
|
||||
if (entity is OrbitalEntity orbital)
|
||||
pack = new OrbitalEntityPack
|
||||
blueprint = new RuntimeOrbitalEntityBlueprint
|
||||
{
|
||||
Orbit = orbital.OrbitData,
|
||||
SecurityLevel = orbital.SecurityLevel,
|
||||
SecurityRadius = orbital.SecurityRadius
|
||||
};
|
||||
else if (entity is Ship ship)
|
||||
pack = new ShipPack
|
||||
blueprint = new RuntimeShipBlueprint
|
||||
{
|
||||
Position = ship.Position,
|
||||
Direction = ship.Direction,
|
||||
IsPlayerShip = ship.IsPlayerShip
|
||||
};
|
||||
else throw new ArgumentException("Attempted to pack an instance of abstract class Entity!");
|
||||
else throw new ArgumentException("Attempted to capture an instance of abstract class Entity!");
|
||||
|
||||
pack.Settings = entity.Settings;
|
||||
blueprint.Settings = entity.Settings;
|
||||
|
||||
// Filter item behavior collections by those with any persistent behaviors
|
||||
// For each item create an object containing the item position and a list of persistent behaviors
|
||||
// Then turn that into a dictionary mapping from item position to an array of every behaviors persistent data
|
||||
pack.PersistedBehaviors = entity.Equipment
|
||||
blueprint.PersistedBehaviors = entity.Equipment
|
||||
.Where(item => item.Behaviors.Any(b=>b is IPersistentBehavior))
|
||||
.Select(item => new {equippable=item, behaviors = item.Behaviors
|
||||
.Where(b=>b is IPersistentBehavior)
|
||||
.Cast<IPersistentBehavior>()})
|
||||
.ToDictionary(x=> x.equippable.Position, x=>x.behaviors.Select(b => b.Store()).ToArray());
|
||||
|
||||
pack.Hull = entity.Hull;
|
||||
pack.Name = entity.Name;
|
||||
pack.Faction = entity.Faction?.ID ?? Guid.Empty;
|
||||
pack.Equipment = entity.Equipment.Select(e => (e.Position, e.EquippableItem)).ToArray();
|
||||
pack.CargoBays = entity.CargoBays.Select(e => (e.Position, e.EquippableItem)).ToArray();
|
||||
pack.DockingBays = entity.DockingBays.Select(e => (e.Position, e.EquippableItem)).ToArray();
|
||||
pack.DockingBayAssignments = entity.DockingBays.Select(x => entity.Children.IndexOf(x.DockedShip)).ToArray();
|
||||
pack.CargoContents = entity.CargoBays.Select(b => b.Cargo.Select(i => (i.Value, i.Key)).ToArray()).ToArray();
|
||||
pack.DockingBayContents = entity.DockingBays.Select(b => b.Cargo.Select(i => (i.Value, i.Key)).ToArray()).ToArray();
|
||||
pack.Armor = entity.Armor;
|
||||
pack.Temperature = entity.Temperature;
|
||||
pack.Conductivity = entity.HullConductivity;
|
||||
pack.Children = entity.Children.Select(Pack).ToArray();
|
||||
pack.WeaponGroups = entity.WeaponGroups.Select(wg => wg.items.Select(item => entity.Equipment.IndexOf(item)).ToArray()).ToArray();
|
||||
return pack;
|
||||
blueprint.Hull = entity.Hull;
|
||||
blueprint.Name = entity.Name;
|
||||
blueprint.Faction = entity.Faction?.ID ?? Guid.Empty;
|
||||
blueprint.Equipment = entity.Equipment.Select(e => (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();
|
||||
blueprint.DockingBayAssignments = entity.DockingBays.Select(x => entity.Children.IndexOf(x.DockedShip)).ToArray();
|
||||
blueprint.CargoContents = entity.CargoBays.Select(b => b.Cargo.Select(i => (i.Value, i.Key)).ToArray()).ToArray();
|
||||
blueprint.DockingBayContents = entity.DockingBays.Select(b => b.Cargo.Select(i => (i.Value, i.Key)).ToArray()).ToArray();
|
||||
blueprint.Armor = entity.Armor;
|
||||
blueprint.Temperature = entity.Temperature;
|
||||
blueprint.Conductivity = entity.HullConductivity;
|
||||
blueprint.Children = entity.Children.Select(CaptureBlueprint).ToArray();
|
||||
blueprint.WeaponGroups = entity.WeaponGroups.Select(wg => wg.items.Select(item => entity.Equipment.IndexOf(item)).ToArray()).ToArray();
|
||||
return blueprint;
|
||||
}
|
||||
|
||||
public static Entity Unpack(ItemManager itemManager, Zone zone, EntityPack pack, bool instantiate = false)
|
||||
public static Entity InstantiateFromBlueprint(ItemManager itemManager, Zone zone, RuntimeEntityBlueprint blueprint, bool instantiate = false)
|
||||
{
|
||||
pack.Settings ??= itemManager.GameplaySettings.DefaultEntitySettings.Copy();
|
||||
return pack switch
|
||||
blueprint.Settings ??= itemManager.GameplaySettings.DefaultEntitySettings.Copy();
|
||||
return blueprint switch
|
||||
{
|
||||
ShipPack shipPack => Unpack(itemManager, zone, shipPack, instantiate),
|
||||
OrbitalEntityPack orbitalEntityPack => Unpack(itemManager, zone, orbitalEntityPack, instantiate),
|
||||
RuntimeShipBlueprint shipBlueprint => InstantiateFromBlueprint(itemManager, zone, shipBlueprint, instantiate),
|
||||
RuntimeOrbitalEntityBlueprint orbitalBlueprint => InstantiateFromBlueprint(itemManager, zone, orbitalBlueprint, instantiate),
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
private static Ship Unpack(ItemManager itemManager, Zone zone, ShipPack pack, bool instantiate = false)
|
||||
private static Ship InstantiateFromBlueprint(ItemManager itemManager, Zone zone, RuntimeShipBlueprint blueprint, bool instantiate = false)
|
||||
{
|
||||
|
||||
var entity = new Ship(itemManager, zone, instantiate ? (EquippableItem) itemManager.Instantiate(pack.Hull) : pack.Hull, pack.Settings);
|
||||
Restore(itemManager, zone, pack, entity, instantiate);
|
||||
entity.Position = pack.Position;
|
||||
entity.Direction = pack.Direction;
|
||||
entity.IsPlayerShip = pack.IsPlayerShip;
|
||||
var entity = new Ship(itemManager, zone, instantiate ? (EquippableItem) itemManager.Instantiate(blueprint.Hull) : blueprint.Hull, blueprint.Settings);
|
||||
Restore(itemManager, zone, blueprint, entity, instantiate);
|
||||
entity.Position = blueprint.Position;
|
||||
entity.Direction = blueprint.Direction;
|
||||
entity.IsPlayerShip = blueprint.IsPlayerShip;
|
||||
return entity;
|
||||
}
|
||||
|
||||
private static OrbitalEntity Unpack(ItemManager itemManager, Zone zone, OrbitalEntityPack pack, bool instantiate = false)
|
||||
private static OrbitalEntity InstantiateFromBlueprint(ItemManager itemManager, Zone zone, RuntimeOrbitalEntityBlueprint blueprint, bool instantiate = false)
|
||||
{
|
||||
var entity = new OrbitalEntity(itemManager, zone, instantiate ? (EquippableItem) itemManager.Instantiate(pack.Hull) : pack.Hull, pack.Orbit, pack.Settings);
|
||||
Restore(itemManager, zone, pack, entity, instantiate);
|
||||
entity.SecurityLevel = pack.SecurityLevel;
|
||||
entity.SecurityRadius = pack.SecurityRadius;
|
||||
if (pack.Story >= 0) entity.Story = zone.GalaxyZone.Locations[pack.Story];
|
||||
var entity = new OrbitalEntity(itemManager, zone, instantiate ? (EquippableItem) itemManager.Instantiate(blueprint.Hull) : blueprint.Hull, blueprint.Orbit, blueprint.Settings);
|
||||
Restore(itemManager, zone, blueprint, entity, instantiate);
|
||||
entity.SecurityLevel = blueprint.SecurityLevel;
|
||||
entity.SecurityRadius = blueprint.SecurityRadius;
|
||||
if (blueprint.Story >= 0) entity.Story = zone.GalaxyZone.Locations[blueprint.Story];
|
||||
return entity;
|
||||
}
|
||||
|
||||
private static void Restore(ItemManager itemManager, Zone zone, EntityPack pack, Entity entity, bool instantiate = false)
|
||||
private static void Restore(ItemManager itemManager, Zone zone, RuntimeEntityBlueprint blueprint, Entity entity, bool instantiate = false)
|
||||
{
|
||||
entity.Name = pack.Name;
|
||||
entity.Faction = zone?.Galaxy?.ResolveFaction(pack.Faction);
|
||||
entity.Children = pack.Children.Select(c =>
|
||||
entity.Name = blueprint.Name;
|
||||
entity.Faction = zone?.Galaxy?.ResolveFaction(blueprint.Faction);
|
||||
entity.Children = blueprint.Children.Select(c =>
|
||||
{
|
||||
var child = Unpack(itemManager, zone, c, instantiate);
|
||||
var child = InstantiateFromBlueprint(itemManager, zone, c, instantiate);
|
||||
child.Parent = entity;
|
||||
return child;
|
||||
}).ToList();
|
||||
foreach (var (position, item) in pack.Equipment) entity.TryEquip(instantiate ? (EquippableItem) itemManager.Instantiate(item) : item, position);
|
||||
foreach (var (position, item) in pack.CargoBays) entity.TryEquip(instantiate ? (EquippableItem) itemManager.Instantiate(item) : item, position);
|
||||
foreach (var (position, item) in pack.DockingBays) entity.TryEquip(instantiate ? (EquippableItem) itemManager.Instantiate(item) : item, position);
|
||||
foreach (var (position, item) in blueprint.Equipment) entity.TryEquip(instantiate ? (EquippableItem) itemManager.Instantiate(item) : item, position);
|
||||
foreach (var (position, item) in blueprint.CargoBays) entity.TryEquip(instantiate ? (EquippableItem) itemManager.Instantiate(item) : item, position);
|
||||
foreach (var (position, item) in blueprint.DockingBays) entity.TryEquip(instantiate ? (EquippableItem) itemManager.Instantiate(item) : item, position);
|
||||
|
||||
for (var i = 0; i < pack.DockingBayAssignments.Length; i++)
|
||||
for (var i = 0; i < blueprint.DockingBayAssignments.Length; i++)
|
||||
{
|
||||
if (pack.DockingBayAssignments[i] != -1)
|
||||
entity.DockingBays[i].DockedShip = entity.Children[pack.DockingBayAssignments[i]] as Ship;
|
||||
if (blueprint.DockingBayAssignments[i] != -1)
|
||||
entity.DockingBays[i].DockedShip = entity.Children[blueprint.DockingBayAssignments[i]] as Ship;
|
||||
}
|
||||
|
||||
for (var bayIndex = 0; bayIndex < pack.CargoContents.Length; bayIndex++)
|
||||
for (var bayIndex = 0; bayIndex < blueprint.CargoContents.Length; bayIndex++)
|
||||
if(entity.CargoBays.Count >= bayIndex + 1)
|
||||
foreach (var (position, item) in pack.CargoContents[bayIndex])
|
||||
foreach (var (position, item) in blueprint.CargoContents[bayIndex])
|
||||
entity.CargoBays[bayIndex].TryStore(instantiate ? itemManager.Instantiate(item) : item, position);
|
||||
|
||||
for (var bayIndex = 0; bayIndex < pack.DockingBayContents.Length; bayIndex++)
|
||||
for (var bayIndex = 0; bayIndex < blueprint.DockingBayContents.Length; bayIndex++)
|
||||
if(entity.DockingBays.Count >= bayIndex + 1)
|
||||
foreach (var (position, item) in pack.DockingBayContents[bayIndex])
|
||||
foreach (var (position, item) in blueprint.DockingBayContents[bayIndex])
|
||||
entity.DockingBays[bayIndex].TryStore(instantiate ? itemManager.Instantiate(item) : item, position);
|
||||
|
||||
// Iterate only over the behaviors of items which contain persistent data
|
||||
// Filter the behaviors for each item to get the persistent ones, then cast them and combine with the persisted data array for that item
|
||||
foreach (var persistentBehaviorData in entity.Equipment
|
||||
.Where(item => pack.PersistedBehaviors.ContainsKey(item.Position))
|
||||
.Where(item => blueprint.PersistedBehaviors.ContainsKey(item.Position))
|
||||
.SelectMany(item => item.Behaviors
|
||||
.Where(b=> b is IPersistentBehavior)
|
||||
.Cast<IPersistentBehavior>()
|
||||
.Zip(pack.PersistedBehaviors[item.Position], (behavior, data) => new{behavior, data})))
|
||||
.Zip(blueprint.PersistedBehaviors[item.Position], (behavior, data) => new{behavior, data})))
|
||||
persistentBehaviorData.behavior.Restore(persistentBehaviorData.data);
|
||||
|
||||
if(!instantiate)
|
||||
entity.Temperature = pack.Temperature;
|
||||
entity.Temperature = blueprint.Temperature;
|
||||
|
||||
if(!instantiate)
|
||||
entity.Armor = pack.Armor;
|
||||
entity.Armor = blueprint.Armor;
|
||||
|
||||
var hullData = itemManager.GetData(entity.Hull);
|
||||
|
||||
foreach(var v in hullData.Shape.Coordinates)
|
||||
entity.HullConductivity[v.x,v.y] = pack.Conductivity[v.x,v.y];
|
||||
entity.HullConductivity[v.x,v.y] = blueprint.Conductivity[v.x,v.y];
|
||||
|
||||
entity.WeaponGroups = pack.WeaponGroups.Select(itemIndices =>
|
||||
entity.WeaponGroups = blueprint.WeaponGroups.Select(itemIndices =>
|
||||
{
|
||||
var items = itemIndices.Select(i => entity.Equipment[i]);
|
||||
return (items.Select(i => i.GetBehavior<Weapon>()).ToList(), items.ToList());
|
||||
|
|
@ -146,14 +146,14 @@ public static class EntitySerializer
|
|||
}
|
||||
}
|
||||
|
||||
public class ShipPack : EntityPack
|
||||
public class RuntimeShipBlueprint : RuntimeEntityBlueprint
|
||||
{
|
||||
public float3 Position;
|
||||
public float2 Direction;
|
||||
public bool IsPlayerShip;
|
||||
}
|
||||
|
||||
public class OrbitalEntityPack : EntityPack
|
||||
public class RuntimeOrbitalEntityBlueprint : RuntimeEntityBlueprint
|
||||
{
|
||||
public Guid Orbit;
|
||||
public int Story = -1;
|
||||
|
|
@ -161,7 +161,7 @@ public class OrbitalEntityPack : EntityPack
|
|||
public float SecurityRadius;
|
||||
}
|
||||
|
||||
public abstract class EntityPack
|
||||
public abstract class RuntimeEntityBlueprint
|
||||
{
|
||||
public string Name;
|
||||
public EquippableItem Hull;
|
||||
|
|
@ -175,7 +175,7 @@ public abstract class EntityPack
|
|||
public int[] DockingBayAssignments;
|
||||
public (int2 position, ItemInstance item)[][] CargoContents;
|
||||
public (int2 position, ItemInstance item)[][] DockingBayContents;
|
||||
public EntityPack[] Children;
|
||||
public RuntimeEntityBlueprint[] Children;
|
||||
public EntitySettings Settings;
|
||||
public Guid Faction;
|
||||
public int[][] WeaponGroups;
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ public class GalaxyZone
|
|||
public Faction[] Factions;
|
||||
public Faction Owner;
|
||||
public Zone Contents;
|
||||
public ZonePack PackedContents;
|
||||
public RuntimeZoneBlueprint RuntimeBlueprint;
|
||||
public bool NamedZone;
|
||||
public List<LocationStory> Locations = new List<LocationStory>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class LoadoutGenerator
|
|||
// PriceExponent = priceExponent;
|
||||
// }
|
||||
|
||||
public EntityPack GenerateShipLoadout(Predicate<HullData> hullFilter = null)
|
||||
public RuntimeEntityBlueprint GenerateShipLoadout(Predicate<HullData> hullFilter = null)
|
||||
{
|
||||
var hullData = RandomHull(HullType.Ship, hullFilter);
|
||||
if(hullData==null)
|
||||
|
|
@ -61,10 +61,10 @@ public class LoadoutGenerator
|
|||
var entity = new Ship(ItemManager, null, hull, ItemManager.GameplaySettings.DefaultEntitySettings);
|
||||
entity.Faction = Faction;
|
||||
OutfitEntity(entity);
|
||||
return EntitySerializer.Pack(entity);
|
||||
return EntitySerializer.CaptureBlueprint(entity);
|
||||
}
|
||||
|
||||
public OrbitalEntityPack GenerateTurretLoadout()
|
||||
public RuntimeOrbitalEntityBlueprint GenerateTurretLoadout()
|
||||
{
|
||||
var hullData = RandomHull(HullType.Turret);
|
||||
if(hullData==null)
|
||||
|
|
@ -76,10 +76,10 @@ public class LoadoutGenerator
|
|||
var entity = new OrbitalEntity(ItemManager, null, hull, Guid.Empty, ItemManager.GameplaySettings.DefaultEntitySettings);
|
||||
entity.Faction = Faction;
|
||||
OutfitEntity(entity);
|
||||
return EntitySerializer.Pack(entity) as OrbitalEntityPack;
|
||||
return EntitySerializer.CaptureBlueprint(entity) as RuntimeOrbitalEntityBlueprint;
|
||||
}
|
||||
|
||||
public OrbitalEntityPack GenerateStationLoadout()
|
||||
public RuntimeOrbitalEntityBlueprint GenerateStationLoadout()
|
||||
{
|
||||
var hullData = RandomHull(HullType.Station);
|
||||
if(hullData==null)
|
||||
|
|
@ -119,7 +119,7 @@ public class LoadoutGenerator
|
|||
|
||||
entity.CanTow = hullData.CanTow;
|
||||
|
||||
return EntitySerializer.Pack(entity) as OrbitalEntityPack;
|
||||
return EntitySerializer.CaptureBlueprint(entity) as RuntimeOrbitalEntityBlueprint;
|
||||
}
|
||||
|
||||
public HullData RandomHull(HullType type, Predicate<HullData> hullFilter = null)
|
||||
|
|
|
|||
|
|
@ -40,26 +40,26 @@ public class Zone
|
|||
{
|
||||
get => (float) _time;
|
||||
}
|
||||
public ZonePack Pack { get; }
|
||||
public RuntimeZoneBlueprint Blueprint { get; }
|
||||
public GalaxyZone GalaxyZone { get; }
|
||||
public Galaxy Galaxy { get; }
|
||||
|
||||
public Zone(ItemManager itemManager, PlanetSettings settings, ZonePack pack, GalaxyZone galaxyZone, Galaxy galaxy)
|
||||
public Zone(ItemManager itemManager, PlanetSettings settings, RuntimeZoneBlueprint blueprint, GalaxyZone galaxyZone, Galaxy galaxy)
|
||||
{
|
||||
_time = pack.Time;
|
||||
_time = blueprint.Time;
|
||||
GalaxyZone = galaxyZone;
|
||||
Galaxy = galaxy;
|
||||
Pack = pack;
|
||||
Blueprint = blueprint;
|
||||
_itemManager = itemManager;
|
||||
Settings = settings;
|
||||
_random = new Random(Convert.ToUInt32(abs(galaxyZone?.Name.GetHashCode() ?? 1337)));
|
||||
|
||||
foreach (var orbit in pack.Orbits)
|
||||
foreach (var orbit in blueprint.Orbits)
|
||||
{
|
||||
Orbits.Add(orbit.ID, new Orbit(Settings, orbit));
|
||||
}
|
||||
|
||||
foreach (var planet in pack.Planets)
|
||||
foreach (var planet in blueprint.Planets)
|
||||
{
|
||||
Planets.Add(planet.ID, planet);
|
||||
switch (planet)
|
||||
|
|
@ -79,16 +79,16 @@ public class Zone
|
|||
}
|
||||
}
|
||||
|
||||
foreach (var entityPack in pack.Entities)
|
||||
foreach (var entityBlueprint in blueprint.Entities)
|
||||
{
|
||||
var entity = EntitySerializer.Unpack(_itemManager, this, entityPack);
|
||||
var entity = EntitySerializer.InstantiateFromBlueprint(_itemManager, this, entityBlueprint);
|
||||
Entities.Add(entity);
|
||||
entity.Activate();
|
||||
if (entity is Ship {IsPlayerShip: false} ship)
|
||||
{
|
||||
Agents.Add(CreateAgent(ship));
|
||||
if (lengthsq(ship.Position) < 1)
|
||||
ship.Position = _itemManager.Random.NextFloat3(float3(-pack.Radius * .5f), float3(pack.Radius * .5f));
|
||||
ship.Position = _itemManager.Random.NextFloat3(float3(-blueprint.Radius * .5f), float3(blueprint.Radius * .5f));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -104,13 +104,13 @@ public class Zone
|
|||
return agent;
|
||||
}
|
||||
|
||||
public ZonePack PackZone()
|
||||
public RuntimeZoneBlueprint CaptureBlueprint()
|
||||
{
|
||||
return new ZonePack
|
||||
return new RuntimeZoneBlueprint
|
||||
{
|
||||
Radius = Pack.Radius,
|
||||
Mass = Pack.Mass,
|
||||
Entities = Entities.Select(EntitySerializer.Pack).ToList(),
|
||||
Radius = Blueprint.Radius,
|
||||
Mass = Blueprint.Mass,
|
||||
Entities = Entities.Select(EntitySerializer.CaptureBlueprint).ToList(),
|
||||
Orbits = Orbits.Values.Select(o=>o.Data).ToList(),
|
||||
Planets = Planets.Values.ToList(),
|
||||
Time = _time
|
||||
|
|
@ -325,7 +325,7 @@ public class Zone
|
|||
|
||||
public float GetHeight(float2 position)
|
||||
{
|
||||
var result = -PowerPulse(length(position)/(Pack.Radius*2), Settings.ZoneDepthExponent) * Settings.ZoneDepth;
|
||||
var result = -PowerPulse(length(position)/(Blueprint.Radius*2), Settings.ZoneDepthExponent) * Settings.ZoneDepth;
|
||||
foreach (var body in PlanetInstances.Values)
|
||||
{
|
||||
var p = position - body.Orbit.Position; //GetOrbitPosition(body.BodyData.Orbit)
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ using static Unity.Mathematics.math;
|
|||
using float2 = Unity.Mathematics.float2;
|
||||
using float3 = Unity.Mathematics.float3;
|
||||
|
||||
public class ZonePack
|
||||
public class RuntimeZoneBlueprint
|
||||
{
|
||||
public List<BodyData> Planets = new List<BodyData>();
|
||||
public List<OrbitData> Orbits = new List<OrbitData>();
|
||||
public List<EntityPack> Entities = new List<EntityPack>();
|
||||
public List<RuntimeEntityBlueprint> Entities = new List<RuntimeEntityBlueprint>();
|
||||
public float Radius = 2000;
|
||||
public float Mass = 10000;
|
||||
public double Time;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public static class ZoneGenerator
|
|||
|
||||
private const int MaximumPlacementSamples = 32;
|
||||
|
||||
public static ZonePack GenerateZone(
|
||||
public static RuntimeZoneBlueprint GenerateZone(
|
||||
ItemManager itemManager,
|
||||
AetheriaRuntimeCatalogSnapshot runtimeCatalog,
|
||||
ZoneGenerationSettings zoneSettings,
|
||||
|
|
@ -43,13 +43,13 @@ public static class ZoneGenerator
|
|||
GalaxyZone galaxyZone,
|
||||
bool isTutorial = false)
|
||||
{
|
||||
var pack = new ZonePack();
|
||||
var blueprint = new RuntimeZoneBlueprint();
|
||||
|
||||
var random = new Random(unchecked((uint) galaxyZone.Name.GetHashCode()) ^ hash(galaxyZone.Position));
|
||||
|
||||
var density = saturate(galaxy.Background.CloudDensity(galaxyZone.Position)/2);
|
||||
pack.Radius = zoneSettings.ZoneRadius.Evaluate(density);
|
||||
pack.Mass = zoneSettings.ZoneMass.Evaluate(density);
|
||||
blueprint.Radius = zoneSettings.ZoneRadius.Evaluate(density);
|
||||
blueprint.Mass = zoneSettings.ZoneMass.Evaluate(density);
|
||||
var targetSubzoneCount = zoneSettings.SubZoneCount.Evaluate(density);
|
||||
|
||||
//Debug.Log($"Generating zone at position {zone.Position} with radius {zoneRadius} and mass {zoneMass}");
|
||||
|
|
@ -57,13 +57,13 @@ public static class ZoneGenerator
|
|||
var planets = new List<GeneratorPlanet>();
|
||||
if (targetSubzoneCount > 1)
|
||||
{
|
||||
var zoneBoundary = new Circle(float2.zero, pack.Radius * zoneSettings.ZoneBoundaryRadius);
|
||||
var zoneBoundary = new Circle(float2.zero, blueprint.Radius * zoneSettings.ZoneBoundaryRadius);
|
||||
float boundaryTangentRadius(float2 point) => -zoneBoundary.DistanceTo(point);
|
||||
|
||||
var occupiedAreas = new List<Circle>();
|
||||
float tangentRadius(float2 point) => min(boundaryTangentRadius(point), occupiedAreas.Min(circle => circle.DistanceTo(point)));
|
||||
|
||||
var startPosition = random.NextFloat(pack.Radius * .25f, pack.Radius * .5f) * random.NextFloat2Direction();
|
||||
var startPosition = random.NextFloat(blueprint.Radius * .25f, blueprint.Radius * .5f) * random.NextFloat2Direction();
|
||||
occupiedAreas.Add(new Circle(startPosition, boundaryTangentRadius(startPosition)));
|
||||
|
||||
int samples = 0;
|
||||
|
|
@ -72,7 +72,7 @@ public static class ZoneGenerator
|
|||
samples = 0;
|
||||
for (int i = 0; i < MaximumPlacementSamples; i++)
|
||||
{
|
||||
var samplePos = random.NextFloat2(-pack.Radius, pack.Radius);
|
||||
var samplePos = random.NextFloat2(-blueprint.Radius, blueprint.Radius);
|
||||
var rad = tangentRadius(samplePos);
|
||||
if (rad > 0)
|
||||
{
|
||||
|
|
@ -87,18 +87,18 @@ public static class ZoneGenerator
|
|||
var totalArea = occupiedAreas.Sum(c => c.Area);
|
||||
foreach (var c in occupiedAreas)
|
||||
{
|
||||
planets.AddRange(GenerateEntities(zoneSettings, ref random, c.Area / totalArea * pack.Mass, c.Radius, c.Center));
|
||||
planets.AddRange(GenerateEntities(zoneSettings, ref random, c.Area / totalArea * blueprint.Mass, c.Radius, c.Center));
|
||||
}
|
||||
}
|
||||
else
|
||||
planets.AddRange(GenerateEntities(zoneSettings, ref random, pack.Mass, pack.Radius, float2.zero));
|
||||
planets.AddRange(GenerateEntities(zoneSettings, ref random, blueprint.Mass, blueprint.Radius, float2.zero));
|
||||
|
||||
// Create collections to map between zone generator output and database entries
|
||||
var orbitMap = new Dictionary<GeneratorPlanet, OrbitData>();
|
||||
var orbitInverseMap = new Dictionary<OrbitData, GeneratorPlanet>();
|
||||
|
||||
// Create orbit database entries
|
||||
pack.Orbits = planets.Select(planet =>
|
||||
blueprint.Orbits = planets.Select(planet =>
|
||||
{
|
||||
var data = new OrbitData
|
||||
{
|
||||
|
|
@ -113,7 +113,7 @@ public static class ZoneGenerator
|
|||
}).ToList();
|
||||
|
||||
// Link OrbitData parents to database GUIDs
|
||||
foreach (var data in pack.Orbits)
|
||||
foreach (var data in blueprint.Orbits)
|
||||
data.Parent = orbitInverseMap[data].Parent != null
|
||||
? orbitMap[orbitInverseMap[data].Parent].ID
|
||||
: Guid.Empty;
|
||||
|
|
@ -122,7 +122,7 @@ public static class ZoneGenerator
|
|||
// var resourceMaps = mapLayers.Values
|
||||
// .ToDictionary(m => m.ID, m => m.Evaluate(zone.Position, settings.ShapeSettings));
|
||||
|
||||
pack.Planets = planets.Where(p=>!p.Empty).Select(planet =>
|
||||
blueprint.Planets = planets.Where(p=>!p.Empty).Select(planet =>
|
||||
{
|
||||
// Dictionary<Guid, float> planetResources = new Dictionary<Guid, float>();
|
||||
BodyType bodyType = planet.Belt ? BodyType.Asteroid :
|
||||
|
|
@ -259,7 +259,7 @@ public static class ZoneGenerator
|
|||
Distance = baseOrbit.Distance,
|
||||
Phase = baseOrbit.Phase + PI / 3 * sign(random.NextFloat() - .5f)
|
||||
};
|
||||
pack.Orbits.Add(lagrangeOrbit);
|
||||
blueprint.Orbits.Add(lagrangeOrbit);
|
||||
return lagrangeOrbit;
|
||||
}
|
||||
|
||||
|
|
@ -274,11 +274,11 @@ public static class ZoneGenerator
|
|||
Distance = orbit.Distance,
|
||||
Phase = orbit.Phase + phase
|
||||
};
|
||||
pack.Orbits.Add(turretOrbit);
|
||||
blueprint.Orbits.Add(turretOrbit);
|
||||
var turret = loadoutGenerator.GenerateTurretLoadout();
|
||||
if (turret == null) return;
|
||||
turret.Orbit = turretOrbit.ID;
|
||||
pack.Entities.Add(turret);
|
||||
blueprint.Entities.Add(turret);
|
||||
}
|
||||
|
||||
void PlaceTurrets(OrbitData orbit, LoadoutGenerator loadoutGenerator, int count)
|
||||
|
|
@ -299,9 +299,9 @@ public static class ZoneGenerator
|
|||
var station = GetLoadoutGenerator(story.Faction).GenerateStationLoadout();
|
||||
station.Orbit = lagrangeOrbit.ID;
|
||||
station.SecurityLevel = story.Security;
|
||||
station.SecurityRadius = pack.Radius;
|
||||
station.SecurityRadius = blueprint.Radius;
|
||||
station.Story = i;
|
||||
pack.Entities.Add(station);
|
||||
blueprint.Entities.Add(station);
|
||||
|
||||
PlaceTurrets(lagrangeOrbit, GetLoadoutGenerator(story.Faction), story.Turrets);
|
||||
}
|
||||
|
|
@ -316,8 +316,8 @@ public static class ZoneGenerator
|
|||
if (station == null) continue;
|
||||
station.Orbit = lagrangeOrbit.ID;
|
||||
station.SecurityLevel = security;
|
||||
station.SecurityRadius = pack.Radius;
|
||||
pack.Entities.Add(station);
|
||||
station.SecurityRadius = blueprint.Radius;
|
||||
blueprint.Entities.Add(station);
|
||||
|
||||
PlaceTurrets(lagrangeOrbit, GetLoadoutGenerator(nearestFaction), 2);
|
||||
}
|
||||
|
|
@ -327,10 +327,10 @@ public static class ZoneGenerator
|
|||
{
|
||||
var ship = GetLoadoutGenerator(nearestFaction).GenerateShipLoadout();
|
||||
if (ship == null) continue;
|
||||
pack.Entities.Add(ship);
|
||||
blueprint.Entities.Add(ship);
|
||||
}
|
||||
|
||||
return pack;
|
||||
return blueprint;
|
||||
}
|
||||
|
||||
// static float ResourceValue(ref Random random, ZoneGenerationSettings settings, SimpleCommodityData resource, float density)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
|
@ -170,19 +170,19 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
ContextMenu.AddOption("Save Loadout",
|
||||
() =>
|
||||
{
|
||||
GameManager.SaveLoadout(EntitySerializer.Pack(_displayedEntity));
|
||||
GameManager.SaveLoadout(EntitySerializer.CaptureBlueprint(_displayedEntity));
|
||||
});
|
||||
|
||||
if (GameManager.Loadouts.Any())
|
||||
if (GameManager.LoadoutBlueprints.Any())
|
||||
{
|
||||
ContextMenu.AddDropdown("Restore Loadout",
|
||||
GameManager.Loadouts.Select<EntityPack, (string text, Action action, bool enabled)>(pack =>
|
||||
ContextMenu.AddDropdown("Restore Loadout",
|
||||
GameManager.LoadoutBlueprints.Select<RuntimeEntityBlueprint, (string text, Action action, bool enabled)>(blueprint =>
|
||||
(
|
||||
$"{pack.Name} - {pack.Price(GameManager.ItemManager):n0}", () =>
|
||||
$"{blueprint.Name} - {blueprint.Price(GameManager.ItemManager):n0}", () =>
|
||||
{
|
||||
var entity = EntitySerializer.Unpack(GameManager.ItemManager, GameManager.Zone, pack, true);
|
||||
var entity = EntitySerializer.InstantiateFromBlueprint(GameManager.ItemManager, GameManager.Zone, blueprint, true);
|
||||
entity.SetParent(GameManager.DockedEntity);
|
||||
GameManager.Credits -= pack.Price(GameManager.ItemManager);
|
||||
GameManager.Credits -= blueprint.Price(GameManager.ItemManager);
|
||||
GameManager.CurrentEntity = entity;
|
||||
if(entity is Ship ship)
|
||||
{
|
||||
|
|
@ -190,7 +190,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
GameManager.DockingBay.DockedShip = ship;
|
||||
}
|
||||
Display(entity);
|
||||
}, pack.Price(GameManager.ItemManager) < GameManager.Credits
|
||||
}, blueprint.Price(GameManager.ItemManager) < GameManager.Credits
|
||||
)));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,35 +71,35 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
var mass = GameManager.Settings.ZoneSettings.ZoneMass.Evaluate(density);
|
||||
Properties.AddProperty("Mass", () => ActionGameManager.PlayerSettings.Format(mass));
|
||||
Properties.AddProperty("Radius", () => ActionGameManager.PlayerSettings.Format(radius));
|
||||
if (zone.PackedContents == null)
|
||||
if (zone.RuntimeBlueprint == null)
|
||||
{
|
||||
Properties.AddProperty(() => "Has not been visited");
|
||||
}
|
||||
else
|
||||
{
|
||||
var planetCount = zone.PackedContents.Planets.Count(body => body is PlanetData).ToString();
|
||||
var planetCount = zone.RuntimeBlueprint.Planets.Count(body => body is PlanetData).ToString();
|
||||
Properties.AddProperty("Planets", () => planetCount);
|
||||
|
||||
var beltCount = zone.PackedContents.Planets.Count(body => body is AsteroidBeltData).ToString();
|
||||
var beltCount = zone.RuntimeBlueprint.Planets.Count(body => body is AsteroidBeltData).ToString();
|
||||
Properties.AddProperty("Asteroid Belts", () => beltCount);
|
||||
|
||||
var giantCount = zone.PackedContents.Planets.Count(body => body is GasGiantData && !(body is SunData)).ToString();
|
||||
var giantCount = zone.RuntimeBlueprint.Planets.Count(body => body is GasGiantData && !(body is SunData)).ToString();
|
||||
Properties.AddProperty("Gas Giants", () => giantCount);
|
||||
|
||||
var starCount = zone.PackedContents.Planets.Count(body => body is SunData).ToString();
|
||||
var starCount = zone.RuntimeBlueprint.Planets.Count(body => body is SunData).ToString();
|
||||
Properties.AddProperty("Stars", () => starCount);
|
||||
|
||||
var stationCount = zone.PackedContents.Entities
|
||||
var stationCount = zone.RuntimeBlueprint.Entities
|
||||
.Count(entity => (GameManager.ItemManager.GetData(entity.Hull) as HullData).HullType == HullType.Station)
|
||||
.ToString();
|
||||
Properties.AddProperty("Stations", () => stationCount);
|
||||
|
||||
var turretCount = zone.PackedContents.Entities
|
||||
var turretCount = zone.RuntimeBlueprint.Entities
|
||||
.Count(entity => (GameManager.ItemManager.GetData(entity.Hull) as HullData).HullType == HullType.Turret)
|
||||
.ToString();
|
||||
Properties.AddProperty("Turrets", () => turretCount);
|
||||
|
||||
var shipCount = zone.PackedContents.Entities
|
||||
var shipCount = zone.RuntimeBlueprint.Entities
|
||||
.Count(entity => (GameManager.ItemManager.GetData(entity.Hull) as HullData).HullType == HullType.Ship)
|
||||
.ToString();
|
||||
Properties.AddProperty("Ships", () => shipCount);
|
||||
|
|
|
|||
|
|
@ -184,9 +184,9 @@ public class ZoneRenderer : MonoBehaviour
|
|||
{
|
||||
ClearZone();
|
||||
Zone = zone;
|
||||
SectorBrushes.localScale = zone.Pack.Radius * 2 * Vector3.one;
|
||||
SlimeGravityCamera.orthographicSize = zone.Pack.Radius;
|
||||
SlimeRenderer.ZoneRadius = zone.Pack.Radius;
|
||||
SectorBrushes.localScale = zone.Blueprint.Radius * 2 * Vector3.one;
|
||||
SlimeGravityCamera.orthographicSize = zone.Blueprint.Radius;
|
||||
SlimeRenderer.ZoneRadius = zone.Blueprint.Radius;
|
||||
foreach (var p in zone.Planets.Values)
|
||||
LoadPlanet(p);
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
AddWormhole(new Wormhole
|
||||
{
|
||||
Target = adjacentZone,
|
||||
Position = dir * zone.Pack.Radius * Settings.WormholeDistanceRatio
|
||||
Position = dir * zone.Blueprint.Radius * Settings.WormholeDistanceRatio
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,10 +59,11 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
|
|||
`PlayerSettings.msgpack`, `.loadout`, `.zone`, and
|
||||
`GameData/KeyboardLayouts/*.msgpack` authority paths are disabled or deleted.
|
||||
The old `SavedGame`/`SavedZone` DTOs and `Galaxy` save-loader constructor are
|
||||
deleted. The dead `SavedStory` JSON DTO is deleted. `ZonePack`, body/orbit
|
||||
zone runtime data, item-instance runtime data, `Ship`, and `EntitySettings`
|
||||
remain as runtime construction/loadout/session projections, but no longer
|
||||
declare themselves as MessagePack persistence documents.
|
||||
deleted. The dead `SavedStory` JSON DTO is deleted.
|
||||
`RuntimeZoneBlueprint`, body/orbit zone runtime data, item-instance runtime
|
||||
data, `Ship`, and `EntitySettings` remain as runtime
|
||||
construction/loadout/session projections, but no longer use save-file
|
||||
vocabulary or declare themselves as MessagePack persistence documents.
|
||||
- `Aetheria.State` now expands `AetheriaPlayerSettings` beyond an active-run
|
||||
pointer into the typed Verse replacement for `PlayerSettings.msgpack`: player
|
||||
name, tutorial flag, story-file hash cursors, gameplay formatting, graphics
|
||||
|
|
@ -75,21 +76,23 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
|
|||
position, direction, faction, hull, equipment slots, weapon groups, and a stat
|
||||
grid. This proves the `.zone` replacement graph is durable typed state. Unity
|
||||
now queues current-zone/current-entity-collection snapshots through the
|
||||
runtime commit log during run checkpoints; `ZonePack` and `EntityPack` remain
|
||||
runtime construction/loadout projections rather than durable file formats.
|
||||
runtime commit log during run checkpoints; `RuntimeZoneBlueprint` and
|
||||
`RuntimeEntityBlueprint` remain runtime construction/loadout projections
|
||||
rather than durable file formats.
|
||||
- `Aetheria.State` now defines `AetheriaLoadoutTemplate` as the typed Verse
|
||||
replacement for bespoke `.loadout` files. It stores structured hull,
|
||||
equipment, cargo bay, docking bay, child-entity, assignment, and weapon-group
|
||||
state through record-key references and typed value slots instead of opaque
|
||||
`EntityPack` serialization. Unity's save/loadout UI now projects its
|
||||
in-memory `EntityPack` into a typed Verse commit command; the in-memory list
|
||||
remains a UI/session cache, not durable authority.
|
||||
runtime blueprint serialization. Unity's save/loadout UI now projects its
|
||||
in-memory `RuntimeEntityBlueprint` into a typed Verse commit command; the
|
||||
in-memory list remains a UI/session cache, not durable authority.
|
||||
- `ActionGameManager` opens `AetheriaRuntimeCatalogStore` over
|
||||
`aetheria-world.cc`, projects it through `AetheriaRuntimeItemCatalog`, and
|
||||
binds `RuntimeCatalogLinkBase` to that typed runtime item reader before gameplay
|
||||
objects read `ItemInstance.Data.Value`. The old `LegacyItemCatalogBoundary`,
|
||||
`LegacyItemCatalogCache`, and runtime MessagePack deserializer path have been
|
||||
deleted. The old `DatabaseEntry`/`DatabaseLink<T>` names have been demoted to
|
||||
gives `ItemManager` explicit item lookup authority. `RuntimeCatalogLink<T>`
|
||||
is now a hydrated identifier/value holder, not a process-global catalog
|
||||
resolver. The old `LegacyItemCatalogBoundary`, `LegacyItemCatalogCache`, and
|
||||
runtime MessagePack deserializer path have been deleted. The old
|
||||
`DatabaseEntry`/`DatabaseLink<T>` names have been demoted to
|
||||
`RuntimeCatalogEntry`/`RuntimeCatalogLink<T>` runtime projection helpers, not
|
||||
MessagePack objects or a global union root.
|
||||
- `ItemManager` no longer exposes the raw runtime item catalog reader as public
|
||||
|
|
@ -629,6 +632,10 @@ First Aetheria surfaces to publish:
|
|||
- Done: quarantine the vendored Unity `MessagePack` assembly by disabling
|
||||
asmdef auto-reference; only explicit state-spine assemblies should see it
|
||||
while the Unity CultCache bridge still needs a low-level `.cc` codec.
|
||||
- Done: demote `ZonePack`/`EntityPack` runtime names to
|
||||
`RuntimeZoneBlueprint`/`RuntimeEntityBlueprint`, and rename loadout
|
||||
collections away from save-payload vocabulary. These are now explicitly
|
||||
runtime construction projections, not portable state authority.
|
||||
- Remaining: delete or quarantine old cache abstractions that no longer
|
||||
protect an invariant once catalog migration has a typed reader.
|
||||
|
||||
|
|
@ -671,6 +678,10 @@ First Aetheria surfaces to publish:
|
|||
auto-reference; `Assets/Scripts` and `Assets/Editor` have no `using
|
||||
MessagePack`, `MessagePackSerializer`, `[MessagePackObject]`, or
|
||||
`IMessagePackFormatter` hits.
|
||||
- Unity batchmode compile returned cleanly after the runtime blueprint rename;
|
||||
live Unity source has no `EntityPack`, `ShipPack`, `OrbitalEntityPack`,
|
||||
`ZonePack`, `PackedContents`, `PackZone`, `EntitySerializer.Pack`, or
|
||||
`EntitySerializer.Unpack` hits.
|
||||
- `Aetheria.State.Smoke` proves the provider-owned Eve command bridge drains
|
||||
`gamecult.eve.command.v1` envelopes, accepts advertised refresh commands,
|
||||
rejects unknown commands, persists `AetheriaEveCommandDrainStatus`, and exposes
|
||||
|
|
|
|||
Loading…
Reference in a new issue