Unity-Technologies / Unity-Technologies/com.unity.netcode.gameobjects
WriteValuePacked Bug
还没有人认领这个 Issue。
- 主要语言
- 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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 WriteValuePacked API 开始,使用 test runner 重现 float 情况。检查 float-to-uint 转换和 packed serialization 的行为;当确定当前字节数的原因,并且有一个可复现的测试验证预期的序列化大小时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- 领域
- networking
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100