FirstGearGames / FishNet

FishNet: Unity Networking Evolved.
Other
1.39k stars 149 forks source link

Unity Update method issue #745

Closed SnaiperoG3D closed 3 months ago

SnaiperoG3D commented 3 months ago

General Unity version: 2022.3.29f1 Fish-Networking version: 4.3.5Pro

Description There is an issue with Update method in Unity, that this method decrease permormance. A lot as much Behaviors realise this method. https://unity.com/fr/blog/engine-platform/10000-update-calls NetworkObject.cs.Update() Same issue with NetworkTransform, NetworkAnimator. (Potentially somewhere else in fn) Posted in bugs, cuz this issue might be crusial in projects like mine where a lot of nobs in the scene. Plus i believe there is could be a lot of performance improvement on low-mid-cost servers hardware (where a lot of nobs in game ofcource)

In my case there i have 5k nobs with only NetworkObject with 1.34ms for Update. x2 if i will add NetworkTransform to them and x3 for NetworkAnimator. On my hardware: Ryzen 7 1700.

Replication Spawn a lot of nobs and check profiler.

Expected behavior Changed from Unity Update method for every single Behavior to one main, TimeManager can be used for example. I dont have my fix for this cuz idk how fn logic works here, in what code part i should to subscribe for TImeManager and where to unsubscribe. Might be dive in it in few days to fix it with my shitty code fixes :D

Screenshots image

FirstGearGames commented 3 months ago

Not a bug, enhancement. Closing - please submit in discussions.