<s>
Netcode	B-Application
is	O
a	O
blanket	O
term	O
most	O
commonly	O
used	O
by	O
gamers	O
relating	O
to	O
networking	O
in	O
online	B-Application
games	I-Application
,	O
often	O
referring	O
to	O
synchronization	O
issues	O
between	O
clients	O
and	O
servers	O
.	O
</s>
<s>
Players	O
often	O
infer	O
"	O
bad	O
netcodes	B-Application
"	O
when	O
they	O
experience	O
lag	B-Application
or	O
when	O
their	O
inputs	O
are	O
dropped	O
.	O
</s>
<s>
Common	O
causes	O
of	O
such	O
issues	O
include	O
high	O
latency	O
between	O
server	O
and	O
client	O
,	O
packet	B-Protocol
loss	I-Protocol
,	O
network	B-Protocol
congestion	I-Protocol
,	O
and	O
external	O
factors	O
independent	O
to	O
network	O
quality	O
such	O
as	O
frame	O
rendering	O
time	O
or	O
inconsistent	O
frame	O
rates	O
.	O
</s>
<s>
Netcodes	B-Application
may	O
be	O
designed	O
to	O
uphold	O
a	O
synchronous	O
and	O
seamless	O
experience	O
between	O
users	O
despite	O
these	O
networking	O
challenges	O
.	O
</s>
<s>
Unlike	O
a	O
local	O
game	O
where	O
the	O
inputs	O
of	O
all	O
players	O
are	O
executed	O
instantly	O
in	O
the	O
same	O
simulation	O
or	O
instance	O
of	O
the	O
game	O
,	O
in	O
an	O
online	B-Application
game	I-Application
there	O
are	O
several	O
parallel	O
simulations	O
(	O
one	O
for	O
each	O
player	O
)	O
where	O
the	O
inputs	O
from	O
their	O
respective	O
players	O
are	O
received	O
instantly	O
,	O
while	O
the	O
inputs	O
for	O
the	O
same	O
frame	O
from	O
other	O
players	O
arrive	O
with	O
a	O
certain	O
delay	O
(	O
greater	O
or	O
lesser	O
depending	O
on	O
the	O
physical	O
distance	O
between	O
the	O
players	O
,	O
the	O
quality	O
and	O
speed	O
of	O
the	O
players	O
 '	O
network	O
connections	O
,	O
etc	O
.	O
)	O
.	O
</s>
<s>
The	O
classic	O
solution	O
to	O
this	O
problem	O
is	O
the	O
use	O
of	O
a	O
delay-based	O
netcode	B-Application
.	O
</s>
<s>
This	O
occurs	O
because	O
a	O
delay-based	O
netcode	B-Application
does	O
not	O
allow	O
the	O
simulation	O
to	O
continue	O
until	O
it	O
receives	O
the	O
inputs	O
from	O
all	O
the	O
players	O
in	O
the	O
frame	O
in	O
question	O
.	O
</s>
<s>
This	O
variable	O
delay	O
causes	O
an	O
inconsistent	O
and	O
unresponsive	O
experience	O
compared	O
to	O
offline	O
play	O
(	O
or	O
to	O
a	O
LAN	B-General_Concept
game	O
)	O
,	O
and	O
can	O
negatively	O
affect	O
player	O
performance	O
in	O
timing-sensitive	O
and	O
fast-paced	O
genres	O
such	O
as	O
fighting	O
games	O
.	O
</s>
<s>
An	O
alternative	O
system	O
to	O
the	O
previous	O
netcode	B-Application
is	O
rollback	O
netcode	B-Application
.	O
</s>
<s>
This	O
system	O
immediately	O
runs	O
the	O
inputs	O
of	O
the	O
local	O
player	O
(	O
so	O
that	O
they	O
are	O
not	O
delayed	O
as	O
with	O
delay-based	O
netcode	B-Application
)	O
,	O
as	O
if	O
it	O
were	O
an	O
offline	O
game	O
,	O
and	O
predicts	O
the	O
inputs	O
of	O
the	O
remote	O
player	O
or	O
players	O
instead	O
of	O
waiting	O
for	O
them	O
(	O
assuming	O
they	O
will	O
make	O
the	O
same	O
input	O
as	O
the	O
one	O
in	O
the	O
previous	O
tick	O
)	O
.	O
</s>
<s>
Rollback	O
is	O
quite	O
effective	O
at	O
concealing	O
lag	B-Application
spikes	O
or	O
other	O
issues	O
related	O
to	O
inconsistencies	O
in	O
the	O
users	O
 '	O
