From 2111174adf850531e5e4b8b4b7858717d3874b68 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 17 Oct 2026 05:27:47 +0200 Subject: [PATCH] Stations: a candidate rail clears each massive sibling's extent by the largest station or turret reach Co-Authored-By: Claude Opus 5.5 --- Assets/Scripts/ServerShared/ZoneGenerator.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/ServerShared/ZoneGenerator.cs b/Assets/Scripts/ServerShared/ZoneGenerator.cs index 6597f8541..5248a22bb 100644 --- a/Assets/Scripts/ServerShared/ZoneGenerator.cs +++ b/Assets/Scripts/ServerShared/ZoneGenerator.cs @@ -244,11 +244,15 @@ public static class ZoneGenerator var isTutorialEntrance = isTutorial && galaxyZone == galaxy.Entrance; if (isTutorialEntrance && stationCount < 1) stationCount = 1; // A station's source is a well-bearing body alone on its ring whose rail clears every massive sibling's extent (the - // sibling's support, or its Roche margin if more): its Lagrange orbit then sits clear of any other body. + // sibling's support, or its Roche margin if more) and the largest reach of any station or turret hull: whatever hull + // is built there, its Lagrange orbit then sits clear of any other body. + var cellSize = itemManager.GameplaySettings.SchematicCellSize; + var largestReach = cache.GetAll().Where(h => h.HullType == HullType.Station || h.HullType == HullType.Turret) + .Select(h => h.Reach(cellSize)).DefaultIfEmpty(0f).Max(); var candidates = planets .Where(p => p.Parent != null && !p.Empty && !p.Belt && p.Parent.Children.TrueForAll(c => c == p || (abs(c.Distance - p.Distance) >= WellTree.RingWindow - && (!Massive(c) || abs(c.Distance - p.Distance) > Extent(c))))) + && (!Massive(c) || abs(c.Distance - p.Distance) > Extent(c) + largestReach)))) .OrderBy(p => p.Distance) .ToArray(); // (the rail, how far a body on it keeps others out, whether it is a station's own orbit rather than a base's)