Custom UCharacterMovementComponent, Replicating more than just the Compressed Flags

Hey I’m wondering if anyone has knowledge of the UCharacterMovementComponent and can help explain something to me. I am writing a networked game where I have the need for lots of custom movement types (wall running, dodging, etc…) I have been able to implement these by making my own custom UCharacterMovementComponent and FSavedMove classes and replicating movement data from the client using the CompressedFlags. However, the compressed flags only have room for 4 flags (so essentially only 4 bools) to be replicated so I’m quickly running out of flags. So my question is this:

How would I go about properly replicating more data than just these 4 flags in the CompressedFlags? Like for instance, what if I need to replicate a float, vector, etc…? As a test, instead of using the compressed flags I just used a client-to-server rpc to replicate the bools to the sever and it surprising appears to work just fine even though I wasn’t making use the the CompressedFlags or any of the associated functions (like SetMoveFor, PrepMoveFor, UpdateFromCompressedFlags, etc…). So now I’m even more confused as to why the CompressedFlags are even needed. Any help would be great, thanks!

P.S I found this older post that is expressing the same type of problem I’m having. It sounds like he had to write his own ServerMove function and several other associated functions in order to get it to work but I’m not sure if this is the correct/best solution. (Solved) Custom UCharacterMovementComponent, need help with rotations (Advanced Networking) - C++ - Unreal Engine Forums

1 Like

I have the same question! I’m able to replicate the compressed flags to server fine, but I also need to replicate a float value.

I made some documentation explaining how to do this in case anyone is still looking:

1 Like