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
UDP Lag
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Positive07
- Party member
- Posts: 1015
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: UDP Lag
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
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
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
-
- Citizen
- Posts: 67
- Joined: Fri Mar 07, 2014 8:16 pm
Re: UDP Lag
Try polling the network at a rate of 30Hz, thats what I was told. This might help.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests