<s>
In	O
computers	O
,	O
lag	B-Application
is	O
delay	O
(	O
latency	O
)	O
between	O
the	O
action	O
of	O
the	O
user	O
(	O
input	O
)	O
and	O
the	O
reaction	O
of	O
the	O
server	B-Application
supporting	O
the	O
task	B-General_Concept
,	O
which	O
has	O
to	O
be	O
sent	O
back	O
to	O
the	O
client	B-Protocol
.	O
</s>
<s>
The	O
player	O
's	O
ability	O
to	O
tolerate	O
lag	B-Application
depends	O
on	O
the	O
type	O
of	O
game	O
being	O
played	O
.	O
</s>
<s>
For	O
instance	O
,	O
a	O
strategy	B-Application
game	I-Application
or	O
a	O
turn-based	O
game	O
with	O
a	O
slow	O
pace	O
may	O
have	O
a	O
high	O
threshold	O
or	O
even	O
be	O
mostly	O
unaffected	O
by	O
high	O
lag	B-Application
.	O
</s>
<s>
A	O
game	O
with	O
twitch	O
gameplay	O
such	O
as	O
a	O
first-person	O
shooter	O
with	O
a	O
considerably	O
faster	O
pace	O
may	O
require	O
a	O
significantly	O
lower	O
lag	B-Application
to	O
provide	O
satisfying	O
gameplay	O
.	O
</s>
<s>
Ping	B-Protocol
time	O
is	O
the	O
network	B-Protocol
delay	I-Protocol
for	O
a	O
round	O
trip	O
between	O
a	O
player	O
's	O
client	B-Protocol
and	O
the	O
game	O
server	B-Application
as	O
measured	O
with	O
the	O
ping	B-Protocol
utility	I-Protocol
or	O
equivalent	O
.	O
</s>
<s>
Ping	B-Protocol
time	O
is	O
an	O
average	O
time	O
measured	O
in	O
milliseconds	O
(	O
ms	O
)	O
.	O
</s>
<s>
The	O
lower	O
one	O
's	O
ping	B-Protocol
is	O
,	O
the	O
lower	O
the	O
latency	O
is	O
and	O
the	O
less	O
lag	B-Application
the	O
player	O
will	O
experience	O
.	O
</s>
<s>
High	O
ping	B-Protocol
and	O
low	O
ping	B-Protocol
are	O
commonly	O
used	O
terms	O
in	O
online	O
gaming	O
,	O
where	O
high	O
ping	B-Protocol
refers	O
to	O
a	O
ping	B-Protocol
that	O
causes	O
a	O
severe	O
amount	O
of	O
lag	B-Application
;	O
while	O
any	O
level	O
of	O
ping	B-Protocol
may	O
cause	O
lag	B-Application
,	O
severe	O
lag	B-Application
is	O
usually	O
indicated	O
by	O
a	O
ping	B-Protocol
of	O
over	O
100ms	O
.	O
</s>
<s>
In	O
games	O
where	O
timing	O
is	O
key	O
,	O
such	O
as	O
first-person	O
shooter	O
and	O
real-time	O
strategy	B-Application
games	I-Application
,	O
a	O
low	O
ping	B-Protocol
is	O
always	O
desirable	O
,	O
as	O
a	O
low	O
ping	B-Protocol
means	O
smoother	O
gameplay	O
by	O
allowing	O
faster	O
updates	O
of	O
game	O
data	O
between	O
the	O
players	O
 '	O
clients	O
and	O
game	O
server	B-Application
.	O
</s>
<s>
High	O
latency	O
can	O
cause	O
lag	B-Application
.	O
</s>
<s>
Game	O
servers	O
may	O
disconnect	O
a	O
client	B-Protocol
if	O
the	O
latency	O
is	O
too	O
high	O
and	O
may	O
pose	O
a	O
detriment	O
to	O
other	O
players	O
 '	O
