Answer the question
In order to leave comments, you need to log in
How to calculate time for network smoothing?
I'm making an online game. I came up with linear interpolation to smooth the movements of the players. Tell me how to calculate the time by which to get the coordinate to achieve maximum smoothness?
x - coordinate, t1 - first packet, t2 - second packet, tReal - currently in game.
At the moment I'm getting the coordinate according to this calculation of time t = tReal - (t2 - t1) but it's not very smooth.
Answer the question
In order to leave comments, you need to log in
Собери один пакет со всеми изменениями на отправку от пользователя серверу, такой же от сервера клиенту и отправляй постоянно по возможности, добавь немного экстраполяции, а плавности добивайся в отображении движений.
Наверно раз движение равномерное, то нужно продолжить линию до пересечения с вертикалью tReal. Остаётся найти координаты в точке пересечения линий.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question