com.unity.netcode.gameobjects
com.unity.netcode.gameobjects copied to clipboard
WriteValuePacked Bug
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
Sorry for the delay responding. This is actually known. We do not use the float versions internally. It's been a long-standing todo to make a better implementation of these, but I can't give any insight on when that will happen. Right now, we simply do not have a good implementation of floating point packing, but we cannot remove those methods due to semver restrictions.
Ok,thanks for your answer.
At 2023-09-16 00:03:03, "Kitty Draper" @.***> wrote:
Sorry for the delay responding. This is actually known. We do not use the float versions internally. It's been a long-standing todo to make a better implementation of these, but I can't give any insight on when that will happen. Right now, we simply do not have a good implementation of floating point packing, but we cannot remove those methods due to semver restrictions.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>