There was an error while loading. Please reload this page.
This feature spreads timed-despawn checks and caps how many checks run in a single tick.
Patch in BehaviorDespawn:
BehaviorDespawn
// Stratum: widen the stagger window from 1s to ~5s accumOffset += (float)((entity.EntityId / 73.0) % 5);
This distributes check times across a wider window.
Stratum adds a shared static budget for despawn check evaluations:
private static long stratumLastBudgetTickMs; private static int stratumChecksThisTick; private const int StratumMaxChecksPerTick = 16;
Budget gate in OnGameTick:
OnGameTick
if (stratumChecksThisTick >= StratumMaxChecksPerTick) { accumSeconds = accumOffset - 0.05f; return; } stratumChecksThisTick++;
This defers excess checks to near-future ticks instead of letting one tick eat all of them.
patches/VSEssentials/Entity/Behavior/BehaviorDespawn.cs.patch
VSEssentials/Entity/Behavior/BehaviorDespawn.cs