com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

WriteValuePacked Bug

Open YangChenHust opened this issue 1 year ago • 2 comments

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

YangChenHust avatar Jun 26 '23 03:06 YangChenHust

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.

ShadauxCat avatar Sep 15 '23 16:09 ShadauxCat

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: @.***>

YangChenHust avatar Sep 20 '23 07:09 YangChenHust