GopherCon 2014

Desarrollando y depurando con Go un juego online multijugador

Stephen McQuay, Fraser Graham  · 
go

Presentación

PDF (pincha para descargar)

Vídeo

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

okay so we're gonna talk a little bit by why killer robots are a concurrency problem and we're not like the guys after lunch these are not real robots so I'm gonna start with a story um by a year ago Stephen said to me I'm learning go yeah

so my backgrounds video games console video games had heard of go I knew its existence and you a little bit about it but and you almost nothing oh that's cool he's learning go and then he said to me something that a lot of people ask well ask me about

talk to me about cuz I've been in the game industry a long time he said I always wanted to write a game so that's cool yeah lots people like writing games and then then he dropped the bombshell he said I want to write a gaming goal we should rather

give you coke which spawned an instant negative reaction from me I said that that's that's absurd I come from console being game background we're at console games in C and C++ that's that's how you write console games no one writes games

and go that's absolutely crazy talk we have this real historical world view of of how games are made and it doesn't it doesn't really quite doubt the go is firmly in that not games category very biased worldview and kind of led me to pigeonhole

the language a little bit and so I I said to him something pretty retrospect a little bit silly assets like Java no one's made a successful game in Java right so I started throwing a whole bunch of like questions at him I said dad I wanted to know about

all the different bits and pieces of go that I just assumed wouldn't fit for making video games I was like does it have good math libraries I don't know I've good physics library that I'm Persian pretty sure doesn't I was pretty sure pretty

confident in my historically based opinions the goal was pretty terrible all of these things that we would need to make a game OpenGL bindings and to be fair Steven came back with pretty decent answers on a lot of these things he used you know there were young

implementations it's a new language these things do exist I'm somewhat linear infancy is their GUI their input management can we hook up a gamepad can we do stuff like that and then I this back and forth whether I would challenge his belief that he

could build a gaming goal and he would you know try and argue for it and then I fell into his trap and I said to him well concurrency is a hard problem in games disgorging currency so then we decided to make a game and we had to get a few constraints out of

the way first so Steven and I both have full-time jobs that are not related to writing games and go and so we wanted to you know do something simple do something that was fun that we could do in our spare time but what should that be so according to my three-year-old

son robots are cool so that got me thinking about a game that I played back in 1996 when I was in college and a friend of mine made it it was a game about robots it was a game very much geared towards programmers and the game looked like this there were dots

and there were smaller dots it ran in dots and you wrote little pseudo assembly code to program your robots and you loaded up all your robots into into this executable and they fought they just battled it out until last man standing and I thought to myself

I remember loving that game I thought I was a lot of fun now I wondered what that game would look like modern day and modern technologies so I suggested this to Steven and he liked the idea I had took me a while to convince him not to make a Zelda clone but

we say they'll done on robots and so 2014 we make this game obviously it's gonna be web-based because you know be fun fun little side project we know how to write stuff on the web if we're gonna make robots we have to have some sort of WebGL visualization

and they're obviously going to talk over WebSockets because let's throw as many modern like buzzword D terms as we can at this little project and we're gonna need a server and it started looking more and more like this is exactly where we should

focus our efforts and build something cool and go so what did we build well still in its infancy but this is kind of a a a basic visualization of what we've got this is the the modern version of that of dots and smaller dots you've got a game server

written in go and then we've got a protocol that you can talk to the game server which is basically your robot gets a JSON blob of world state as it knows what it knows about the world and it sends back instructions and the game server runs its little

simulation and it sends back world state you write your robots in pretty much anything we've got a web interface that lets you write JavaScript robots yeah we have some robots implemented themselves and go and you can you know set your robots properties

[ ... ]

Nota: se han omitido las otras 2.341 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.