using Unity.Entities; namespace ProjectM.Simulation { /// /// Baked singleton describing the HOME-BASE mining field: a ring of harvestable resource nodes scattered /// around the base so the gather -> build -> survive loop lives on ONE screen (no expedition trip required). /// DISTINCT from (the expedition field) so the two never collide on a /// GetSingleton. keeps the live RegionTag{Base} node count /// topped up to on a tick cadence; nodes scatter UNIFORMLY-IN-RADIUS in the annulus /// [, ] around BaseGridMath.PlotCenter (inner clears the /// square build plot + spawn ring, outer stays inside the walkable boundary ring) and are overridden to /// RegionTag{Base} + ResourceId.Ore (the sole build currency, kept legible — never the expedition's /// Aether/Ore/Biomass round-robin). Place ONE authoring in the gameplay subscene. /// public struct BaseFieldSpawner : IComponentData { /// Baked resource-node ghost prefab to instantiate (reuses the expedition node prefab). public Entity Prefab; /// Desired live base-node count; the system refills toward this each respawn pass. public int TargetCount; /// Inner scatter radius (world units) from the plot center — must clear the build plot + spawn ring. public float InnerRadius; /// Outer scatter radius (world units) — must stay inside the boundary ring so nodes are reachable. public float OuterRadius; /// Server ticks between top-up passes (a depleted field refills toward TargetCount on this cadence). public int RespawnIntervalTicks; } /// /// Server-only runtime state for , baked beside /// . NOT replicated. seeds the per-node scatter RNG /// (monotonic, so a top-up never repeats a layout); gates the cadence (wrap-safe /// via TickUtil.NonZero + NetworkTick.IsNewerThan, never raw uint). NextSpawnTick == 0 means "fire now" so the /// first pass seeds the field without waiting for a tick that never comes. /// public struct BaseFieldRuntime : IComponentData { public int Epoch; public uint NextSpawnTick; } }