[TASK] Optimization for Server
Description
CullingSubcontroller.LateUpdate RoleTranslations.ReloadNames RoleHelpMenu.Update Scp079Camera.Update
-- By Zereth --
LiquidWobble.Start -> Destroy WorldmodelLaserExtension.LateUpdate -> Destroy component MainCameraController.LateUpdate -> this.enabled = false CenterScreenRaycast.Awake -> Destroy component BreakableWindow.LateUpdate -> remove need for update every frame InventorySystem.Items.Usables.Scp244.Hypothermia.AudioSubEffect.UpdateEffect -> empty method return EmergencyDoorRelease.ButtonAnimate -> empty method return EmergencyDoorRelease.UpdateLight -> empty method return Scp244DeployablePickup.UpdateEffects -> empty method return OneSidedKeycardFlipper.Awake -> Destroy component AmmoCounterExtension.LateUpdate -> Destroy component StatusBar.Update -> this.enabled = false HumeShieldBarController.Awake -> this.enabled = false AutoHumanRagdoll.LateUpdate -> empty return
CurrentRoomPlayerCache.Update raycasting every frame??
RoomUtils.TryGetRoom -> cache invalid positions and valid positions to prevent raycasts every frame CullingSubcontroller.UpdateAnimator -> OH MY FUCKING GOD!!!!!! FpcServerPositionDistributor -> custom implementation
Hypothermia.UpdateExposure
This methods run on the server but pretty much useless except for probably Translation because sometimes they are used by developers.
Notes
These components are meant to be client-side only, but they were never stripped from the server build. Since they’re attached to the Player prefab, they still load on the server and keep invoking methods that serve no purpose there.
Even with a single player, you can already see the excessive number of calls. Once you scale that up, it becomes a serious performance issue. With 40 players using random classes, you’re looking at 40+ million unnecessary method calls piling up on the server.
Checklist
- [ ] Removing them and adding !NetworkServer.active or Headless.
So me and @NotZer0Two also found out that the Hypothermia is always enabled on the player instead of only applying it when the player is inside the fog
As Zereth suggested, it should "trigger around the bounds of each scp244"
My workaround is to only cache the active ones and check the distance between the hub