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
Yes, there are ways to sync and smooth character movement in Unreal Engine even with high latency. Here are a few suggestions:
-
Client-Side Prediction and Server Reconciliation: This is a common technique used in networked games. The client predicts the movement and applies it immediately, while the server does its own calculations and sends corrections back to the client. The client then adjusts its state to match the server's authoritative state.
-
Interpolation and Extrapolation: Interpolation can be used to smooth out the movement between known positions. Extrapolation can be used to predict future positions based on the current velocity and direction. This can help to hide the latency.
-
Root Motion Network Settings: In Unreal Engine, you can adjust the network settings for root motion. For example, you can enable "Always Relevant" to ensure that the server always sends updates about the character's position. You can also adjust the "Min Net Update Frequency" and "Net Update Frequency" to control how often updates are sent.
-
- 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
Sure, I'd be happy to expand on that. The Gameplay Ability System (GAS) in Unreal Engine is a powerful tool for creating complex character abilities and behaviors. Here's how you can adjust the network settings for root motion in the context of GAS:
-
Create a Networked Gameplay Ability: If you haven't already, you'll need to create a Gameplay Ability that you want to network. This could be a movement ability, a jump ability, or any other ability that involves root motion.
-
Set the Ability's Net Execution Policy: In the details panel for your Gameplay Ability, you'll see a section called "Networking". Here, you can set the "Net Execution Policy" to "Server Initiated" or "Predicted with Server Reconciliation". "Server Initiated" means that the server will send commands to the client to trigger the ability, while "Predicted with Server Reconciliation" means that the client will predict the ability and the server will reconcile the results.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.