Context: Unreal C/C++ developer working with Unreal networking character movement. Root…
- User
Context: Unreal C/C++ developer working with Unreal networking character movement.
Root motion causes desyncs at 200 ms latency on both client and server, is there a way to sync and smooth this
- Assistant
- User
Could you expand on how to do option 3 with the gameplay ability system? (What would be the best way to improve that if it already exists or add in.
- Assistant
To implement client-side prediction and server-side reconciliation for root motion in a networked character movement system with a gameplay ability system, you can follow these steps:
-
Client-Side Prediction:
- When the player activates a gameplay ability that affects character movement, predict the character's movement on the client-side based on the last known server state and the player's input.
-
- User
please complete step 4's code (wasn not finished)
- Assistant
- User
was there a step after 4 ?
- Assistant
Yes, there is a step after step 4. Here's the complete list of steps, including the one you're looking for:
- Define Ability Struct
- Create a Networked Ability Component
- Implement Ability Activation and Deactivation
- Implement Ability Cooldown and Duration Updates
- Handle Ability Cooldown and Duration on the Server
- Update the Client with Ability Cooldown and Duration Changes
Here's the implementation for step 6:
- Update the Client with Ability Cooldown and Duration Changes:
On the server, when the ability cooldown or duration changes, send an update to the client. You can use a custom event or a replicated variable to do this. Here's an example using a replicated variable:
In
AMyNetworkAbilityComponent.h:cppUPROPERTY(Replicated) FNetworkAbility NetworkAbility;
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.