Unity-Technologies / Unity-Technologies/com.unity.netcode.gameobjects

WriteValuePacked Bug

未關閉
#2,598 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

priority:low Tracking type:support
主要語言
C#
星號
2.3k
分支
461
平均合併
3 天 16 小時
30 天內合併 PR
20

描述

Description

Hello,I find when use the WriteValuePacked api to pack a float value, it will convert the float to uint.Due to the storage format of the float the convert value will bigger than 1 << 29,which can lead to the result of using 5 bytes to serialize the float,so can you tell me the reason why we convert the float to uint.

Reproduce Steps

Use the test runner to pack the float number.

Actual Outcome

Lead to the result of using 5 bytes to serialize the float.

Expected Outcome

Use less than 4 bytes to serialize the float.

Screenshots

image

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 WriteValuePacked API 開始,使用 test runner 重現 float 情況。檢查 float-to-uint 轉換和 packed serialization 的行為;當確定目前位元組數的原因,並且有一個可重現的測試驗證預期的序列化大小時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp
領域
networking
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。