connections	O
,	O
as	O
predictions	O
are	O
often	O
correct	O
and	O
players	O
do	O
not	O
even	O
notice	O
.	O
</s>
<s>
This	O
generates	O
visual	B-Error_Name
glitches	I-Error_Name
that	O
interrupt	O
the	O
gameplay	O
of	O
those	O
players	O
that	O
receive	O
inputs	O
at	O
a	O
slower	O
pace	O
,	O
while	O
the	O
player	O
whose	O
game	O
is	O
slowed	O
down	O
will	O
have	O
an	O
advantage	O
over	O
the	O
rest	O
by	O
receiving	O
inputs	O
from	O
others	O
at	O
a	O
normal	O
rate	O
(	O
this	O
is	O
known	O
as	O
one-sided	O
rollback	O
)	O
.	O
</s>
<s>
To	O
address	O
this	O
uneven	O
input	O
flow	O
(	O
and	O
consequently	O
,	O
an	O
uneven	O
frame	O
flow	O
as	O
well	O
)	O
,	O
there	O
are	O
standard	O
solutions	O
such	O
as	O
waiting	O
for	O
the	O
late	O
entries	O
to	O
arrive	O
to	O
all	O
machines	O
(	O
similar	O
to	O
the	O
delay-based	O
netcode	B-Application
model	O
)	O
or	O
more	O
ingenious	O
solutions	O
as	O
the	O
one	O
currently	O
used	O
in	O
Skullgirls	B-Application
,	O
which	O
consists	O
of	O
the	O
systematic	O
omission	O
of	O
one	O
frame	O
every	O
seven	O
so	O
that	O
when	O
the	O
game	O
encounters	O
the	O
problem	O
in	O
question	O
it	O
can	O
recover	O
the	O
skipped	O
frames	O
in	O
order	O
to	O
gradually	O
synchronize	O
the	O
instances	O
of	O
the	O
games	O
on	O
the	O
various	O
machines	O
.	O
</s>
<s>
Rollback	O
netcode	B-Application
requires	O
the	O
game	O
engine	O
to	O
be	O
able	O
to	O
turn	O
back	O
its	O
state	O
,	O
which	O
requires	O
modifications	O
to	O
many	O
existing	O
engines	O
,	O
and	O
therefore	O
,	O
the	O
implementation	O
of	O
this	O
system	O
can	O
be	O
problematic	O
and	O
expensive	O
in	O
AAA	O
type	O
games	O
(	O
which	O
usually	O
have	O
a	O
solid	O
engine	O
and	O
a	O
high-traffic	O
network	O
)	O
,	O
as	O
commented	O
by	O
Dragon	B-Application
Ball	I-Application
FighterZ	I-Application
producer	O
Tomoko	O
Hiroki	O
,	O
among	O
others	O
.	O
</s>
<s>
Although	O
this	O
system	O
is	O
often	O
associated	O
with	O
a	O
peer-to-peer	O
architecture	O
and	O
fighting	O
games	O
,	O
there	O
are	O
forms	O
of	O
rollback	O
networking	O
that	O
are	O
also	O
commonly	O
used	O
in	O
client-server	B-Operating_System
architectures	I-Operating_System
(	O
for	O
instance	O
,	O
aggressive	O
schedulers	O
found	O
in	O
database	B-Application
management	I-Application
systems	I-Application
include	O
rollback	O
functionality	O
)	O
and	O
in	O
other	O
video	O
game	O
genres	O
.	O
</s>
<s>
There	O
is	O
a	O
popular	O
MIT-licensed	O
library	O
named	O
GGPO	B-Application
designed	O
to	O
help	O
implement	O
rollback	O
networking	O
to	O
games	O
(	O
mainly	O
fighting	O
games	O
)	O
.	O
</s>
<s>
Latency	O
is	O
unavoidable	O
in	O
online	B-Application
games	I-Application
,	O
and	O
the	O
quality	O
of	O
the	O
player	O
's	O
experience	O
is	O
strictly	O
tied	O
to	O
this	O
(	O
the	O
more	O
latency	O
there	O
is	O
between	O
players	O
,	O
the	O
greater	O
the	O
feeling	O
that	O
the	O
game	O
is	O
not	O
responsive	O
to	O
their	O
inputs	O
)	O
.	O
</s>
<s>
There	O
are	O
several	O
lag	B-Application
compensation	O
methods	O
used	O
to	O
disguise	O
or	O
cope	O
with	O
latency	O
(	O
especially	O
with	O
high	O
latency	O
values	O
)	O
.	O
</s>
<s>
Tickrate	O
for	O
games	O
like	O
first-person	O
shooters	O
is	O
often	O
between	O
128	O
ticks	O
per	O
second	O
(	O
such	O
is	O
Valorant	B-Application
's	O
case	O
)	O
,	O
60	O
ticks	O
per	O
second	O
(	O
in	O
games	O
like	O
Counter-Strike	B-Application
:	I-Application
Global	I-Application
Offensive	I-Application
and	O
Overwatch	B-Application
)	O
,	O
30	O
ticks	O
per	O
second	O
(	O
like	O
in	O
Fortnite	B-Application
and	O
Battlefield	B-Application
V	I-Application
's	O
console	O
edition	O
)	O
and	O
20	O
ticks	O
per	O
second	O
(	O
such	O
are	O
the	O
controversial	O
cases	O
of	O
Call	O
of	O
Duty	O
:	O
Modern	O
Warfare	O
,	O
Call	B-Application
of	I-Application
Duty	I-Application
:	I-Application
Warzone	I-Application
and	O
Apex	B-Application
Legends	I-Application
)	O
.	O
</s>
<s>
Various	O
simulation	O
synchronization	O
errors	O
between	O
machines	O
can	O
also	O
fall	O
under	O
the	O
"	O
netcode	B-Application
issues	O
"	O
blanket	O
.	O
</s>
<s>
Traditionally	O
,	O
real-time	O
strategy	O
games	O
(	O
such	O
as	O
Age	B-Application
of	I-Application
Empires	I-Application
)	O
have	O
used	O
lock-step	O
peer-to-peer	O
networking	O
models	O
where	O
it	O
is	O
assumed	O
the	O
simulation	O
will	O
run	O
exactly	O
the	O
same	O
on	O
all	O
clients	O
;	O
if	O
,	O
however	O
,	O
one	O
client	O
falls	O
out	O
of	O
step	O
for	O
any	O
reason	O
,	O
the	O
desynchronization	O
may	O
compound	O
and	O
be	O
unrecoverable	O
.	O
</s>
<s>
A	O
game	O
's	O
choice	O
of	O
transport	B-Architecture
layer	I-Architecture
protocol	O
(	O
and	O
its	O
management	O
and	O
coding	O
)	O
can	O
also	O
affect	O
perceived	O
networking	O
issues	O
.	O
</s>
<s>
If	O
a	O
game	O
uses	O
a	O
Transmission	B-Protocol
Control	I-Protocol
Protocol	I-Protocol
(	O
TCP	O
)	O
,	O
there	O
will	O
be	O
increased	O
latency	O
between	O
players	O
.	O
</s>
<s>
These	O
types	O
of	O
connections	O
are	O
very	O
reliable	O
,	O
stable	O
,	O
ordered	O
and	O
easy	O
to	O
implement	O
,	O
and	O
are	O
used	O
in	O
virtually	O
any	O
operation	O
we	O
do	O
on	O
the	O
Internet	O
(	O
from	O
web	O
browsing	O
to	O
emailing	O
or	O
chatting	O
through	O
an	O
IRC	B-Protocol
)	O
.	O
</s>
<s>
These	O
connections	O
,	O
however	O
,	O
are	O
not	O
quite	O
suited	O
to	O
the	O
network	O
speeds	O
that	O
fast-action	O
games	O
require	O
,	O
as	O
this	O
type	O
of	O
protocol	O
(	O
Real	B-Protocol
Time	I-Protocol
Streaming	I-Protocol
Protocols	I-Protocol
)	O
automatically	O
groups	O
data	O
into	O
packets	O
(	O
which	O
will	O
not	O
be	O
sent	O
until	O
a	O
certain	O
volume	O
of	O
information	O
is	O
reached	O
,	O
unless	O
this	O
algorithm	O
-	O
Nagle	B-Protocol
's	I-Protocol
algorithm	I-Protocol
-	O
is	O
disabled	O
)	O
which	O
will	O
be	O
sent	O
through	O
the	O
connection	O
established	O
between	O
the	O
machines	O
,	O
rather	O
than	O
directly	O
(	O
sacrificing	O
speed	O
for	O
security	O
)	O
.	O
</s>
<s>
This	O
type	O
of	O
protocol	O
also	O
tends	O
to	O
respond	O
very	O
slowly	O
whenever	O
they	O
lose	O
a	O
packet	O
,	O
or	O
when	O
packets	O
arrive	O
in	O
an	O
incorrect	O
order	O
or	O
duplicated	O
,	O
which	O
can	O
be	O
very	O
detrimental	O
to	O
a	O
real-time	O
online	B-Application
game	I-Application
(	O
this	O
protocol	O
was	O
not	O
designed	O
for	O
this	O
type	O
of	O
software	O
)	O
.	O
</s>
<s>
If	O
the	O
game	O
instead	O
uses	O
a	O
User	B-Protocol
Datagram	I-Protocol
Protocol	I-Protocol
(	O
UDP	O
)	O
,	O
the	O
connection	O
between	O
machines	O
will	O
be	O
very	O
fast	O
,	O
because	O
instead	O
of	O
establishing	O
a	O
connection	O
between	O
them	O
the	O
data	O
will	O
be	O
sent	O
and	O
received	O
directly	O
.	O
</s>
<s>
This	O
protocol	O
is	O
much	O
simpler	O
than	O
the	O
previous	O
one	O
,	O
but	O
it	O
lacks	O
its	O
reliability	O
and	O
stability	O
and	O
requires	O
the	O
implementation	O
of	O
own	O
code	O
to	O
handle	O
indispensable	O
functions	O
for	O
the	O
communication	O
between	O
machines	O
that	O
are	O
handled	O
by	O
TCP	O
(	O
such	O
as	O
data	O
division	O
through	O
packets	O
,	O
automatic	O
packet	B-Protocol
loss	I-Protocol
detection	O
,	O
etc	O
.	O
</s>
