Fix Sky Mower tumbling and the hitches on a big farm

- Mowbot keeps its heading apart from the drawn pose: a flyer's lean and sway
  were fed back each frame and rolled it over.
- Drone pads looked through every loose bundle, testing every belt end, for
  each idle drone every frame (43 ms on a 1500-bundle farm): distance first,
  and a 1.5 s pause after finding nothing.
- Saves are written, laid out and compressed off the main thread; backups go
  in the same queue (an autosave froze the game ~50 ms every 30 s).
- Robots tick on staggered frames.
- -demoperf N profiles save slot N; -demobots logs the Sky Mower's tilt.

On the player's save: frames over 25 ms went from 144 to 0 in 40 s, worst
frame 74 ms -> 22 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NiemandKG
2026-11-09 19:04:36 +06:00
parent 27d075103b
commit 80271aea72
9 changed files with 251 additions and 37 deletions

View File

@ -339,7 +339,7 @@ namespace GrassCutter
foreach (var c in Cargo.All)
if (c && c.IsSpawned && !c.Grab.Consumed && d.cargo.Count < MaxSavedBundles)
d.cargo.Add(new CargoSave { kind = (int)c.kind, kg = c.Kg.Value, at = c.transform.position });
SaveSlots.Write(JsonUtility.ToJson(d), MowMap.Serialize());
SaveSlots.Write(() => JsonUtility.ToJson(d), MowMap.SerializeLater());
}
void Load()