SS3D icon indicating copy to clipboard operation
SS3D copied to clipboard

Server-authoritative movement with Client-Side Prediction

Open Ryan089 opened this issue 2 years ago • 0 comments

Summary

Currently player movement within SS3D is client-authoritative. This means that the client is trusted to inform the server of their correct position. This will inevitably lead to exploits as well as inconsistent simulation results, as there is no single "correct" game simulation. To remedy this issue, the player movement needs to be server-authoritative.

Goal

  • [ ] Implement server-authoritative movement in order to prevent exploits.

    • [ ] Clients send input data (instead of position data) to the server.
    • [ ] Server performs character movement calculations and notifies clients of character positions.
  • [ ] Implement Client-Side Prediction in order to provide a responsive user experience.

    • [ ] Clients predict their character movement (based on input data) while awaiting response from server.
    • [ ] Client smoothly blends between predicted and informed positions when conflicted.

Resources / References

Fast Paced Multiplayer: Client-Server Game Architecture. This series of articles is a good introduction to the topic, and includes a JavaScript demo to aid understanding.

Fish-Net documentation: Client-Side Prediction. The official Fish-Net guide to solving this problem.

ThirdPersonPrediction sample project. Example Unity project using Fish-Net for Client-Side Prediction.

Ryan089 avatar Jan 16 '23 02:01 Ryan089