friendlysockon Lobsters • Recommends
What I Learned Writing a Game Server in Erlang
#erlang#gameserver#concurrency
986 subscribers • 2 videos on Hallway
Intermediate. Assumes working knowledge.
7.3K views9 years ago1 recommendation
Programming languagesGame developmentElixir and ErlangConcurrency and parallelismGame programming
QP explains how Erlang's concurrency model and unique features make it well-suited for building game servers compared to object-oriented approaches.
Captain's Intro to QP's Talk Description Ladies and gentlemen, this is your captain speaking (aka Brett). Just a quick intro to the intro here (lol). Don't be scared! There are many words that follow but I promise it'll be okay. Take a deep breath and keep reading. QP, our speaker, has provided a very detailed talk description. A bit beyond our normal 2 or 3 paragraphs. But I like it and after reading it you'll have no doubt whether this talk is for you. So I'm leaving it intact. Without further ado. QP's Talk Description (Detailed Mode Enabled) I chose Erlang to port a board game design to the web. I'll start with a quick overview of the Erlang programming language - how it differs from other languages and a shortlist of successful projects in Erlang. From that I'll show why object-oriented game development sucks and how Erlang's unique features can mitigate that pain. I'll guide you through the mental shift from viewing programming as imitating objects or describing behavior to the core of functional programming: data transformation. I'll start with the core data transformations in my game and show you how Erlang's unique pattern matching syntax gets you writing code that matters instantly without needing boilerplate. I'll show how even without typical Classes and Objects, Erlang modules and pattern matching can be used to build your app from the inside out. Once the core logic is covered I'll take us on a wild west tour of Cowboy, the Erlang webserver of choice. I'll show you how to start a hello world project - because the web documentation is outdated. I'll cover the frustration of using make and the switch to gmake and briefly glance at the monolithic 6800 line dependency that makes this all work. Next I'll show you how to write custom route handlers and compare three ways of reading parameters from web requests - binaries, strings & atoms. You'll see how using named processes work like "Controllers" in Model-View-Controller and how to filter data coming from your processes to return to the user. The sad state of JSON parsing will be addressed, followed by a tutorial in how to install a JSON parser and a frustrated rethinking of who needs JSON anyway and how Erlang Tuples are a better data store. I'll conclude with a demo of the game in browser and a brief foray into an attempt a functional-programming inspired game engine in Javascript for clientside behavior. Source code will be available. Bio QP started programming games over 20 years ago in BASIC. He worked overseas as a game designer for 2 years and programmed mobile and backend for 8. He currently freelances and develops board & video games for fun.What people say. Recommended as a practical introduction to using Erlang for game backend development.
friendlysockon Lobsters • Recommends