Replicate Rotator or 2 floats?

Hi all,

I have a rotation that only needs pitch and yaw. I am wondering will it be more efficient to keep 2 separate values as floats and replicate those two or can I rely on the rotator being at least as efficient in terms of network traffic?

I plan to use this system on weapons attached to vehicles so since that affects dozens of actors I would like to squeeze the bit of extra efficiency.

Thanks in advance

Engine already provides some builtin compression for replicating FRotators :

It compresses axis to 16 bits, but also adds an additional bit to gain ability to skip individual axis. At most it would use 51 bits for 3 active axis, but in your case since roll is always zero it’ll use only 35 bits.

If you are using blueprints, floats and integers will be 32 bits each so definitely not worth it. With C++ you could squeeze a bit more since you can skip the roll altogether, and depending on use case you could even compress axis to 8 bits. Epic does it for Pawn->RemoteViewPitch.

2 Likes

Thank you! :slight_smile: