RegionClock: the player's zone steps, every other zone's facilities advance by 60 s spans, entering settles the zone and records what the player saw leaving

RegionClock.Step is a run's one driver (ActionGameManager no longer calls Zone.Update); Zone.AdvanceTo runs the off-screen facilities by the span a zone missed and places its orbits at the new time. RegionClock.Enter is the one writer of VisitedZones and GalaxyZone.LastSeen (SavedZone Key 7). PackedContents is a Zone's construction input, cleared by RunStart.Live. The sector map reads RegionClock.Seen. Galaxy's save constructor copies the pack it builds a Zone from, so a Continue in the same process reads the save as written.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-11-28 20:43:11 +01:00
commit fb1f1df869
10 changed files with 156 additions and 53 deletions

View file

@ -363,6 +363,20 @@ public class Zone
private bool IsExpired(ChunkWear wear) => wear.Damage <= 0f && (!wear.BrokenUntil.HasValue || wear.BrokenUntil.Value <= _time);
// A zone the player is not in, brought to `time` (RegionClock.Step and Enter only): its facilities run the span it missed,
// its clock moves, and every orbit is placed at the new time so the next Update differences from it, not from where the
// zone was left.
public void AdvanceTo(double time)
{
var span = time - _time;
if (!(span > 0)) return;
foreach (var entity in Entities.ToArray()) RegionClock.AdvanceFacilities(entity, span);
_time = time;
_updatedOrbits.Clear();
foreach (var orbit in Orbits) GetOrbitPosition(orbit.Key);
}
// The tactical step: one game step of this zone. A run's zones step through RegionClock.Step, its one driver.
public void Update(float deltaTime)
{
_time += deltaTime;