►
From YouTube: Scalable Multiplayer Game Design with OpenShift (E10)
Description
This monthly series explores what it takes to design a scale-out multiplayer video game architecture using containers and OpenShift. There will be live coding, philosophical design discussion, and everything in between.
A
A
B
Main
zoom
scene
hi
looks
like
we're
live
so
welcome
to
another
episode
of
our
multiplayer
scalable
multiplayer
game
can't
forget
that
scalable
multiplayer
game
design
stream.
My
name
is
eric
jacobs.
I
am
joined
today
by
jared
sprague
and
roddy
kiley,
yes,
usually
pronunciation
for
the
win,
so
yeah
what
has
been
going
on
since
the
last
time
we
were
here,
so
we
have
done
a
little
bit
or
by
we
I
mean
roddy
roddy's
done
a
little
bit
of
work
on
the
game
server
for
those
of
you
who
might
be
new
to
this
particular
show.
B
We
have
sort
of
a
game,
server,
game,
client,
design
that
uses
activemq
for
messaging
between
the
client
and
the
server,
and
the
ultimate
goal
is
to
make
all
this
stuff
run
on
kubernetes,
specifically
openshift
and
be
super
super
super
scalable
and
so
from
a
game
design
concept
and
if
either
of
you
guys
can
put
links
in
the
twitch
chat.
I
guess
I
could
dig
them
up
while
we're
doing
this
from
a
game
design
concept.
B
The
game
is
called
space,
ring
things
and
so
they're,
these
sort
of
concentric
rings,
and
you
are
a
little
tiny
spaceship
to
start
and
as
you
defeat
other
players,
you
pick
up
stuff
which
makes
you
heavier,
which
pulls
you
towards
the
center,
and
so
it's
kind
of
battle.
Royale-Ish
rogue-like
space,
invaders,
star
control,
all
these
kinds
of
games
mashed
together.
So
clearly
nothing
new
are
inventive.
Just
you
know,
old
tropes
put
together
in
a
different
way.
B
So
all
that
being
said,
mr
roddy,
you
have
been
a
busy
beaver
with
respect
to
the
game
server
and
some
changes
there.
I
think
you
added
some
bullet
shooting
stuff
and
some
other
things.
So
maybe
you
want
to
share
some
screen
and
do
some
code.
B
C
So
many
windows,
so
many
windows,
so
yeah,
so
I
had
missed
the
the
last
session,
and
so
when
I
got
back
to
doing
it
this
time,
as
eric
mentioned,
I
looked
at
the
bullet
code.
So
looking
back
to
how
the
server
was
originally
set
up,
it
was
originally
said
to
be
a
what
was
called
a
dual
stick:
shooter,
meaning
your
left.
C
As
you
might
recall,
we
have
a
back-end
server
written
in
c
plus
plus
we
switched
it
over
from
the
legacy
cms
client,
which
was
based
on
the
open
wire
wire
level
format,
but
with
the
jms
specification
from
java
land
to
a
more
modern
messaging
protocol
called
amqp,
which
is
advanced
messaging
protocol,
and
it
also
is
an
iso
standard.
So
when
we
switched
over
there,
we
still
kept
the
same
data
format,
basically
being
sent
across.
C
So
inside
of
our
messages
we
have
like
you
know,
basically
a
payload
in
each
packet,
and
so
the
payload
is
in
protobuf
format,
and
so
we
have
this.proto
file
if
you're
familiar
with
protocol
buffers,
which
was
usually
created
by
and
still
maintained
by,
google,
which
is
great
format
that
basically
takes
like
an
x
and
y
for
one
stick
and
x
and
y
for
another.
Both
are
sets
of
floats.
C
C
Left
right,
we
kind
of
could
rotate
at
the
ship
and
we
had
a
thrust
on
the
rear
and
that
kind
of
stuff,
so
that
you
know
when
it
comes
to
the
point
when
we
get
the
point
and
click
interface
stuff
implemented,
when
you
click
basically
there'll
be
a
calculation
like
hey.
How
do
I
get
from
point
a
to
point
b?
What's
the
appropriate
rotation
and
thrust
and
all
that
kind
of
stuff?
C
So
what
we
really
want
is
bullets
to
go
flying
and
I
started
down
that
road
and
so
looking
on
the
client
here,
I'm
just
going
to
find
my
zoom,
which
has
disappeared
once
again
and
I'm
going
to
share
my
screen
for
webstorm,
which
is
the
one
that
I'm
using
actually
to
edit
the
client-side
work.
C
It's
a
jet
brains,
client
based
on
their,
I
guess
originally
on
their
intellij
interface,
all
right.
So
in
a
second,
we
should
see
some
package.json
watch
through
webstorm
a
few
other
things
and
I'm
just
going
to
do
a
quick
look
for.
C
B
C
My
whole
desktop
and
I
never
have
problems
where
would
you
ever
get
a
break
to
fix
problems
all
right
so
so,
like
we
said,
we
basically
have
so
if
you
scroll
up
here,
I
think
it's
very
similar
above.
If
we
had
something
really
simple,
we
have
keyboard
input,
it's
of
type
2
and
that's
the
packet
type.
C
Now
eric
has
displayed
in
the
web
client
so
that
we
kind
of
identify
one
from
the
other,
and
so
the
real
thing
here
is
at
the
end
of
the
day,
we
have
these
data
structures,
which
are
essentially
essentially
vectors
of
floats,
and
so
pb
in
this
case
means
protocol
buffer
v2
for
vector
one
set
of
x
and
y
is
for
move.
One
set
of
x
and
y
is
for
shoot
so
up
until
just
recently,
we
simply
were
putting
in
zero
zero
for
shoot.
C
C
And
so
then,
if
we
do
a
quick
search
for
one
second
here
sorry
about
this.
Once
again,
I
believe
it's
in
the
main
scene
here
and
I
think
we
scroll
up
and
so
looking
at
our
updates.
So
each
tick.
We
do
an
update,
basically
every
frame-
and
we
have
some
stuff
here
to
check
for
destruction.
We
have
some
stuff
here
to
make
sure
the
body
exists
and
if
so,
then,
to
do
the
rotation
stuff
that
we
just
discussed
to
set
the
angle
in
the
rotation
and
then
as
well.
C
So
in
the
beginning
we
use
the
cursors,
which
is
like
your
little
arrow
keys
on
the
keyboard
to
check
the
keyboard
is
the
left
down
is
the
right
down
is
the
up
down?
Is?
Is
the
down
down
and
associate
your
appropriate
one
to
minus
one
or
I
guess
in
each
direction
right?
So
one
of
the
things
actually
myself
and
chart
were
talking
about
before
the
session
began?
Was
that
like
we're
doing
like
an
absolute
value
thing
here
like
one
is
true
or
minus?
C
So
getting
back
to
what
we
added.
In
this
case,
we
simply
added
wasd
keyboard
control
for
shooting,
and
basically
it's
exactly
the
same.
We
just
did
one
minus
one
in
the
x
y
direction
and
then,
of
course,
we're
throttling
it,
because
we
basically
aren't
really
going
to
be
sending
all
the
updates
that
come
from
your
keyboard,
because
you
know
your
client
might
be
reading
keyboard
inputs
at
I
don't
know
100
times
a
second
say
if
it's
100
hertz,
if
you
had
a
really
fast
machine,
a
really
fast
browser.
C
Good
keyboard,
all
that
kind
of
stuff-
that's
wired,
but
in
actual
fact
we
may
only
be
sending
this
to
the
server
and
getting
responses
back.
We
may
be
simulating
at
say,
60
frames
per
second
or
60
times
a
second,
so
setting
it
100
times
is
a
bit
extra.
So
we
throttle
it
at
this
point
in
time.
C
So
really
from
the
client
side,
there
really
wasn't
any
much
update
required
to
get
the
input
side
to
go
to
the
server
so,
like
I
was
saying
earlier
to
eric,
I
think
it
was
that
in
the
switch
from
our
original
dual
stick
control
scheme
to
this
game,
where
we
have
rotation,
we
have
thrust,
we've
changed
some
of
the
way
that
the
bodies
are
moved
to
be
not
always
physically
simulated.
C
C
We
can
see
a
physics
like
a
collision
structure
being
created
in
the
physics
simulation,
because
the
original
concept
of
the
way
this
was
done
was
that
everything
was
going
to
be
physically
simulated.
So
if
you
fired
a
missile
from
your
ship,
there'd
be
a
little
bit
of
push
back
on
your
ship
and
that
that
would
be
simulated.
C
So
at
the
moment
what
happens
in
the
client
here,
I
don't
know
how
quickly
I
can
bring
this
up
here
when
a
bullet
is
shot.
Weird
things
happen,
so
the
ships
don't
quite
move,
as
you
might
expect.
So
I'm
just
going
to
see
what
I
currently
have
running,
because
I
was
doing
some
debugging
earlier
and
I
don't
know
if
my
server
and
client
are
all
running
together.
C
D
C
D
C
So
the
game
server
is
indeed
up
and
the
culprit
was.
The
client
was
up
so
so
you're
just
changing
some
stuff
with
branches
and
stuff
just
before
the
session,
and
I
was
testing
so
to
back
up
another
a
little
bit
to
what
we
were
doing
here
with
the
server
I'm
just
going
to
share
my
screen
once
again
a
different
screen
this
time
around.
As
soon
as
I
can
find
my
zoom
window
to
do
so
sure
screen.
C
So
one
of
the
things-
obviously
that's
a
goal
here-
is
to
make
sure
all
this
stuff
runs
on
openshift
right,
so
we'd
containerize
the
server,
and
I
think
we
may
have
had
it
roughly
running
on
openshift
a
while
ago.
So
just
recently,
I
I
started
running
code
ready
containers
on
a
a
more
beefy
workstation
class
machine.
C
I
don't
know
for
anybody
who's
not
familiar
with
code
ready
containers.
It's
like
a
an
openshift
developer
sandbox,
not
not
our
sandbox,
from
a
red
hat
point
of
view,
but
with
regards
to
a
local
development
environment,
you
should
be
able
to
run
on
your
own
hardware
to
relatively
quickly
build
stuff
for
kubernetes
and
openshift.
You
know
build
a
container
image
push
it
into
its
registry,
create
a
project
deploy
it
that
kind
of
stuff.
C
Sometimes
that
can
be
a
bit
of
a
lengthy
process
if
you're
in
a
bigger
organization
and
your
openshift
cluster
might
be
located
far
from
where
you're
actually
working
and
sometimes
that's
a
bit
slow
code.
Ready
containers
can
make
that
a
lot
quicker.
My
previous
experience
in
running
it
on
my
local
laptop,
which
was
a
real.
C
I
would
say
it
was
a
low
end
machine,
but
it
wasn't
a
workstation
class
machine
wasn't
really
great,
because
the
whole
machine
had
16
gigs
of
ram
and
6
cores,
and
now
it's
on
a
workstation
with
256
gigs
of
ram
and
16
cores,
of
which
I
could
easily
dedicate
you
know
eight
cores
and
64
gigs
to
just
the
code
ready
containers
and
in
that
type
of
scenario,
the
development.
This
experience
has
been
really
really
good.
C
It's
been
really
quick,
very
responsive
and,
as
we
can
see
here
from
from
the
screenshot
myself
and
eric
a
couple
of
days
ago,
went
through
to
get
my
development
environment
up
running
on
this
new
machine.
So
we've
got
you
know,
we've
got
the
amq
broker
operator
up
and
running.
It's
obviously
close
to
my
heart,
because
I
work
on
it
relatively
all
the
time
they
have
a
bro,
an
instance
of
the
broker
itself,
which
is
the
messaging
component.
C
That
basically
has
like
a
two-way
channel
where
it
talks
to
the
server
and
it
takes
ownership
of
the
messages
as
they
come
in,
make
sure
they're
persistent
disk
if
required,
and
then
it
has
a
separate
relationship
for
the
with
the
client,
where
it
makes
sure
that
the
client
then
receives
the
message
right
cause.
That's
what
what
it
is
to
kind
of
be
a
broker,
it's
kind
of
a
bit
of
a
middleman.
C
C
C
When
we
look
here,
we
have
a
route
called
srt
broker
amqp
and
it
exposes
itself
as
srt
broker
and
qp0
service
route.
Apps.
That's
here,
crc.testing,
which
is
the
default
essentially
cluster
domain,
that
your
code,
ready
containers
will
deploy
with.
C
C
C
C
And
so,
if
we
see
here,
there's
three
connections
to
the
broker,
the
game,
server
actually
utilizes,
two
of
those
and
then
the
third
one
here
is
actually
coming
in
basically
from
from
the
router.
C
And
so
we
look
on
the
amqp
acceptor.
Actually,
let's
look
at
the
addresses,
and
so
we
have
a
command.out
that
is
in
anycast,
which
means
that's
a
point-to-point
connection
between
the
game,
server
and
the
client
using
a
uniquely
generated
reply
id
so
that
we
can
speak
specifically
to
that
client
in
the
beginning.
In
the
case
of
the
security
process,
when
you're
joining
the
game
and
then
as
well,
here
we
can
look
in
the
what
is
a
multicast
queue,
and
that
means
that's
a
one
to
many.
So
basically,
we
have
one
update.
C
That's
a
game
simulation
update.
We
want
to
send
it
out
to
all
the
clients,
and
so
we
look
in
here
and
let's
see
if
we
can
find
out
some
attributes
here
at
the
moment,
persistent
size
is
large
and
trying
to
find
out
the
number
of
messages
here.
C
Acknowledgement
attempts
535
messages,
acknowledged
4
135
back
on
the
cuib,
which
represents
the
game
event
out.
So
essentially,
you
know
what
we're
witnessing
here
with
regards
to
this
little
ship
moving
around
the
screen.
A
little
bit
is
indeed
you
know,
basically,
because
it's
the
client
of
sending
the
input
to
the
broker
broker
is
connecting
it
to
the
server.
C
The
server
is
doing
the
simulation
and
then
the
reverse
is
true
and
that
the
simulation
updates
go
out
to
the
broker,
get
multicast
out
all
the
clients,
in
this
case
there's
just
one,
but
there
could
be
more
than
one
so
we'll
just
localhost
8000,
we'll
connect
in
another
client
here
very
quickly
and
when
our
other
client
had
timed
out
and
dot,
let's
connect
two
more
quickly
than
that.
We
shouldn't
only
see
one,
it's
not
to
say
we
haven't
introduced
the
bug
somewhere,
because
that
does
happen.
Oh
there
we
go
never
so
so
I
guess
he.
C
B
C
Yeah,
so
this
guy
is
right,
so
this
guy's
having
some
problems
here,
so
I
just
shot
without
actually
moving
the
guy
on
the
bottom.
But
I'm
going
to
move
the
guy
on
the
bottom
now
and
then
I'm
going
to
move
the
guy
on
the
top
right
and
these
guys
can
rotate
and
they
can
thrust
toward
each
other
and
there
can
be
some
collisions
if
we
can
manage
to
get
them
to
hit
each
other
right.
C
B
C
C
D
D
B
So
I
was
thinking
that
we
would
just
show
on
the
player
when
we're
in
this
debug
mode
in
the
server.
Well,
the
client
and
when
I
say
client,
it's
a
it's
a
node.js
application
running
in
express
right.
We
have
all
the
protobuf
info,
which
has
all
the
velocities
and
speeds
and
all
the
other
things.
So
why
not
just
display
it?
Next
to
the
player's
name,.
C
Have
a
suggestion
to
avoid
the
awfulness
yeah,
so
I'm
just
going
to
drop
in
chat
here.
C
B
C
A
C
They
pronounced
it
in
the
beginning,
apparently
there's
a
javascript
for
it.
I
just
took
a
quick
look
and
iron
gui
is
like
it's
one
of
these
things
that
it's
a
very
immediate
mode,
easy
to
draw
gui
components
and
stuff.
At
least
it
is
in
the
other
languages
where
I've
used
it
and
it's
integrated.
For
example,
in
the
linux
foundation's
new
open,
3d
engine
they
use.
I
am
gui
on
the
c
plus
plus
side
as
they're
like
hey.
C
D
Yeah,
obviously
I
know
what
you're
talking
about
yeah
I've
used
that
that's
definitely
useful
for
tweaking
stuff,
I'm
not
sure
how
I've
never
used
it
as
like
a
logging
tool.
Oh.
C
D
Yeah
but
yeah
for
like
sliding
variables
like
back
and
forth
in
real
time
and
seeing
how
it
affects
the
client.
That's
it's
definitely
yeah,
it's
great
for
that
absolutely
and
yeah
and,
like
3js,
uses
that
a
lot
a
lot
of
a
lot
of
javascript
libraries
use
that
a
lot
in
their
examples,
so
that
you
can
tweak
stuff
in
real
time
and
see
how
it
looks
we
could
we
could
do
that.
I
don't
know
what
variables
we
have
that
we
would
want
to
change
in
real
time
on
the
client
but
but
yeah.
D
So
I
had
to
before
we
move
on
to
the
before
we
move
on
to
like
just
diving
into
client
debugging
stuff.
Can
we
can,
I
add,
a
quest,
a
couple
questions
about
the
shoot
stuff
that
you
put
in.
It
looks
like
you're
using
a
mouse
input
like
when
you
click
it
will
fire.
Is
that
no.
D
B
So
that
the
answer
to
that
question
depends
on
where
we
want
to
end
up,
so
anything
you
build
right
now,
doesn't
change
anything
having
to
do
with
shooting
or
or
or
moving.
If
you
will,
I
think
in
general
what
we
want
from
a
shooting
perspective.
The
simplest
answer
is
one
like
non-directional
shooting
for
now,
in
the
sense
that,
whatever
way
the
ship
is
pointing
is
where
the
the
pew
pew
goes.
Yes
and.
B
D
Yeah,
that
was
my
main.
My
main
point
is
the
shooting
should
just
there
should
be
a
fire
button
somewhere
it
could
be
the
mouse
or
a
button
or
something
if
you're
on
mobile,
that
will
shoot
just
straight
ahead.
Whatever
direction
the
yep,
the
ship
is
pointing
at
the
time,
yep
cool,
all
right,
then
all
right
cool.
So,
let's
let
me
share
my
screen
and
I'll
see
if
I
can
get
a
local
server
running,
I
got
the
client
started,
but
I
can't
connect
because
obviously
I
don't
have
a
server
so
share.
My
screen
here.
D
Alright,
so
maybe
ronnie
you
can
tell
me
what's
going
on,
I
I
use
the
command
that
you
put
in
chat
before.
D
All
right
so
going
back
to
my
server
and
I'll
make
this
bigger,
yeah
I'll,
make
it
bigger.
A
C
B
B
In
the
instruction
in
the
repo
for
server
the
client,
where
do
we?
Where
do
we
tell
you
how
to
run?
I.
D
C
A
B
B
D
B
B
You
don't
need
it
because
you're
not
going
to
do
the
the
exporty
funky
thing
all.
D
Yeah,
okay,
it
was
was
it
probably
in
your.
B
D
Yeah
is
it
in
here
yeah
yeah
yeah?
This
is
the
one
and.
D
This
one
is
the
port.
A
D
C
B
Here,
when
we,
when
I
had
first
committed
those
code
changes,
I
was
doing
it
inside
an
openshift
cluster
running
on
amazon
and
the
easiest
way
in
that
cluster.
Just
to
get
a
functional
route,
for
whatever
reason
was
to
just
export
the
service
or
make
a
load
balancer
type
service
in
kubernetes,
which
gave
me
an
amazon
elb,
and
so
that
didn't
need
a
port
because
it
was
just
forwarding
to
the
pod
internally.
So
now
we
need
the
port,
because
we're
talking
directly
to
the
broker
with
no
intermediary.
D
To
put
the
port
in
yeah.
D
We
can
add
some
things
so
this
so
it
looks
like
it's
logging,
some
some
messages
back
and
forth
with
the
client
yep
already
and
which
is
so
so
we
have
rotation
and
movement.
So.
C
D
A
A
C
So
for
the
for
the
moving
shoot
x
and
y,
it's
going
to
be
the
dual
stick:
raw
input
command,
buffered
up,
roto.
A
D
In
this
one
dual
yep,
so
this
is
the.
C
D
C
And
so,
if
you
look
in
there
down
on
the
bottom
is
the
optional
box2d.pb
body
struct,
and
so
that
basically,
is
a
protobuffer
version
of
the
box
to
the
body
within
the
simulation.
C
B
No,
no,
no
so
you're
the
entity
game
event.
Buffer
type
is
an
integer.
The
box,
cd
pb
body,
is
the
fourth
field.
B
B
So
in
your
browser
you
so-
and
this
is
this-
is
the
part
where,
like
I
get
lost,
debugging
javascript
stuff,
because
I
don't
know
how
you
can
get
access
to
stuff-
that's
buried
inside
the
amqp
game.
Client
in
this
weird,
whenever
you
had
like
changed
all
the
code
around
to
not
be
in
a
single
file
and
started
using.
This
is
yeah,
and
as
soon
as
that
happened,
I
I
lost
all
ability
to
debug
in
the
way
that
I
would.
D
B
D
D
D
You
can
just
put
it
in,
you
can
just
say
window
dot
whatever
like
and
then,
and
I
wonder
like
actually
let
me
see
what
we
have
already,
because
I
don't
know
if
I've
done
this
for
anything
yet
but
like
I
don't
think
we
have
the
model
or
anything
yeah
so
like
we
could
take
the
model
and
put
that
in
the
window.
D
B
D
B
B
D
D
Client,
we
generate
our
player
identity
in
the
preload
scene
right
here.
It's
actually
in
the
where
this,
this
uuid.
D
B
Get
out
yeah
yeah,
I
mean
it
would
be
cool
to
spit
out
the
other
players.
Information
like
by
trunking
the
uid
and
showing
like
this
player
is
this.
This
player
is
that,
but
that's
going
to
get
really
chatty
yeah,
because
the
server's
sending
messages
like
constantly,
so
you
might
want
to
throttle
those
to
be
like
once
a
second
once
every
other.
Second,
I
I
don't
know,
try
something
yeah.
D
D
D
C
B
At
my
work.
B
I
had
been
talking
about
weird
golang
things,
because
I'm
writing
an
operator
for
blender
and
separately
and
rowdy
pasted
a
response
to
a
golang
question
that
was
like
how
to
run
the
broker
and
look
what
I
don't.
B
D
D
Yeah
totally
and
we
actually
have
we
have
a
logging
library.
Let
me
use
that
instead,
where
is
that,
instead
of
just
do
it
well
I'll,
just
do
I'll
just
I'll
just
do
a
straight
console
to
start
with.
D
And
I
have
an
es
led
to
error,
but
they
fixed
it
all
right.
So,
let's
just
refresh
the
client,
then
you
gotta.
B
B
D
Yeah,
let
me
okay,
let
me
check
this,
make
sure
the
servers.
Oh,
the
server,
crashed.
Okay,
that's
why.
D
B
Yeah,
so
what
happens
is
if
the
server
is
running
for
too
long
without
a
client
connected
it?
It
gets
angry
and
dies.
D
B
Was
is
you
you
still?
There
were
still
messages
in
the
broker,
so
this
is
actually
a
benefit
to
using
activemq
and
messaging
in
the
client
server
communication,
because
what
really
happened
under
the
covers
is
now.
We
have
a
bad
player
experience.
It
didn't
tell
us
that
we
couldn't
connect
to
the
server,
but
under
the
covers,
what
happened
was
a
message
got
sent
by
the
client?
B
Hey,
I'm
joining
the
game
and
nobody
grabbed
the
message,
so
it
just
sat
there
and
waited
and
then
jared
refreshed
his
game
client,
which
sent
another
unique
message:
hi,
I'm
another
new
player,
I'd
like
to
join
the
game.
When
the
server
came
up,
it
popped
both
messages
off
the
queue
yeah,
that's
right
and
created
two.
A
B
But
the
old
message
when,
when,
when
jared
just
restarted,
the
client
like
never
got
rescinded
in
any
way,
so
this
is
both
good
and
bad
in
the
sense
that
it's
cool,
because,
like
a
temporary
glitch
in
the
server,
doesn't
completely
hose
everything
and
the
server
can
potentially
play
catch-up.
The
bad
news
is
that
we
don't
have
any
logic
to
understand
that,
like
this
player
is
an
orphan
and
nobody's
there
to
control
it
so
like
you
should
nuke
it
pretty
quickly.
D
Yeah
so
where,
let's
see,
how
can
we
what's
the
what's
the
right
steps
to
get
down
back
down
to
one
player.
D
D
Cool,
so
we're
back
down
yeah
that
makes
sense
so
we're
down
to
one
player.
It
seems
like
it's
moving
around
and
it's
the
little
uuid
hash
here
matches,
what's
being
locked,
yep.
D
B
Right,
so
we
want
to
throttle
that
yeah.
So
is
there
a
way
to
know
in
phaser
what
the
current
frame
is?
Does
it
keep
any
kind
of
ticker
of
how
many
frames
it's
displayed.
D
Oh,
I
can
just
no,
I
can
just
use
the
throttle
like
that's
easy
to
throttle
it,
and
it's
just
like
it's
what
I
do
with
this
one.
You
basically
there's
a
low
dash
command
called
throttle.
D
Send
a
will
create
a
new
function
that
will
only
run
a
certain
number
of
frames
like
this
one's
running,
every
25.
No,
this
one's
actually
running
every
25
milliseconds,
I'm
pretty
sure.
I
think
this
is.
I
think
this
is
milliseconds
as
an
argument,
but.
D
I
can't
remember
if
that
the
second
argument
is
is
frames
or
timing,
but
I'm
pretty
sure
it's
timing.
So
let
me
find
a
there.
It
is
throttle
weight
is
a
number
of
milliseconds,
okay
cool
all
right.
So
let's
go
ahead
and.
D
D
This
I'll
just
create
it
here.
A
D
Yeah,
so
what
we're
gonna
do
is
actually
we're.
Gonna
change
this
to
be.
D
C
B
B
B
Yeah,
so
you
should
just
be
able
to
add
player.body.
D
Okay,
so
this
is
we're:
gonna
have
to
pass
it
in.
B
So
maybe
modify
the
log
player
throttle
to
take
the
message
that
you
want
to
display.
Instead
of
having
log
player,
throttled,
generate
the
message
or
pass
in
the
body
as
an
argument
and
then
process
the
body
and.
D
D
You
know
any
any
writing
any
code
unless
it
has
to
so,
let's
do
actually
what
I
could
do
is.
D
D
I
want
to
put
this
down
here
and
get
rid
of
this
and
we'll
just
do
this,
but
we'll
just
call
it
as
a
function
at
the
end,
all
right,
so
now
we
can
now
we
can
put
whatever
we
want
to
in
here
so
the
player.
So
we
get
player
a
body
we
could
just.
We
could
output
the
whole
player.body.
D
D
D
A
B
D
A
D
D
Maybe
we
can
put
all
of
these
as
a
variable
in
that
in
that
tool
that
ronnie
mentioned
the
gui
tool.
D
So
that's
working
all
right,
so
should
we
take
a
look
at
that?
D
C
Well,
I
mean,
I
guess
right
now.
I
think
I'm
not
sure
if
the
linear
velocity
is
used,
let's
say
that
it
won't
be,
especially
if
we're
having
point
and
click,
and
we
want
to
see
what
the
rotation
is
supposed
to
be
and
all
that
kind
of
stuff
right,
certainly
the
position
and
the
collision
wrecks
would
be
handy
right.
It
would
be
handy
to
know
like
we
know
right
now
when
the
two
ships
come
together.
For
example,
the
collision
wrecked
is
not
such
that
it's
correct
right.
B
Yeah,
what
ends
up
happening
is
like
I
did
some
really
ugly
math
and
no
physics
with
with
box
2d
and
the
client
to
make
the
ship
rotate,
because
when
we
tried
to
apply
rotational
thrust
and
inertia
like
it
was
lots
of
math
and
we
were
just
weren't
doing
it
even
remotely
right
and
derrick
was
like
yeah,
we'll
just
find
the
fun
like
it'd
be
easier
if
you
just
turned
the
ship,
and
so
I
was
like
oh
cool
I'll,
just
turn
the
f
in
ship.
B
C
B
They
start
rotating
and
they
never
stop,
because
there's
no
gravity
and
no
friction
yeah.
So
we
have
to
fix
that
which
we
could
do
by
just
constantly
setting
rotational
inertia
to
zero.
B
C
B
D
B
I
mean
so
the
challenge
right
now
is
that
we're
we're
putting
debug
information
into
the
console.
So
it's
really
hard.
D
B
D
D
D
D
And
I've
I've
used
tools
like
this
before
and
I
wish
michael
was
here
because
he
would
know
right
away
like,
for
example,
if
you
go
to
the
3js
any
a
lot
of
their
examples.
Have
this
this
ui
thing
in
the
top?
Let's
check
yeah.
Here
we
go
the
this
thing
right
here
where
you
can
like
change,
slider
values.
These
are
just
all
variables
that
get
changed.
D
D
Let
me
see
if
I
can
yeah
what
is
this
tool
called?
Let
me.
D
D
I
merged
that
I
merged
that
my
email
yeah
emerged.
There
was
a
pull
request.
I
noticed
for
from
derrick
to
add
npm
version
command.
D
D
C
It
does
look
like
typescript,
even
though
the
the
title
is
dash.
Js
yeah.
D
B
What
is
it
if
you
look
at
their
code
pen,
it
doesn't
look
like
it's
typescript,
it's
just
regular
javascript.
B
Interesting,
okay,
so
they're
like
writing.
Typescript
inside
javascript,
as
like
text
strings.
It's
it's
really
bizarro.
D
I'm
getting
I'm,
this
is
the
one,
so
this
one
on
the
3.js
examples.
This
is
like
the
one
I'd
want
to
use
like
because
it's
just
basic
javascript
like.
D
No,
no,
this
is
a.
This
is
a
generic
parameter.
Changing
widget
that
gets
can
be
added
to
any
dom,
and
it's
used
in
a
lot
of
places
through.
D
D
And
is
generic,
it
has
it's
not
specific
to
3js.
So
let
me
actually
have
an
idea
if
I
can
open
up
the
3js
source
code.
D
B
D
That
sounds
like
it.
That
sounds
like
it
that
gui.
B
Yeah,
so
it's
github.com,
yes,
d-a-t-a-a-r-t-s.
D
D
D
A
B
B
D
It
the
the
build,
the
build
trans
transpiles
it
anything
es6
related
gets
transpiled
by
babel
in
the
client.
D
Okay,
that's
how
we're
already
using.
If
you
look
at
a
lot
of
the
some
of
these
things
like
this
export,
all
of
like
and
and
the
scenes
and
stuff,
I
think
there
may
be
some
places
where
we
do
imports
already.
D
I
think
yeah
here
we
go.
This
is
in
in
game.js,
we're
already
doing
imports
in
in
the
es6
way,
and
so
this
should
work
just
exactly
the
same
cool
yeah,
so
cool
all
right.
I
just
need
to
get
the
thing
installed
to
start
with.
Let's
just
save
it.
B
D
Npm
install
save
that
gui
all
right,
so
first
step
install
the
npm
dependency
and
when
I
do
this,
okay,
I
must
have
spelled
something
wrong
because
that
worked.
Oh,
I
said
I
said
data.gui,
okay,
all
right,
so
it
did
install
it
cool
and
should
be
in
our
package.json.
D
B
B
D
Yeah,
so
we
got
params
here
we
go
creating
a
new
gui
all
right.
Let's
try!
Let's
just
try
a
simple
example.
Then.
D
Yeah,
it
could
be
an
index,
we
could,
let's,
let's
try
it
there
and
the
import
is.
A
D
B
D
Yeah,
that
does
that
from
that
guy
and
it
needs
to
be
in
quotes
and
lowercase.
D
This
is
a
good
I
mean
it
should,
let's
see
wherever
wherever
the
like
canvas
is
created,
we
should
be
able
to
put
it
anywhere
like
as
long
as
it.
So
this
is
oh,
this
is
the
listener
yeah.
We
don't
want
to
put
it
in
there.
This
is,
but
this
is
a
listener
for
on
on
page
load,
and
so
then
it's
once
the
page
is
loaded
yeah
actually.
C
D
Yeah
yep,
I'm
in
the
game
creator,
green
creation,
we'll
find
out
the
right
place
to
put
it,
but
I'll
put
it
on
the
on
load.
That's
fine!
So
the
example
is,
I'm
just
gonna
create
a
new
gui
and
with
a
name
my
gui.
D
C
Yeah,
so
whatever
the
problem
is
with
the
server,
it's
not
exactly
the
same
as
it
was
before,
it
actually
dies
inside
stepping
the
simulation
and
it's
cloning,
some
data,
but
it
happens
after
60
seconds
after
you
join.
C
D
B
Go
back
to
your
yeah
import.
B
B
So
if
you
look
at
post,
install
there's
a
bash
copyrex
sh
scroll
down
this.
A
A
D
B
This
is
a
super
hack
job
because,
again
we're
not
we're
not
actually
running
the
game
in
node.js,
the
game
runs
in
the
browser
we're
only
using
node.js
for
express
to
process
authentication
yeah.
So
basically,
like
should
I
hand
you
the
game,
client
browser
code,
yes
or
no.
That's
the
only
thing
we're
using
express
for
here
so
in
order
to
get
the
required
we're
using
npm
and
package
for
like
dependency
management,
but
we
still
have
to
put
the
dependencies
where
they
need
to
go.
D
D
I'm
going
to
try
that
one
first,
let's
see
so
it's
going
to
be.
If
I
have
a
way
to
copy
path,
yeah.
D
Source
root
there
we
go
all
right.
I
created
a
new
line
for
this,
so
that
this
is
actually
going
to
be
node
modules.
D
You
need
to
run
the
vm
install.
We
need
to
do
the
post
install
right,
which
will
run.
A
D
A
D
D
A
D
B
B
D
D
And
this
has
to
be
so.
This
gui
actually
has
to
be
have
be
visible
to
the
rest
of
the
game,
so
we
might
have
to
pass
this
around
inside
phaser.
I
think
it
should
be.
I
think
it
should
work
if
I,
let's
try
just
putting
it
into
the
preload
scene
and
then
see
if
we
can
pass
it
to
the
around
the
other
scenes
so
that
we
can
sure
inject
values
into
it
wherever
we
want
in
the
game,
so
in
the
preload,
let's
create
it
here.
D
All
right,
and
so
I'm
going
to
need
to
move
the
import
wherever
I
was
importing
it
in
the
game.
I
think
was
it
an
index.
It
was
an
index.
Okay,.
B
D
B
Okay,
this
is
super
easy,
yeah,
so
yeah
once
you
get
it
available
in
the
game.
D
D
D
And
where
does
the
data
all
right,
so
let
me
find
the
where
it's
coming
from
create.
Oh
there's,
the
data,
okay,
all
right
so
to.
D
D
D
B
Okay,
so,
instead
of
console
log,
what
you're
gonna
do
is
gooey
dot,
add
okay,
paren
all
right.
D
B
D
B
B
Scroll
up
up
up,
stop
down
yeah
right
there,
so
this
is
the
initia.
This
is
the
initialization
inside
phaser
of
the
phaser
sprite
group.
It
is
not
the
initialization
of
the
player's
body
object.
B
So
you
could
in
here,
if
you
really
wanted
to.
This
is
saying:
if
there's
no
physics
group
sprite
object
for
the
player
create
one.
So
you
could,
at
this
point
check,
does
player
uuid,
equal,
our
uuid
and,
if
so
then
create
the
gui
object.
B
B
B
D
B
B
B
D
B
Right
and
player.body.position
and
then
x.
A
A
D
So
why
is
it
not
updating
and
is
there
a.
B
Well,
if
you
look
at
the,
if
you
look
in
the
code,
that
player
is
part
of
a
for
each
loop.
B
D
D
D
Here
we
save
it.
D
And
then
we
use
this
as
that.
As
this
it's
worth.
B
D
And
that
it
could
be
that
the
oh,
I
probably
need
to
let
me
restart
server.
It's
dead.
D
See
if
that
it's
still
not
updating,
so
it's
adding
it,
and
it
might
just
be
it
it's
possible
that
this.
B
Right,
but
that
that
particular
instance
of
player
is
a
pointer,
so
think
think
way,
low
level
like
assembly
level
right,
so
that
instance
of
player
is
a
pointer
to
some
memory
somewhere,
and
it's
never
touched
again
because
the
next
time
you
go
through
the
loop
you're
trying
to
react.
So
this
is
the
the
other
challenge
with
doing
it
here
in
the
main
scene,
is
you're
running
this
dot
ad
every
time
through
and
I
don't
like.
I
don't
think
this
is
the
way
gui
is
designed
to
work.
D
So
the
right
so
the
the
the
the
array
of
players
in
the
model
that
is
not
ephemeral,
like
that's,
going
to
stay
all
the
time
right-
and
this
is
an
element
of
that
array.
It's
just
pointing
to
an
element
in
this
array-
okay
and
we're
basically
taking
that
and
also
assigning
that
to
the
pointing
to
that
that
same
element.
D
D
Still
stay
like
all
the
I
mean
that
should
always
stay
like,
even
if
we
put
like
just
to
prove
this
out.
Let's
just
see,
let's
see
if
this,
if
this
works,
if
we
took
this
same
field
and
and
console.logged
it
out
like
the
way
we
were
doing
it
before
in
the
update,
if
it's
the
current
player
and
just.
B
D
B
Listen
to
changes
outside
of
the
gui
add
so
in
the
add
statements,
just
append
a
dot,
listen
empty,
paren;
okay!
A
D
Yeah
we
it'd
be
great
if
it
could
just
dynamically
show
us
all
the
fields
of
the
position.
B
No,
no,
no
I'm
saying
we're
doing
this.gui
dot,
add
every
time
we
loop
over
the
player.
D
Okay,
so
so
the
the
gui
is
not
changing,
but
that
that
that
that
reference
to
the
current
player
is
changing.
D
B
D
D
The
current
player
position
body
position
x,
that's
that
that
is
dynamically,
changing
every
single
update
that,
but
when
we
do
the
add-
and
this
listen,
it's
still
just
getting
the
initial
value
and
not
updating.
B
D
B
D
C
B
D
B
B
D
D
D
Yeah,
I
will,
I
will
figure
this
out,
though.
D
D
D
Value
yeah
there's
a
set
value,
that's
what's
gonna,
try
just
setting
the
value
like
it'd,
be
nice
if
it
was
dynamic
and
just
listen
for
changes
in
the
object
like
the
documentation
says
it
does.
D
B
D
D
D
B
D
Yeah
like
position
linear
velocity
force
angle,
the
ones
that
were
you
know,
maybe
even
uuid.
C
But
right
up
until
that
point,
the
communications
are
back
and
forth
between
the
client
and
server.
No
problem.
Then,
all
of
a
sudden,
the
server
says-
hey
this
framing
here,
which
you
can't
tell
by
looking
at
the
frames
of
the
data
on
the
network
and
then
and
then
the
call
stack
comes
up.
So
it's
probably
like
there's
a
couple
of
threads
in
play
there.
So
one
of
the
threads
may
be
doing
something
bad
memory
wise,
so
I'll
take
a
little
bit
further.
A
D
B
D
B
Cool
all
right:
well,
that's
it
for
today
thanks
everyone
for
hanging
out
and
for
watching
us
hack
around
with
javascript,
I
think
we're
off
next
month
and
then
maybe
we'll
be
back
in
november.
Maybe
we'll.