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! If you're using the Gameplay Ability System (GAS) in Unreal Engine, you can improve the network synchronization of root motion by adjusting the network settings of the ability that's causing the movement. Here's how you can do it:
-
Make the Ability Always Relevant: In the ability's class defaults, set the "Ability Spec Relevancy" to "Always Relevant". This ensures that the server always sends updates about the ability's state to the client.
-
Adjust the Ability's Network Update Frequency: In the ability's class defaults, you can adjust the "Min Net Update Frequency" and "Net Update Frequency" to control how often updates are sent. Increasing these values will make the updates more frequent, which can help to reduce desyncs. However, it will also increase the amount of network traffic, so you'll need to find a balance that works for your game.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.