[MUSIC PLAYING]
MARK MANDEL: Hello, everyone.
My name is Mark Mandel.
I am a Developer Advocate for Google Cloud Platform.
And I'm here today to build a multiplayer backend
in four minutes and 51 seconds, sounds like fun?
Cool.
So this very silly game that I decided to make--
you can clearly see, I am not an artist--
is called paddle soccer.
It's a two player multiplayer game, where you're a paddle
and you play soccer.
It's pretty simple stuff.
It has a unity client.
It has a dedicated unity server.
It has some matchmaking code.
And it also has some code that controls the dedicated game
servers, spinning up and spinning down,
across a cluster in the cloud.
So how am I able to do that inside five minutes or three
minutes or so, anyway?
The cool thing that we have-- what I talk about a lot
and what gets me really excited, is a thing
called software containers.
People here are familiar with something called Docker?
And some other things like that?
Cool.
So this is particularly exciting to me,
because the thing that software containers do,
is enable us to have a standardization around software
and how we run it.
So regardless of whether we're running multiplayer systems
or [INAUDIBLE] like matchmaking systems,
or dedicated game servers, we can
make software look relatively the same regardless of like,
how we want to deploy it, how we want to scale it,
whether we want a health check, log
aggregation, stuff like that.
That means we can build sort of generalized solutions
for these kinds of problems that can
be deployed to almost any type of software type of problem.
Kubernetes is an open source container orchestration system
that came out of Google for doing
exactly these types of things--
deployments, scaling, logging, all that kind of stuff.
We have a hosted solution at Google Cloud called Container
Engine, but it's also open source and can be run anywhere.
So, without further due, let's actually get stuck into a demo.
Sweet, you've switched me across?
Perfect.
Excellent.
So I've got a visualization here.
What I'm going to do here is get my matchmaker up and running.
I've got some make commands.
I'm going to actually deploy in front of people, sweet.
So I'll send these yaml files up to Kubernetes.
And we have a visualization on top
that shows us the containers that we're going to be running.
The first thing I'm going to get is Kubernetes up and running.
It's going to go a little bit to come up.
Kubernetes.
No, that's not going to work.
For whatever reason it doesn't like me.
That's fine, it's demo.
It's in front of a lot of people-- there we go,
there's my read assistance.
Beautiful.
Scrolling.
Of course that's tiny, why not--
because demos in front of loads of people always go right,
that's fine.
That's fine.
We will deploy-- what I'm doing now is sending up a bunch
of other yaml files, the declarative syntax are going
to create a--
five more containers that are going to fire up for us,
it's going to be a few there.
So we're going to run this across a series of machines
that we have running inside a cluster.
Now, we also-- you're not going to see it here,
but I'm going to deploy a thing called a service
that then exposes those matchmaker
clients that are running.
Weavescope's quite nice in that it will actually show us
the network activity that is happening
between those machines.
And we have now a matchmaking system,
we have that up and running.
That's really cool.
What I'm also going to do is deploy the code that--
the code that organizes and structures the
dedicated game servers that are running too.
I'm basically doing exactly the same thing.
But the cool thing about this here,
is that this is like 400, 500 lines of code, right?
This isn't a lot of work that I've
had to do to organize and orchestrate dedicated game
servers across a cluster of-- well,
for me it's three machines, but it could
be up to like 2,000 machines.
This is a lot of work that I haven't had to do myself,
and it's hugely, hugely powerful the amount of stuff
I can get to have happen.
So cool, now that's my dedicated game server orchestration
system, I call it sessions, for fun.
That's all up and running.
So if I go and say [? qttl ?] I want to get the IP address.
Of course it's pending, for two secs.
So I need to get the IP address of the matchmaking system
as it comes up, so that I can actually run my game.
There we go, perfect.
So there we go.
There's my IP address.
If I come over here, I have my client ready to go.
I'm going to run my game and tell it
where it is that my game server is running at, which is there.
So we'll still fire that up, standard unity little window.
Perfect.
Of course it's going to run full screen, because why not.
I'm going to send that to another window.
We'll do the same thing again.
That's fine.
That'll connect.
So what should happen here is now my matchmaking service
is going to say, cool.
I've now got two machines that are ready to go.
I get one.
I get a ball that bounces, yay.
So we have two players that are able to play this game.
I flick across, you can see--
yay with the game.
Perfect.
Wonderful.
All right, so-- if this all sounds
interesting we'll be talking about this more,
Wednesday, 9:30 a.m. at our sponsored session,
dedicated game server scaling.
We'll also talk about big data and analytics.
If you can't get to that, I'm @neurotic on Twitter.
I'll definitely be around.
You can also get this code at Mark Mandel
slash paddle soccer on GitHub.
Or feel free to reach out to me and I'll point you
in the right direction.
Finally, thank you very much for having me.
[MUSIC PLAYING]