Buffer & stream movement, instead of sending a packet per origin

Post Reply
User avatar
Posts: 867
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Buffer & stream movement, instead of sending a packet per origin

by MirceaKitsune » Post

Minetest relies exclusively on UDP packets to network anything. In case of player / entity movement, packets are sent every 0.# seconds and interpreted as soon as received. What I heard Minecraft and other engines do is using a data stream instead. A lot like how media is streamed online, allowing more info to be sent per update, losslessly and without gaps (unless there's too much lag and buffering fails to keep up).

I can see how such results in softer and more accurate movement. Even if position packages were sent at 0.01 seconds and there was little lag between client and server, there's anyways a chance of packets getting dropped or arriving sooner / later than others (visible if packets are put directly into effect like we're doing). Sending buffered movement intervals and letting the client put them aside and reconstruct the path is a lot better and more consistent. It could also allow for a better interpolation system, and the client wouldn't work so hard to hide package delays under the carpet (which can never be done perfectly).

The question is how much bandwidth this would cost compared to the current way. If done properly, it shouldn't be more expensive and maybe quite the opposite. One improvement is reducing the quality of the stream the further an entity is, since if a player is far in the distance we care less about smooth movement. Also if a player isn't in our field of view or is behind a wall, quality can be further dropped. Then of course we send no data if a player or entity is standing in place, so stationary objects wouldn't cost anything.

Is this possible to do for Minetest? How much would a stream improve compared to blunt packages? Anyone willing to code it?
Last edited by MirceaKitsune on Sun Jul 14, 2013 14:20, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests