Smoother drives across the meadow: no more hitches opening sectors

- Sector maps are put away on a worker thread, and trimmed in batches
- A far sector's texture only needs its look; at most four new ones a frame
- Fresh maps fill rows between their borders instead of testing every cell
- Rocks are marked with plain numbers; marks come back on unpacked maps
- Worked-overlay sort uses float keys; idle belts look on staggered steps
- Chase camera cast no longer allocates; perf demo drives and runs too

Drive phase on a late save: p99 33 -> 16 ms, frames over 20 ms 242 -> 7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NiemandKG
2026-11-10 12:59:16 +06:00
parent 29485df9e1
commit 172c3b978d
6 changed files with 271 additions and 76 deletions

View File

@ -14,6 +14,8 @@ namespace GrassCutter
/// <summary>Dev bots hold / tap the use buttons through these (they bypass focus checks).</summary>
public static bool BotUseHeld, BotUsePressed, BotAltHeld, BotAltPressed;
public static Vector2 BotMove;
/// <summary>The test bots run.</summary>
public static bool BotSprint;
public static bool BotJumpPressed;
/// <summary>The opening film is running: nobody moves.</summary>
public static bool Cinematic;
@ -63,6 +65,7 @@ namespace GrassCutter
get
{
if (Blocked) { s_sprintOn = false; return false; }
if (BotSprint) return true;
if (G != null && G.leftStickButton.isPressed) return true;
if (!SprintToggle) return Binds.Held(Act.Sprint);
if (s_sprintFrame != Time.frameCount)