Page 1 of 1
UDP Lag
Posted: Mon Apr 07, 2014 11:21 pm
by Prynok
Hi, recently I've exported one of my little multiplayer games and sent them to my friends. However, there is a huge delay when someone tries to move when there is more than three people, and when they receive the movement. Is there any reason why this would happen? The only thing I added from the tutorial is direction and collision, whereas the collision all happens on the client side.
Thanks, Prynok
Re: UDP Lag
Posted: Tue Apr 08, 2014 4:06 am
by Positive07
Sometimes that happens cause you are requesting just one packet of data every update. If your computer hang three updates, then you will be three packets late than the rest. If also there is some lag in the connection you may read a packet many updates later causing even more delay. This error propagates and add it self and can get to seconds.
The problem could be solved by waiting until all packets arrive and waiting until unleast one packet arrives... But that will generate lag in your graphics. I don't know a really good answer. Maybe using a separate thread for the connection might work
Re: UDP Lag
Posted: Tue Apr 08, 2014 11:12 pm
by WetDesertRock
Try polling the network at a rate of 30Hz, thats what I was told. This might help.