Unity-Technologies / Unity-Technologies/com.unity.netcode.gameobjects
NetworkTransform Performance Issue in Large Scenes
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C#
- Star
- 2.3k
- Fork
- 461
- Merge trung bình
- 3 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 20
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện vấn đề trong một dự án Unity 2021.3.12f1 với khoảng 500 component NetworkTransform và kiểm tra profiler trong một build. So sánh chi phí đồng bộ transform với một biến mạng Matrix4x4 được đồng bộ, sau đó xác định liệu đường dẫn cập nhật của NetworkTransform có thể được xử lý theo lô hoặc chuyển sang Job System hay không; được xem là hoàn thành khi overhead ở trạng thái ổn định giảm đáng kể.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp, unity
- Lĩnh vực
- networking, performance
- Loại issue
- Lỗi
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 20/100