I recently discovered some problems when sending objects over the network with kryonet. I havent much experience with low level networking and all the stuff that’s going on there and don’t want to bother with it until its really necessary. So the case is i’m sending some position data with udp over the network to other clients connected. But when connecting with my laptop to other computers from time to time a huge number of packets seem to arrive with 0ms latency to the clients and they contain some weird values of position data which causes entinities to interpolate to some random positions. So my question is what can be the reason for this? Has it something to do with packet order , buffer or whatever and is there a way it can be fixed ?
UDP by definition is an unstable networking protocol, it’s meant to be fast, but not verified. You’re probably just getting left over packets that never arrived initially. I’d package a counter with each packet (a packet ID), and if a packet comes that is below your current last packet ID, just ignore it.
At least, that’s what I’d first think of.
Yeah i think that makes sense i will try it out thanks .