math & physics
exec228 at November 3rd, 2008 09:45 — #1
warp is term used to describe rapid unrealistic shift of online game opponent.
it looks like opponent jumps aside say being in airplane for example by 50-5000 meters (in game world distances), that is known to fly straight forward with quite smooth maneuvers.
usually it happens when player or opponent has unstable tcp/ip ping time.
if player has long but constant ping, say 800ms, it does not cause warps.
player (or opponent) must have unstable traffic to game server, say varying from 10ms to 1200ms. with some packet loss probably.
i witnessed warps even in delta force when LAN hub went mad and added a huge lag. opponent appeared 10 meters left, disappeared and appeared 10meters right and so on. actually all he did is doing one step left and one step right.
in online avialimulators sometime microwarps (±20m) can be found when attacked opponent really does not want to be hit by pursuer and he performs a trick named "joystick jerking", causing online client to send to server a twisted coordinates.
generally the picture in online games is that player sends his coordinates on a regular basis, 1, 2, 4, 10 times per second or so. server performs broadcasting to other players occasioned nearby in visible range. so we have a sequense of coordinates marked by server-side receiving time stamp. in some cases in coordinates packet a playstation time can be found.
i will speak from the server programmer point of view.
so, here is the question.
where should i start searching algorythms for smoothing such warps having server code in my hands?
i mean (except discarding outdated tcp/ip packets with coordinates) i'd like to make a smooth trajectory of any player, whether he has good, bad connection or jerks the stick.
i tried 3-degree polynome extrapolation based on last 1 second of traffic.
(in spreadsheet calculations)
but this method adds an artificial lag, so when player evades from attack, others see it after the same 1 second.
thank you beforehand.
monjardin at November 3rd, 2008 15:10 — #2
exec228 at November 4th, 2008 02:18 — #3
thanks for answer.
first article refers to some kind of exponentially smoothed moving average, that brings in an artificial lag. i tried it.
second article is "too system" and "nothing mathematical". this system level is currently unavailable to me.
is there other mathematical ideas for smoothing airplane trajectory?
alphadog at November 4th, 2008 10:31 — #4
I always thought warps were solely due to packet loss. Ping times that vary wildly is usually due to a saturated network, which will result in packet loss. I think...
BTW, here's a good guide for those unclear on the OP's question:
This book has a chapter on latency compensation techniques:
alphadog at November 4th, 2008 10:33 — #5
Latency and scalability: a survey of issues and techniques for supporting networked games
alphadog at November 4th, 2008 10:42 — #6