Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Time difference between sending and receiving a tick

Discussion in 'Netcode for GameObjects' started by dzidex121, Oct 5, 2022.

  1. dzidex121


    Sep 14, 2022
    Hello, I wrote my own interpolation for player movement, but...

    The client sends the input and the server on the tick refreshes the position and sends it to the clients. The client receives the position and time and stores them in the buffer. An approximate position is calculated for a given frame based on the time it occurs between two frames in the buffer. It is not a perfect algorithm yet, but everything works smoothly until there is a shortage of new items in the buffer and these should be on average every 0.033 s at 30 tickrate server (because the time allocated to the position on the server is always exactly every 0.033 second).

    • The first thing is that depending on how the server is running (it is about how many fps it has or is as a dedicated server build), it will vary time the new tick reaches the client. For a server on the console, the average delivery time is shorter than for a server application running in full screen. I wonder why this is so, since in both situations the time assigned to the position does not differ. Ie the tick is always served and sent from the server at the same time. Why is it like that?

    • The second thing is that some time, let's say, within 10 seconds, 300 ticks are sent and the client receives half as much. So the buffer will release the position twice as fast as the new one arrives and will be empty during that time. I am aware that the packets are arriving at different times with certain delays, but the number of packets sent by the server should not be so different from the number of packets received by the client in certain period?
    Of course, I may be misunderstanding something.
    Thanks for any help.