gameplay	O
.	O
</s>
<s>
Similarly	O
,	O
client	B-Protocol
software	I-Protocol
will	O
often	O
mandate	O
disconnection	O
if	O
the	O
latency	O
is	O
too	O
high	O
.	O
</s>
<s>
High	O
ping	B-Protocol
may	O
also	O
cause	O
servers	O
to	O
crash	O
due	O
to	O
instability	O
.	O
</s>
<s>
In	O
some	O
first-person	O
shooter	O
games	O
,	O
a	O
high	O
ping	B-Protocol
may	O
cause	O
the	O
player	O
to	O
unintentionally	O
gain	O
unfair	O
advantages	O
,	O
such	O
as	O
disappearing	O
from	O
one	O
location	O
and	O
instantaneously	O
reappearing	O
in	O
another	O
,	O
simulating	O
the	O
effect	O
of	O
teleportation	O
,	O
thus	O
making	O
it	O
hard	O
for	O
other	O
players	O
to	O
judge	O
their	O
character	O
's	O
position	O
and	O
subsequently	O
making	O
the	O
player	O
much	O
more	O
difficult	O
to	O
target	O
.	O
</s>
<s>
To	O
counter	O
this	O
,	O
many	O
game	O
servers	O
automatically	O
kick	O
players	O
with	O
a	O
ping	B-Protocol
higher	O
than	O
average	O
.	O
</s>
<s>
Conversely	O
,	O
a	O
high	O
ping	B-Protocol
can	O
make	O
it	O
very	O
difficult	O
for	O
the	O
player	O
to	O
play	O
the	O
game	O
due	O
to	O
negative	O
effects	O
occurring	O
,	O
making	O
it	O
difficult	O
for	O
the	O
player	O
to	O
track	O
other	O
players	O
and	O
even	O
move	O
their	O
character	O
.	O
</s>
<s>
Rather	O
than	O
using	O
the	O
traditional	O
ICMP	B-Protocol
echo	I-Protocol
request	I-Protocol
and	O
reply	O
network	B-Protocol
packets	I-Protocol
to	O
determine	O
ping	B-Protocol
times	O
,	O
video	O
game	O
programmers	O
often	O
build	O
their	O
own	O
latency	O
detection	O
into	O
existing	O
game	O
packets	B-Protocol
(	O
usually	O
based	O
on	O
the	O
UDP	B-Protocol
protocol	I-Protocol
)	O
instead	O
.	O
</s>
<s>
Some	O
factors	O
that	O
might	O
affect	O
ping	B-Protocol
include	O
:	O
communication	O
protocol	O
used	O
,	O
Internet	O
throughput	O
(	O
connection	O
speed	O
)	O
,	O
the	O
quality	O
of	O
a	O
user	O
's	O
Internet	O
service	O
provider	O
and	O
the	O
configuration	O
of	O
firewalls	B-Application
.	O
</s>
<s>
Ping	B-Protocol
is	O
also	O
affected	O
by	O
geographical	O
location	O
.	O
</s>
<s>
For	O
instance	O
,	O
if	O
someone	O
is	O
in	O
India	O
,	O
playing	O
on	O
a	O
server	B-Application
located	O
in	O
the	O
United	O
States	O
,	O
the	O
distance	O
between	O
the	O
two	O
is	O
greater	O
than	O
it	O
would	O
be	O
for	O
players	O
located	O
within	O
the	O
US	O
,	O
and	O
therefore	O
it	O
takes	O
longer	O
for	O
data	O
to	O
be	O
transmitted	O
.	O
</s>
<s>
However	O
,	O
the	O
amount	O
of	O
packet-switching	O
and	O
network	O
hardware	O
in	O
between	O
the	O
two	O
computers	O
is	O
often	O
more	O
significant	O
.	O
</s>
<s>
For	O
instance	O
,	O
wireless	B-General_Concept
network	I-General_Concept
interface	I-General_Concept
cards	I-General_Concept
must	O
modulate	O
digital	O
signals	O
into	O
radio	O
signals	O
,	O
which	O
is	O
often	O
more	O
costly	O
than	O
the	O
time	O
it	O
takes	O
an	O
electrical	O
signal	O
to	O
traverse	O
a	O
typical	O
span	O
of	O
cable	O
.	O
</s>
<s>
As	O
such	O
,	O
lower	O
ping	B-Protocol
can	O
result	O
in	O
faster	O
Internet	O
download	O
and	O
upload	O
rates	O
.	O
</s>
<s>
While	O
a	O
single-player	O
game	O
maintains	O
the	O
main	O
game	O
state	O
on	O
the	O
local	O
machine	O
,	O
an	O
online	B-Application
game	I-Application
requires	O
it	O
to	O
be	O
maintained	O
on	O
a	O
central	O
server	B-Application
in	O
order	O
to	O
avoid	O
inconsistencies	O
between	O
individual	O
clients	O
.	O
</s>
<s>
As	O
such	O
,	O
the	O
client	B-Protocol
has	O
no	O
direct	O
control	O
over	O
the	O
central	O
game	O
state	O
and	O
may	O
only	O
send	O
change	O
requests	O
to	O
the	O
server	B-Application
,	O
and	O
can	O
only	O
update	O
the	O
local	O
game	O
state	O
by	O
receiving	O
updates	O
from	O
the	O
server	B-Application
.	O
</s>
<s>
This	O
need	O
to	O
communicate	O
causes	O
a	O
delay	O
between	O
the	O
clients	O
and	O
the	O
server	B-Application
,	O
and	O
is	O
the	O
fundamental	O
cause	O
behind	O
lag	B-Application
.	O
</s>
<s>
While	O
there	O
may	O
be	O
numerous	O
underlying	O
reasons	O
for	O
why	O
a	O
player	O
experiences	O
lag	B-Application
,	O
they	O
can	O
be	O
summarized	O
as	O
insufficient	O
hardware	O
in	O
either	O
the	O
client	B-Protocol
or	O
the	O
server	B-Application
,	O
or	O
a	O
poor	O
connection	O
between	O
the	O
client	B-Protocol
and	O
server	B-Application
.	O
</s>
<s>
Hardware	O
related	O
issues	O
cause	O
lag	B-Application
due	O
to	O
the	O
fundamental	O
structure	O
of	O
the	O
game	O
architecture	O
.	O
</s>
<s>
When	O
all	O
processing	O
is	O
finished	O
,	O
the	O
game	O
will	O
update	O
the	O
game	O
state	O
and	O
produce	O
an	O
output	O
,	O
such	O
as	O
a	O
new	O
image	O
on	O
the	O
screen	O
and/or	O
a	O
packet	B-Protocol
to	O
be	O
sent	O
to	O
the	O
server	B-Application
.	O
</s>
<s>
As	O
the	O
central	O
game	O
state	O
is	O
located	O
on	O
the	O
server	B-Application
,	O
the	O
updated	O
information	O
must	O
be	O
sent	O
from	O
the	O
client	B-Protocol
to	O
the	O
server	B-Application
in	O
order	O
to	O
take	O
effect	O
.	O
</s>
<s>
In	O
addition	O
,	O
the	O
client	B-Protocol
must	O
receive	O
the	O
necessary	O
information	O
from	O
the	O
server	B-Application
in	O
order	O
to	O
fully	O
update	O
the	O
state	O
.	O
</s>
<s>
Generating	O
packets	B-Protocol
to	O
send	O
to	O
the	O
server	B-Application
and	O
processing	O
the	O
received	O
packets	B-Protocol
can	O
only	O
be	O
done	O
as	O
often	O
as	O
the	O
client	B-Protocol
is	O
able	O
to	O
update	O
its	O
local	O
state	O
.	O
</s>
<s>
Although	O
packets	B-Protocol
could	O
theoretically	O
be	O
generated	O
and	O
sent	O
faster	O
than	O
this	O
,	O
it	O
would	O
only	O
result	O
in	O
sending	O
redundant	O
data	O
if	O
the	O
game	O
state	O
cannot	O
be	O
updated	O
between	O
each	O
packet	B-Protocol
.	O
</s>
<s>
Conversely	O
,	O
the	O
same	O
holds	O
true	O
for	O
the	O
server	B-Application
.	O
</s>
<s>
The	O
frame	O
rate	O
(	O
or	O
tick	O
rate	O
)	O
of	O
the	O
server	B-Application
determines	O
how	O
often	O
it	O
can	O
process	O
data	O
from	O
clients	O
and	O
send	O
updates	O
.	O
</s>
<s>
Perhaps	O
the	O
most	O
common	O
type	O
of	O
lag	B-Application
is	O
caused	O
by	O
network	O
performance	O
problems	O
.	O
</s>
<s>
Losses	B-Protocol
,	O
corruption	O
or	O
jitter	B-Architecture
(	O
an	O
outdated	O
packet	B-Protocol
is	O
in	O
effect	O
a	O
loss	O
)	O
may	O
all	O
cause	O
problems	O
,	O
but	O
these	O
problems	O
are	O
relatively	O
rare	O
in	O
a	O
network	O
with	O
sufficient	O
bandwidth	O
and	O
no	O
or	O
little	O
congestion	B-Protocol
.	O
</s>
<s>
Instead	O
,	O
the	O
latency	O
involved	O
in	O
transmitting	O
data	O
between	O
clients	O
and	O
server	B-Application
plays	O
a	O
significant	O
role	O
.	O
</s>
<s>
Latency	O
varies	O
depending	O
on	O
a	O
number	O
of	O
factors	O
,	O
such	O
as	O
the	O
physical	O
distance	O
between	O
the	O
end-systems	O
,	O
as	O
a	O
longer	O
distance	O
means	O
additional	O
transmission	O
length	O
and	O
routing	B-Protocol
required	O
and	O
therefore	O
higher	O
latency	O
.	O
</s>
<s>
Routing	B-Protocol
over	O
the	O
Internet	O
may	O
be	O
extremely	O
indirect	O
,	O
resulting	O
in	O
far	O
more	O
transmission	O
length	O
(	O
and	O
consequent	O
latency	O
)	O
than	O
a	O
direct	O
route	O
,	O
although	O
the	O
cloud	B-Application
gaming	I-Application
service	I-Application
OnLive	B-Application
has	O
developed	O
a	O
solution	O
to	O
this	O
issue	O
by	O
establishing	O
peering	B-Protocol
relationships	O
with	O
multiple	O
Tier	B-Architecture
1	I-Architecture
network	I-Architecture
Internet	O
Service	O
Providers	O
and	O
choosing	O
an	O
optimal	O
route	O
between	O
server	B-Application
and	O
user	O
.	O
</s>
<s>
In	O
addition	O
,	O
insufficient	O
bandwidth	O
and	O
congestion	B-Protocol
,	O
even	O
if	O
not	O
severe	O
enough	O
to	O
cause	O
losses	B-Protocol
,	O
may	O
cause	O
additional	O
delays	O
regardless	O
of	O
distance	O
.	O
</s>
<s>
As	O
with	O
the	O
hardware	O
issues	O
,	O
packets	B-Protocol
that	O
arrive	O
slowly	O
or	O
not	O
at	O
all	O
will	O
make	O
both	O
the	O
client	B-Protocol
and	O
server	B-Application
unable	O
to	O
update	O
the	O
game	O
state	O
in	O
a	O
timely	O
manner	O
.	O
</s>
<s>
Online	B-Application
game	I-Application
systems	O
utilizing	O
a	O
wireless	B-General_Concept
network	I-General_Concept
may	O
be	O
subject	O
to	O
significant	O
lag	B-Application
,	O
depending	O
on	O
the	O
architecture	O
of	O
the	O
wireless	B-General_Concept
network	I-General_Concept
and	O
local	O
electromagnetic	O
interference	O
impacting	O
that	O
network	O
.	O
</s>
<s>
from	O
a	O
microwave	O
oven	O
)	O
can	O
cause	O
transmitted	O
packets	B-Protocol
to	O
be	O
lost	O
,	O
requiring	O
a	O
retransmission	O
which	O
incurs	O
latency	O
.	O
</s>
<s>
Although	O
radio	O
propagation	O
through	O
the	O
air	O
is	O
faster	O
than	O
light	O
through	O
an	O
optical	B-Architecture
fiber	I-Architecture
,	O
wireless	O
systems	O
are	O
often	O
shared	O
among	O
many	O
users	O
and	O
may	O
suffer	O
from	O
latency	O
incurred	O
due	O
to	O
network	B-Protocol
congestion	I-Protocol
,	O
or	O
due	O
to	O
network	O
protocols	O
that	O
introduce	O
latency	O
.	O
</s>
<s>
The	O
noticeable	O
effects	O
of	O
lag	B-Application
vary	O
not	O
only	O
depending	O
on	O
the	O
exact	O
cause	O
,	O
but	O
also	O
on	O
all	O
techniques	O
for	O
lag	B-Application
compensation	O
that	O
the	O
game	O
may	O
implement	O
(	O
described	O
below	O
)	O
.	O
</s>
<s>
Lag	B-Application
causes	O
numerous	O
problems	O
for	O
issues	O
such	O
as	O
accurate	O
rendering	O
of	O
the	O
game	O
state	O
and	O
hit	O
detection	O
.	O
</s>
<s>
In	O
many	O
games	O
,	O
lag	B-Application
is	O
often	O
frowned	O
upon	O
because	O
it	O
disrupts	O
normal	O
gameplay	O
.	O
</s>
<s>
The	O
severity	O
of	O
lag	B-Application
depends	O
on	O
the	O
type	O
of	O
game	O
and	O
its	O
inherent	O
tolerance	O
for	O
lag	B-Application
.	O
</s>
<s>
Due	O
to	O
the	O
various	O
problems	O
lag	B-Application
can	O
cause	O
,	O
players	O
that	O
have	O
an	O
insufficiently	O
fast	O
Internet	O
connection	O
are	O
sometimes	O
not	O
permitted	O
,	O
or	O
discouraged	O
from	O
playing	O
with	O
other	O
players	O
or	O
servers	O
that	O
have	O
a	O
distant	O
server	B-Application
host	O
or	O
have	O
high	O
latency	O
to	O
one	O
another	O
.	O
</s>
<s>
Extreme	O
cases	O
of	O
lag	B-Application
may	O
result	O
in	O
extensive	O
desynchronization	O
of	O
the	O
game	O
state	O
.	O
</s>
<s>
Lag	B-Application
due	O
to	O
an	O
insufficient	O
update	O
rate	O
between	O
client	B-Protocol
and	O
server	B-Application
can	O
cause	O
some	O
problems	O
,	O
but	O
these	O
are	O
generally	O
limited	O
to	O
the	O
client	B-Protocol
itself	O
.	O
</s>
<s>
Other	O
players	O
may	O
notice	O
jerky	O
movement	O
and	O
similar	O
problems	O
with	O
the	O
player	O
associated	O
with	O
the	O
affected	O
client	B-Protocol
,	O
but	O
the	O
real	O
problem	O
lies	O
with	O
the	O
client	B-Protocol
itself	O
.	O
</s>
<s>
If	O
the	O
client	B-Protocol
cannot	O
update	O
the	O
game	O
state	O
at	O
a	O
quick	O
enough	O
pace	O
,	O
the	O
player	O
may	O
be	O
shown	O
outdated	O
renditions	O
of	O
the	O
game	O
,	O
which	O
in	O
turn	O
cause	O
various	O
problems	O
with	O
hit	O
-	O
and	O
collision	O
detection	O
.	O
</s>
<s>
If	O
the	O
low	O
update	O
rate	O
is	O
caused	O
by	O
a	O
low	O
frame	O
rate	O
(	O
as	O
opposed	O
to	O
a	O
setting	O
on	O
the	O
client	B-Protocol
,	O
as	O
some	O
games	O
allow	O
)	O
,	O
these	O
problems	O
are	O
usually	O
overshadowed	O
by	O
numerous	O
problems	O
related	O
to	O
the	O
client-side	B-Operating_System
processing	O
itself	O
.	O
</s>
<s>
While	O
this	O
may	O
increase	O
the	O
perceived	O
lag	B-Application
,	O
it	O
is	O
important	O
to	O
note	O
that	O
it	O
is	O
of	O
a	O
different	O
kind	O
than	O
network-related	O
delays	O
.	O
</s>
<s>
In	O
comparison	O
,	O
the	O
same	O
problem	O
on	O
the	O
server	B-Application
may	O
cause	O
significant	O
problems	O
for	O
all	O
clients	O
involved	O
.	O
</s>
<s>
If	O
the	O
server	B-Application
is	O
unable	O
or	O
unwilling	O
to	O
accept	O
packets	B-Protocol
from	O
clients	O
fast	O
enough	O
and	O
process	O
these	O
in	O
a	O
timely	O
manner	O
,	O
client	B-Protocol
actions	O
may	O
never	O
be	O
registered	O
.	O
</s>
<s>
When	O
the	O
server	B-Application
then	O
sends	O
out	O
updates	O
to	O
the	O
clients	O
,	O
they	O
may	O
experience	O
freezing	O
(	O
unresponsive	O
game	O
)	O
and/or	O
rollbacks	B-Application
,	O
depending	O
on	O
what	O
types	O
of	O
lag	B-Application
compensation	O
,	O
if	O
any	O
,	O
the	O
game	O
uses	O
.	O
</s>
<s>
Lag	B-Application
due	O
to	O
network	B-Protocol
delay	I-Protocol
is	O
,	O
in	O
contrast	O
,	O
often	O
less	O
of	O
a	O
problem	O
.	O
</s>
<s>
Without	O
any	O
form	O
of	O
lag	B-Application
compensation	O
,	O
the	O
clients	O
will	O
notice	O
that	O
the	O
game	O
responds	O
only	O
a	O
short	O
time	O
after	O
an	O
action	O
is	O
performed	O
.	O
</s>
<s>
Instead	O
,	O
games	O
will	O
often	O
be	O
designed	O
with	O
lag	B-Application
compensation	O
in	O
mind	O
.	O
</s>
<s>
Many	O
problems	O
can	O
be	O
solved	O
simply	O
by	O
allowing	O
the	O
clients	O
to	O
keep	O
track	O
of	O
their	O
own	O
state	O
and	O
send	O
absolute	O
states	O
to	O
the	O
server	B-Application
or	O
directly	O
to	O
other	O
clients	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
client	B-Protocol
can	O
state	O
exactly	O
at	O
what	O
position	O
a	O
player	O
's	O
character	O
is	O
or	O
who	O
the	O
character	O
shot	O
.	O
</s>
<s>
This	O
solution	O
works	O
and	O
will	O
all	O
but	O
eliminate	O
most	O
problems	O
related	O
to	O
lag	B-Application
.	O
</s>
<s>
Unfortunately	O
,	O
it	O
also	O
relies	O
on	O
the	O
assumption	O
that	O
the	O
client	B-Protocol
is	O
honest	O
.	O
</s>
<s>
There	O
is	O
nothing	O
that	O
prevents	O
a	O
player	O
from	O
modifying	O
the	O
data	O
they	O
send	O
,	O
directly	O
at	O
the	O
client	B-Protocol
or	O
indirectly	O
via	O
a	O
proxy	O
,	O
in	O
order	O
to	O
ensure	O
they	O
will	O
always	O
hit	O
their	O
targets	O
.	O
</s>
<s>
In	O
online	B-Application
games	I-Application
,	O
the	O
risk	O
of	O
cheating	O
may	O
make	O
this	O
solution	O
unfeasible	O
,	O
and	O
clients	O
will	O
be	O
limited	O
to	O
sending	O
relative	O
states	O
(	O
i.e.	O
</s>
<s>
As	O
clients	O
are	O
normally	O
not	O
allowed	O
to	O
define	O
the	O
main	O
game	O
state	O
,	O
but	O
rather	O
receive	O
it	O
from	O
the	O
server	B-Application
,	O
the	O
main	O
task	B-General_Concept
of	O
the	O
client-side	B-Operating_System
compensation	O
is	O
to	O
render	O
the	O
virtual	O
world	O
as	O
accurately	O
as	O
possible	O
.	O
</s>
<s>
As	O
updates	O
come	O
with	O
a	O
delay	O
and	O
may	O
even	O
be	O
dropped	O
,	O
it	O
is	O
sometimes	O
necessary	O
for	O
the	O
client	B-Protocol
to	O
predict	O
the	O
flow	O
of	O
the	O
game	O
.	O
</s>
<s>
Since	O
the	O
state	O
is	O
updated	O
in	O
discrete	O
steps	O
,	O
the	O
client	B-Protocol
must	O
be	O
able	O
to	O
estimate	O
a	O
movement	O
based	O
on	O
available	O
samples	O
.	O
</s>
<s>
Two	O
basic	O
methods	O
can	O
be	O
used	O
to	O
accomplish	O
this	O
;	O
extrapolation	O
and	O
interpolation	B-Algorithm
.	O
</s>
<s>
As	O
soon	O
as	O
a	O
packet	B-Protocol
from	O
the	O
server	B-Application
is	O
received	O
,	O
the	O
position	O
of	O
an	O
object	O
is	O
updated	O
to	O
the	O
new	O
position	O
.	O
</s>
<s>
Essentially	O
,	O
the	O
client	B-Protocol
will	O
assume	O
that	O
a	O
moving	O
object	O
will	O
continue	O
in	O
the	O
same	O
direction	O
.	O
</s>
<s>
When	O
a	O
new	O
packet	B-Protocol
is	O
received	O
,	O
the	O
position	O
may	O
be	O
corrected	O
slightly	O
.	O
</s>
<s>
Interpolation	B-Algorithm
works	O
by	O
essentially	O
buffering	O
a	O
game	O
state	O
and	O
rendering	O
the	O
game	O
state	O
to	O
the	O
player	O
with	O
a	O
slight	O
,	O
constant	O
delay	O
.	O
</s>
<s>
When	O
a	O
packet	B-Protocol
from	O
the	O
server	B-Application
arrives	O
,	O
instead	O
of	O
updating	O
the	O
position	O
of	O
an	O
object	O
immediately	O
,	O
the	O
client	B-Protocol
will	O
start	O
to	O
interpolate	O
the	O
position	O
,	O
starting	O
from	O
the	O
last	O
known	O
position	O
.	O
</s>
<s>
Over	O
an	O
interpolation	B-Algorithm
interval	O
,	O
the	O
object	O
will	O
be	O
rendered	O
moving	O
smoothly	O
between	O
the	O
two	O
positions	O
.	O
</s>
<s>
Ideally	O
,	O
this	O
interval	O
should	O
exactly	O
match	O
the	O
delay	O
between	O
packets	B-Protocol
,	O
but	O
due	O
to	O
loss	O
and	O
variable	O
delay	O
,	O
this	O
is	O
rarely	O
the	O
case	O
.	O
</s>
<s>
Interpolation	B-Algorithm
ensures	O
that	O
objects	O
will	O
move	O
between	O
valid	O
positions	O
only	O
and	O
will	O
produce	O
good	O
results	O
with	O
constant	O
delay	O
and	O
no	O
loss	O
.	O
</s>
<s>
Should	O
dropped	O
or	O
out-of-order	O
packets	B-Protocol
overflow	O
the	O
interpolation	B-Algorithm
buffer	O
the	O
client	B-Protocol
will	O
have	O
to	O
either	O
freeze	O
the	O
object	O
in	O
position	O
until	O
a	O
new	O
packet	B-Protocol
arrives	O
,	O
or	O
fall	O
back	O
on	O
extrapolation	O
instead	O
.	O
</s>
<s>
The	O
downside	O
of	O
interpolation	B-Algorithm
is	O
that	O
it	O
causes	O
the	O
world	O
to	O
be	O
rendered	O
with	O
additional	O
latency	O
,	O
increasing	O
the	O
need	O
for	O
some	O
form	O
of	O
lag	B-Application
compensation	O
to	O
be	O
implemented	O
.	O
</s>
<s>
Often	O
,	O
in	O
order	O
to	O
allow	O
smooth	O
gameplay	O
,	O
the	O
client	B-Protocol
is	O
allowed	O
to	O
do	O
soft	O
changes	O
to	O
the	O
game	O
state	O
.	O
</s>
<s>
While	O
the	O
server	B-Application
may	O
ultimately	O
keep	O
track	O
of	O
ammunition	O
,	O
health	O
,	O
position	O
,	O
etc.	O
,	O
the	O
client	B-Protocol
may	O
be	O
allowed	O
to	O
predict	O
the	O
new	O
server-side	O
game	O
state	O
based	O
on	O
the	O
player	O
's	O
actions	O
,	O
such	O
as	O
allowing	O
a	O
player	O
to	O
start	O
moving	O
before	O
the	O
server	B-Application
has	O
responded	O
to	O
the	O
command	O
.	O
</s>
<s>
Problems	O
will	O
arise	O
only	O
in	O
the	O
case	O
of	O
high	O
delays	O
or	O
losses	B-Protocol
,	O
when	O
the	O
client	B-Protocol
's	O
predictions	O
are	O
very	O
noticeably	O
undone	O
by	O
the	O
server	B-Application
.	O
</s>
<s>
Sometimes	O
,	O
in	O
the	O
case	O
of	O
minor	O
differences	O
,	O
the	O
server	B-Application
may	O
even	O
allow	O
"	O
incorrect	O
"	O
changes	O
to	O
the	O
state	O
based	O
on	O
updates	O
from	O
the	O
client	B-Protocol
.	O
</s>
<s>
Unlike	O
clients	O
,	O
the	O
server	B-Application
knows	O
the	O
exact	O
current	O
game	O
state	O
,	O
and	O
as	O
such	O
prediction	O
is	O
unnecessary	O
.	O
</s>
<s>
The	O
main	O
purpose	O
of	O
server-side	O
lag	B-Application
compensation	O
is	O
instead	O
to	O
provide	O
accurate	O
effects	O
of	O
client	B-Protocol
actions	O
.	O
</s>
<s>
The	O
server	B-Application
uses	O
the	O
latency	O
of	O
the	O
player	O
(	O
including	O
any	O
inherent	O
delay	O
due	O
to	O
interpolation	B-Algorithm
;	O
see	O
above	O
)	O
to	O
rewind	O
time	O
by	O
an	O
appropriate	O
amount	O
in	O
order	O
to	O
determine	O
what	O
the	O
shooting	O
client	B-Protocol
saw	O
at	O
the	O
time	O
the	O
shot	O
was	O
fired	O
.	O
</s>
<s>
This	O
will	O
usually	O
result	O
in	O
the	O
server	B-Application
seeing	O
the	O
client	B-Protocol
firing	O
at	O
the	O
target	O
's	O
old	O
position	O
and	O
thus	O
hitting	O
.	O
</s>
<s>
In	O
the	O
worst	O
case	O
,	O
a	O
player	O
will	O
be	O
so	O
far	O
behind	O
that	O
the	O
server	B-Application
runs	O
out	O
of	O
historical	O
data	O
and	O
they	O
have	O
to	O
start	O
leading	O
their	O
targets	O
.	O
</s>
<s>
This	O
is	O
a	O
WYSIWYG	B-Application
solution	O
that	O
allows	O
players	O
to	O
aim	O
directly	O
at	O
what	O
they	O
are	O
seeing	O
.	O
</s>
<s>
In	O
many	O
situations	O
,	O
this	O
is	O
not	O
noticeable	O
,	O
but	O
players	O
who	O
have	O
just	O
taken	O
cover	O
will	O
notice	O
that	O
they	O
carry	O
on	O
receiving	O
damage/death	O
messages	O
from	O
the	O
server	B-Application
for	O
longer	O
than	O
their	O
own	O
latency	O
can	O
justify	O
.	O
</s>
<s>
This	O
can	O
lead	O
more	O
often	O
to	O
the	O
(	O
false	O
)	O
impression	O
that	O
they	O
were	O
shot	O
through	O
cover	O
and	O
the	O
(	O
not	O
entirely	O
inaccurate	O
)	O
impression	O
of	O
"	O
laggy	O
hitboxes	B-Protocol
"	O
.	O
</s>
<s>
One	O
design	O
issue	O
that	O
arises	O
from	O
rewinding	O
is	O
whether	O
to	O
stop	O
rewinding	O
a	O
dead	O
player	O
's	O
lagged	O
commands	O
as	O
soon	O
as	O
they	O
die	O
on	O
the	O
server	B-Application
,	O
or	O
to	O
continue	O
running	O
them	O
until	O
they	O
"	O
catch	O
up	O
"	O
to	O
the	O
time	O
of	O
death	O
.	O
</s>
<s>
Cutting	O
compensation	O
off	O
immediately	O
prevents	O
victims	O
from	O
posthumously	O
attacking	O
their	O
killers	O
,	O
which	O
meets	O
expectations	O
,	O
but	O
preserves	O
the	O
natural	O
advantage	O
of	O
moving	O
players	O
who	O
round	O
a	O
corner	O
,	O
acquire	O
a	O
target	O
and	O
kill	O
them	O
in	O
less	O
time	O
than	O
a	O
round	O
trip	O
to	O
the	O
stationary	O
victim	O
's	O
client	B-Protocol
.	O
</s>
<s>
Servers	O
with	O
lag	B-Application
compensation	O
will	O
sometimes	O
reduce	O
the	O
length	O
of	O
player	O
history	O
stored	O
,	O
or	O
enforce	O
ping	B-Protocol
limits	O
,	O
to	O
reduce	O
this	O
problem	O
.	O
</s>
<s>
It	O
is	O
possible	O
for	O
clients	O
to	O
tell	O
the	O
server	B-Application
what	O
they	O
are	O
doing	O
and	O
for	O
the	O
server	B-Application
to	O
trust	O
the	O
data	O
it	O
receives	O
.	O
</s>
<s>
In	O
Battlefield	O
3	O
,	O
for	O
example	O
,	O
a	O
"	O
hybrid	O
hit	O
detection	O
"	O
system	O
is	O
used	O
where	O
clients	O
tell	O
the	O
server	B-Application
that	O
they	O
hit	O
and	O
the	O
server	B-Application
performs	O
only	O
a	O
vague	O
test	O
of	O
plausibility	O
before	O
accepting	O
the	O
claim	O
.	O
</s>
<s>
Trusting	O
a	O
client	B-Protocol
's	O
results	O
otherwise	O
has	O
the	O
same	O
advantages	O
and	O
disadvantages	O
as	O
rewinding	O
.	O
</s>
<s>
A	O
less	O
common	O
lag	B-Application
solution	O
is	O
to	O
do	O
nothing	O
on	O
the	O
server	B-Application
and	O
to	O
have	O
each	O
client	B-Protocol
extrapolate	O
(	O
see	O
above	O
)	O
to	O
cover	O
its	O
latency	O
.	O
</s>
<s>
It	O
is	O
possible	O
to	O
reduce	O
the	O
perception	O
of	O
lag	B-Application
through	O
game	O
design	O
.	O
</s>
<s>
Techniques	O
include	O
playing	O
client-side	B-Operating_System
animations	O
as	O
if	O
the	O
action	O
took	O
place	O
immediately	O
,	O
reducing/removing	O
built-in	O
timers	O
on	O
the	O
host	O
machine	O
,	O
and	O
using	O
camera	O
transitions	O
to	O
hide	O
warping	O
.	O
</s>
<s>
Cloud	B-Application
gaming	I-Application
is	O
a	O
type	O
of	O
online	O
gaming	O
where	O
the	O
entire	O
game	O
is	O
hosted	O
on	O
a	O
game	O
server	B-Application
in	O
a	O
data	O
center	O
,	O
and	O
the	O
user	O
is	O
only	O
running	O
a	O
thin	B-Device
client	I-Device
locally	O
that	O
forwards	O
game	B-Device
controller	I-Device
actions	O
upstream	O
to	O
the	O
game	O
server	B-Application
.	O
</s>
<s>
The	O
game	O
server	B-Application
then	O
renders	O
the	O
next	O
frame	O
of	O
the	O
game	O
video	O
which	O
is	O
compressed	O
using	O
low-lag	O
video	O
compression	O
and	O
is	O
sent	O
downstream	O
and	O
decompressed	O
by	O
the	O
thin	B-Device
client	I-Device
.	O
</s>
<s>
For	O
the	O
cloud	B-Application
gaming	I-Application
experience	O
to	O
be	O
acceptable	O
,	O
the	O
round-trip	O
lag	B-Application
of	O
all	O
elements	O
of	O
the	O
cloud	B-Application
gaming	I-Application
system	O
(	O
the	O
thin	B-Device
client	I-Device
,	O
the	O
Internet	O
and/or	O
LAN	O
connection	O
the	O
game	O
server	B-Application
,	O
the	O
game	O
execution	O
on	O
the	O
game	O
server	B-Application
,	O
the	O
video	O
and	O
audio	O
compression	O
and	O
decompression	O
,	O
and	O
the	O
display	O
of	O
the	O
video	O
on	O
a	O
display	B-Device
device	I-Device
)	O
must	O
be	O
low	O
enough	O
that	O
the	O
user	O
perception	O
is	O
that	O
the	O
game	O
is	O
running	O
locally	O
.	O
</s>
<s>
Because	O
of	O
such	O
tight	O
lag	B-Application
requirements	O
,	O
distance	O
considerations	O
of	O
the	O
speed	O
of	O
light	O
through	O
optical	B-Architecture
fiber	I-Architecture
come	O
into	O
play	O
,	O
currently	O
limiting	O
the	O
distance	O
between	O
a	O
user	O
and	O
a	O
cloud	B-Application
gaming	I-Application
game	O
server	B-Application
to	O
approximately	O
1000	O
miles	O
,	O
according	O
to	O
OnLive	B-Application
.	O
</s>
<s>
There	O
is	O
also	O
much	O
controversy	O
about	O
the	O
lag	B-Application
associated	O
with	O
cloud	B-Application
gaming	I-Application
.	O
</s>
<s>
In	O
multiplayer	O
games	O
using	O
a	O
client/server	B-Operating_System
network	I-Operating_System
architecture	O
,	O
the	O
player	O
's	O
computer	O
renders	O
the	O
game	O
's	O
graphics	O
locally	O
and	O
only	O
information	O
about	O
the	O
player	O
's	O
in-game	O
actions	O
are	O
sent	O
to	O
the	O
server	B-Application
.	O
</s>
<s>
However	O
,	O
the	O
consequences	O
of	O
the	O
action	O
such	O
as	O
an	O
enemy	O
being	O
killed	O
are	O
only	O
seen	O
after	O
a	O
short	O
delay	O
due	O
to	O
the	O
time	O
taken	O
for	O
the	O
action	O
to	O
reach	O
the	O
server	B-Application
.	O
</s>
<s>
When	O
using	O
cloud	B-Application
gaming	I-Application
,	O
inputs	O
by	O
the	O
player	O
can	O
lead	O
to	O
short	O
delays	O
until	O
a	O
response	O
can	O
be	O
seen	O
by	O
them	O
.	O
</s>
<s>
Inputs	O
must	O
first	O
be	O
transmitted	O
to	O
the	O
remote	O
server	B-Application
,	O
then	O
the	O
server	B-Application
must	O
start	O
rendering	O
the	O
graphics	O
of	O
the	O
action	O
being	O
performed	O
and	O
stream	O
the	O
video	O
back	O
to	O
the	O
player	O
over	O
the	O
network	O
,	O
taking	O
additional	O
time	O
.	O
</s>
<s>
Depending	O
on	O
the	O
skill	O
and	O
experience	O
of	O
the	O
player	O
,	O
this	O
can	O
cause	O
disorientation	O
and	O
confusion	O
similar	O
to	O
Delayed	B-Architecture
Auditory	I-Architecture
Feedback	I-Architecture
and	O
hampers	O
navigation	O
and	O
aiming	O
in	O
the	O
game	O
world	O
.	O
</s>
<s>
The	O
extra	O
input	O
lag	B-Application
can	O
also	O
make	O
it	O
very	O
difficult	O
to	O
play	O
certain	O
single	O
player	O
games	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
an	O
enemy	O
takes	O
a	O
swing	O
at	O
the	O
player	O
and	O
the	O
player	O
is	O
expected	O
to	O
block	O
,	O
then	O
by	O
the	O
time	O
the	O
player	O
's	O
screen	O
shows	O
that	O
the	O
enemy	O
has	O
commenced	O
attacking	O
,	O
the	O
enemy	O
would	O
have	O
already	O
struck	O
and	O
killed	O
the	O
player	O
on	O
the	O
server	B-Application
.	O
</s>
