[edit] Devin was kind enough to take notice of my plea. Hopefully I'll get an answer soon !
[edit#2] Jared delivered ! with his help, the problem is now solved and rotations are parsed and rendered correctly !
Hi !
I'm desperate: it's been 2 months already and for the life of me, I can't figure out the new rotation encoding in the replay files since version 1.45.
I'd really appreciate any pointers, if anyone from Psyonix could chime in please: /u/psyonix_corey /u/Psyonix_Devin or /u/dirkened
In 1.43, you changed the precision of position vectors to mitigate the compression caused loss of precision between theserver/client.
In v1.45, you added 2 new bit (as in an eighth of a byte) to the RigidBodyState (RBS for short) object: 1 just before and one just after the rotation vector.
And now, in my replay player, rotations are all messed up.
Here's how it used to work before:
And here's how it works now with 1.45+ replay files:
Here's how I'm doing it:
A RBS is encoded as follows:
sleeping = read_1_bit()
// decode position
read_position()
// decode rotation
if version >= 1.45:
read_1_bit() // <-- This the first new bit
decode_rotation()
if version >= 1.45:
read_1_bit() // <-- This is the second new bit
decode_rotation is:
rotation.X = decode_fixed_float()
rotation.Y = decode_fixed_float()
rotation.Z = decode_fixed_float()
decode_fixed_float works is:
num_bits = 16
if version >= 1.45:
num_bits = 18
delta = read_unsigned_int_fixed_bits(num_bits)
// do some math:
bias = 2 ^ (num_bits - 1)
result = ( delta - bias ) / (bias - 1)
I can't figure out what these 2 bits represent.
I think maybe the rotation vector now only encodes in half the space (0 to π instead of 0 to 2π), and if one of those bits is set the rotation needs to be negated, but I didn't get anywhere with that.
Please please please, pretty please ?
https://i.redd.it/jw1lnulmtbd11.gif
I'd really like to open up https://ballchasing.com to the general public (after 3 or 4 months of closed beta), which I talked about in here: https://www.reddit.com/r/RocketLeague/comments/8g1esv/the_3d_replay_viewer_tool_is_still_alive_now_with/
and this is the last blocker.
External link →