How to sync the ball of battle game

0 votes
Hello ShepHertz,

I have some problem on 1vs1 real-time game .

The game is like tennis,players need to hit the ball to the other side.

My question is that when I transfer data to the server on a moment someone hit a ball successfully,

 the ball will go through on the other mobile because of network latency,

is  there any wat to solve this problem?

thanks
asked Mar 22, 2015 in AppWarp by heloha44 (20 points)

2 Answers

0 votes
 
Best answer
Hi,

You can use basic maths to hide the latecny. There are techniques like Dead Reckoning that you can use. For example, while sending an update you can send UTC timestamp and velocity along with the position of ball. On the other side, you can then calculate the time difference and use the velocity to find the real position.

Thanks
answered Mar 22, 2015 by Suyash Mohan (900 points)
selected Mar 24, 2015 by heloha44
0 votes
sounds good,but is it make ball teleport suddenly?

if so , player may have no time to react.

can that way make ball smooth?
answered Mar 22, 2015 by heloha44 (20 points)
You can move the ball a bit faster to hide the teleport like effect.
I see!! thank you very much
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...