LANTERN purge B1: delete the automation chain (Harvester/Conveyor/Fabricator)

Deletes the M7 production systems, automation components/math, authoring, 3
machine prefabs, and 6 test files (-43 tests, 459 green). Trims the automation
paths out of BaseRestoreSystem/SaveStructureScan/BuildPlaceSystem/BuildSendSystem/
HudSystem/HudTheme/StructureCatalogAuthoring/Tuning. RuntimePlacedTag (save
marker, a keeper) re-homed into StructureComponents.cs. StructureType byte codes
stay reserved.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 14:32:11 -07:00
parent 511e78556b
commit a0f6d4a5c4
49 changed files with 39 additions and 2680 deletions
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: c51a770922f68b046b12dc55a7f054c2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,35 +0,0 @@
using ProjectM.Simulation;
using Unity.Entities;
using UnityEngine;
namespace ProjectM.Authoring
{
/// <summary>
/// Authoring for a Conveyor belt ghost prefab. Bakes <see cref="PlacedStructure"/>{Type=Conveyor} +
/// <see cref="Conveyor"/> (default facing; BuildPlaceSystem overrides Direction per placement from the RPC) +
/// a DISABLED <see cref="ConveyorItem"/> (an empty belt). BuildPlaceSystem stamps the Cell; the transport
/// system initializes the period gate on first encounter.
/// </summary>
public class ConveyorAuthoring : MonoBehaviour
{
[Tooltip("Default belt facing (0=+X, 1=-X, 2=+Z, 3=-Z); the build RPC overrides this per placement.")]
public byte Direction = 0;
[Min(1)] public int PeriodTicks = 20;
private class ConveyorBaker : Baker<ConveyorAuthoring>
{
public override void Bake(ConveyorAuthoring authoring)
{
var entity = GetEntity(authoring, TransformUsageFlags.Dynamic);
this.AddPlacedStructure(entity, StructureType.Conveyor);
AddComponent(entity, new Conveyor
{
Direction = authoring.Direction,
PeriodTicks = authoring.PeriodTicks,
});
AddComponent(entity, new ConveyorItem { ResourceId = 0, Count = 0 });
SetComponentEnabled<ConveyorItem>(entity, false); // baked empty (disabled)
}
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 23131e6166dce204582bbedc8511658e
@@ -1,53 +0,0 @@
using ProjectM.Simulation;
using Unity.Entities;
using UnityEngine;
namespace ProjectM.Authoring
{
/// <summary>
/// Authoring for a Fabricator machine ghost prefab. Bakes <see cref="PlacedStructure"/>{Type=Fabricator} +
/// <see cref="Fabricator"/> recipe + a (kept) empty <see cref="MachineInput"/> buffer — the production query
/// needs the buffer as a column, but a ledger-fed Fabricator ignores it. It deposits its output directly into
/// the GLOBAL ledger, so it needs no output buffer. Default recipe (EB-2): 1 Ore -> 3 Charge, ledger-fed
/// (<see cref="Fabricator.InputFromLedger"/> != 0) — mints the turret-ammo Charge that <c>TurretFireSystem</c>
/// spends per shot.
/// </summary>
public class FabricatorAuthoring : MonoBehaviour
{
[Tooltip("Input resource id consumed per run (1=Aether, 2=Ore, 3=Biomass).")]
public byte InResourceId = ResourceId.Ore;
[Min(1)] public int InAmount = 1;
[Tooltip("Output resource id deposited to the global ledger (4 = EB-2 Charge / turret ammo).")]
public byte OutResourceId = ResourceId.Charge;
[Min(1)] public int OutAmount = 3;
[Min(1)] public int PeriodTicks = 30;
[Tooltip("EB-2: 1 = ledger-fed (consume the input from the shared ledger; no conveyor). 0 = M7 MachineInput chain.")]
public byte InputFromLedger = 1;
[Min(1f)] public float MaxHp = 120f;
private class FabricatorBaker : Baker<FabricatorAuthoring>
{
public override void Bake(FabricatorAuthoring authoring)
{
var entity = GetEntity(authoring, TransformUsageFlags.Dynamic);
this.AddPlacedStructure(entity, StructureType.Fabricator);
AddComponent(entity, new Fabricator
{
InResourceId = authoring.InResourceId,
InAmount = authoring.InAmount,
OutResourceId = authoring.OutResourceId,
OutAmount = authoring.OutAmount,
PeriodTicks = authoring.PeriodTicks,
InputFromLedger = authoring.InputFromLedger,
});
AddBuffer<MachineInput>(entity);
// EB-1 parity (DR-032): machines can die. Without Health this baker left the Fabricator OUT of
// the EnemyAISystem fortress-aggro snapshot entirely (its query keys on Health) — an invulnerable
// machine, diverging from DR-032. Now that it IS targetable, the DamageEvent buffer must exist
// (an AI strike appends into it; absent = ECB-playback throw) + Destructible lets
// HealthApplyDamageSystem destroy it at 0 (occupancy auto-frees).
this.AddDamageable(entity, authoring.MaxHp);
}
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 014833c467fb1d6499f437b7bf76db80
@@ -1,36 +0,0 @@
using ProjectM.Simulation;
using Unity.Entities;
using UnityEngine;
namespace ProjectM.Authoring
{
/// <summary>
/// Authoring for a Harvester machine ghost prefab (duplicate a structure ghost so the ownerless interpolated
/// GhostAuthoringComponent comes free). Bakes <see cref="PlacedStructure"/>{Type=Harvester} + <see cref="Harvester"/>
/// stats + an empty <see cref="MachineOutput"/> buffer. BuildPlaceSystem stamps the Cell at placement; the
/// production system initializes the tick baseline on first encounter (NextTick/LastProcessedTick baked 0).
/// </summary>
public class HarvesterAuthoring : MonoBehaviour
{
[Tooltip("Resource id this generator produces (1=Aether, 2=Ore, 3=Biomass).")]
public byte OutputResourceId = ResourceId.Ore;
[Min(1)] public int Yield = 1;
[Min(1)] public int PeriodTicks = 60;
private class HarvesterBaker : Baker<HarvesterAuthoring>
{
public override void Bake(HarvesterAuthoring authoring)
{
var entity = GetEntity(authoring, TransformUsageFlags.Dynamic);
this.AddPlacedStructure(entity, StructureType.Harvester);
AddComponent(entity, new Harvester
{
ResourceId = authoring.OutputResourceId,
Yield = authoring.Yield,
PeriodTicks = authoring.PeriodTicks,
});
AddBuffer<MachineOutput>(entity);
}
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: d69d7296747332b4fbe7901ec5210149
@@ -6,12 +6,10 @@ using UnityEngine.Serialization;
namespace ProjectM.Authoring
{
/// <summary>
/// Authoring for the baked <see cref="StructureCatalog"/> singleton (the build cost/prefab table). For the
/// M6 foundation there is one buildable type (Turret), so the entry is flat fields — only the prefab
/// object-ref + cost amount need inspector wiring; the type + cost-resource are byte consts in the baker
/// (enum-via-MCP is unreliable, and bytes dodge the cross-assembly enum-in-Burst hazard). M7 generalizes to
/// an array; the runtime <see cref="StructureCatalogEntry"/> buffer is already the data-driven shape. Place
/// once in the gameplay subscene.
/// Authoring for the baked <see cref="StructureCatalog"/> singleton (the build cost/prefab table). Flat
/// prefab + cost fields per buildable type (the type + cost-resource are byte consts in the baker —
/// enum-via-MCP is unreliable, and bytes dodge the cross-assembly enum-in-Burst hazard); the runtime
/// <see cref="StructureCatalogEntry"/> buffer is the data-driven shape. Place once in the gameplay subscene.
/// </summary>
public class StructureCatalogAuthoring : MonoBehaviour
{
@@ -33,18 +31,6 @@ namespace ProjectM.Authoring
[Tooltip("Ore cost to build a pylon.")]
[Min(0)] public int PylonCostOre = 2;
[Tooltip("Harvester machine ghost prefab (HarvesterAuthoring + GhostAuthoring).")]
public GameObject HarvesterPrefab;
[Min(0)] public int HarvesterCostOre = 20;
[Tooltip("Fabricator machine ghost prefab (FabricatorAuthoring + GhostAuthoring).")]
public GameObject FabricatorPrefab;
[Min(0)] public int FabricatorCostOre = 30;
[Tooltip("Conveyor belt ghost prefab (ConveyorAuthoring + GhostAuthoring).")]
public GameObject ConveyorPrefab;
[Min(0)] public int ConveyorCostOre = 2;
private class StructureCatalogBaker : Baker<StructureCatalogAuthoring>
{
public override void Bake(StructureCatalogAuthoring authoring)
@@ -84,40 +70,6 @@ namespace ProjectM.Authoring
CostAmount = authoring.PylonCostOre,
});
}
if (authoring.HarvesterPrefab != null)
{
buf.Add(new StructureCatalogEntry
{
Type = StructureType.Harvester,
Prefab = GetEntity(authoring.HarvesterPrefab, TransformUsageFlags.Dynamic),
CostResourceId = ResourceId.Ore,
CostAmount = authoring.HarvesterCostOre,
});
}
if (authoring.FabricatorPrefab != null)
{
buf.Add(new StructureCatalogEntry
{
Type = StructureType.Fabricator,
Prefab = GetEntity(authoring.FabricatorPrefab, TransformUsageFlags.Dynamic),
CostResourceId = ResourceId.Ore,
CostAmount = authoring.FabricatorCostOre,
});
}
if (authoring.ConveyorPrefab != null)
{
buf.Add(new StructureCatalogEntry
{
Type = StructureType.Conveyor,
Prefab = GetEntity(authoring.ConveyorPrefab, TransformUsageFlags.Dynamic),
CostResourceId = ResourceId.Ore,
CostAmount = authoring.ConveyorCostOre,
});
}
}
}
}