Unity-Technologies / Unity-Technologies/com.unity.netcode.gameobjects
NetworkTransform Performance Issue in Large Scenes
Personne n'a encore pris cette issue.
- Langage dominant
- C#
- Étoiles
- 2.3k
- Forks
- 461
- Merge moyen
- 3 j 16 h
- PR mergées (30 j)
- 20
Description
Description
The Network Transform component is significantly more expensive than necessary. I suspect this is due to its lack of batching or usage of the Job System. It might be possible to move most, if not all, the logic into a burst compiled job.
Reproduce Steps
- Build a new project with netcode
- Add ~500 network transforms
- Observe profiler in build

Expected Outcome
Executing the syncing of the transforms should incur a time cost on par with simply using a synced network variable of a matrix4x4
Actual Outcome
Considerable performance losses, possibly due to Update overhead
Details
Unity Version 2021.3.12f1
Netcode Version 1.2.0
Transport Version 1.3.0
Additional Thoughts
Im working on a fairly large simulation project, and am using NGO for sharing said data. As such, I have between 500 and 1000 network transforms for syncing simulation data between clients. The profiling data above is after the simulation settles, so the only network messages been sent are heartbeat.
After doing my own deep dive into the network transform, I noticed that the work it was doing wasn't batched. It might be possible to use the job system to deal with these transforms, thus allowing a much larger cap on the amount of synced network objects in a scene.
Sadly, until the performance of the network transform is improved, I'm going to have to attempt to implement my own version of the network transform.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par reproduire le problème dans un projet Unity 2021.3.12f1 comportant environ 500 composants NetworkTransform, puis examinez le profiler dans un build. Comparez le coût de la synchronisation des transforms avec celui d’une variable réseau Matrix4x4 synchronisée, puis déterminez si le chemin de mise à jour de NetworkTransform peut être traité par lots ou déplacé vers le Job System ; le travail est considéré comme terminé lorsque la surcharge en régime stable est sensiblement réduite.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- csharp, unity
- Domaine
- networking, performance
- Type d'issue
- Bug
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 20/100