I am trying to replicate the character movement in a multiplayer game. I set the SetIsReplicatedByDefault as true in the structure, I updated the replicated data in the tick component, and I got a warning of
Does anyone know how to fix this warning? The gameplay is working fine. I had tried not to replicate the ROLE_SimulatedProxy, it ignored the warning, but the data would not update on the simulated clients.
Second, from here you can learn that on the client, your actors have be owned by player controller to be able to send client->server RPCs. Probably the problem is in the way you spawning your character - without the proper owner; Can also be a plenty of other reasons
And the third: you should be aware that UCharacterMovementComponent that comes with ACharacter already supports network movement replication out-of-the-box. Though implementing your own as an exercise is also an option. You can even check CMC’s code for details of its implementation
Also, don’t make on-tick RPCs reliable, it will breaks quite fast with such amount of requests. For movement you really should use unreliables. There are some well-known methods to make it work relatively reliable by the way.
Hi, thank you for reply my question; I spent time learning the document and figuring out how to fix the issue.
For the last point you mentioned of on-tick RPCs reliable, I have been searching for some methods to replicate, such as “LeanAngle” to additive in locomotion, the value is often updated in the game, but there are not many solution posts on forums. Could you share any well-known methods to replicate this kind of value?
Well, i’m indeed forgot that though they are “well-known”, they aren’t easily searchable. The two links i had in mind is:
Deterministic Lockstep | Gaffer On Games The exact topic is at the end of the article, Is TCP good enough?. Nevertheless, the whole site is a treasure about game networking basics and details
Additionally, this series of video tutorials expands on the previously linked tutorials, explaining how to extend CMC to correctly implement networked mechanics and how it functions in general.
This should provide you with a very strong foundation when working with CMC.