[KRYONET] Movement updates

hi there.

I’m making my multiplayer game but movement updates are very laggy… it stutters. So I tried interpolation:


mob.setX(mob.getX()+(update.x-mob.getX())/10);
mob.setY(mob.getY()+(update.y-mob.getY())/10);

But using interpolition the position isn’t really accurate anymore. Anyone that can help me?

Greetings

What part of not accurate do you want to fix? For example, is it that one player is shooting at a target that isn’t really where it appears on the screen?

There are two philosophical ways to handle that: one way is to make bullets (or whatever) very forgiving so that you hit if you in the general area so that inaccuracy doesn’t matter much.

The other way to handle it is to say that a hit is when you hit what you see on your screen and it doesn’t matter if the player is actually somewhere else.

I may not even be answering your question. If not, be more specific.