- Home /
Help! How to implement accurate attack in client-server RPG?
I am planning to develop client-server RPG, but I get stuck in accurate attack. Think about under situation:
Player1 at position A in server.
After 100ms, Player2 see Player1 at position A, but Player1 moved to position B in server side.
Player2 attacks Palyer1 at position A.
After 100ms again. Server receives attack packet, But Player2 moved to position C, if Player2 attacks Player1 at current position C, the hit will always miss.
I need estimate attack time:
Command Execution Time = Current Server Time - Packet Latency - Client View Interpolation
This formula from: https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking#Lag_compensation
But how can I get Packet Latency and Client View Interpolation?
I read the unity network demo of TPS-Auth. I think Client View Interpolation should be equal to fixed time + Client Latency.( GraduallyUpdateState.cs m_InterpolationBackTime property)
Your answer
Follow this Question
Related Questions
How Do I Make A Dash&Attack Move For My Top-DownRPG 2D? 0 Answers
I need help fixing this code 1 Answer
[Closed]Not destroying floor? 1 Answer
Attack on mouse click 0 Answers
Attack Script problem please help 1 Answer