M7 Automation: deterministic Harvester to Conveyor to Fabricator chains
Server-only production chains (never predicted): components + server systems + pure byte-only math (ProductionMath/ConveyorMath/MachineSlotMath), authoring + 3 machine prefabs wired into the Gameplay subscene, StructureCatalog rows, BuildPlace Direction/RuntimePlacedTag, Tuning, and 35 EditMode tests (catch-up gating, conveyor shuffle-invariance, SaveData v2 round-trip). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,18 @@ 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)
|
||||
@@ -71,6 +83,39 @@ 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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user