Bootstrapping a multiplayer server with Elixir
Published in 2021, this chronicle by @thibaut_barrere details the mechanics of building a profitable, self-funded business without venture backing.
The community focused on B2B customer acquisition channels, cold email vs SEO distribution, and balancing full-time employment with side-project development.
Building a gameserver in Elixir is not great imo, performance is subpar. I work in online games and no one would want to use that language.
I guess they have low constrains since they only need to support 10000 players at a time and they want a single instance for that.
- Erlang runtime is slow
- Memory consumption is high
- GC is not very good ( vs Java / C# / Go )
- high cost in term of performance because of immutability
It's not the kind of things you want for a game.
To give you some perspective on popular FPS games, they run between 30hz and 120hz with up to 64 players and usually only use a single CPU core. And they're doing gameplay simulation / state replication / physics sometimes AI etc ...
Also it must be pretty painful to not re-use their C++ client code on the server side, they have to re-implement twice? ( this concern is actually higher than the performance one )
Overall I think it's an impressive achievement to be able to do that for a single person in 6 month!
This is the kind of thing that I love about Elixir. As great as Phoenix is, realistically you are going to be equally productive in any web framework. Elixir is my favorite language because it gives you primitives that perfectly suit your needs for just about anything running on a socket, especially once you add in Plug.
Throwing together a prototype is instant, but the awesome part is how quickly you can turn that prototype into something useful. More concurrency? Done. Need to sock away some state somewhere you can easily find and deal with it? Easy. It's easy to write, easy to reason about, and gives you fantastic composable tools to put something great together. It doesn't feel like a codebase so much as an incredibly well managed and cohesive OS.
Hey folks, I’m Tyler! I’m the guy who did the original work on this. I’m happy to answer any questions!
You might also be interested in the discussion happening on the associated Twitter thread: https://twitter.com/elixirlang/status/1420782381825503240 ↗
Is there any open source implementations of game servers/highly concurrent production servers like this for reference (or at least blog posts that contain a good amount of code)? I can find a lot of toy examples, but I'd love to see some insight onto an actual implementation of a product that is open-source as I'm learning Elixir.
Elexir might be a nice language, but you could probably also implement the server using socat... That said, scaling to tens of thousands of concurrent players is like the holy grail, especially if you want to shoot stuff and there need to be hit detection, and safe from client modifications/hacks.
Favorite quote:
"this article explores why they chose Elixir and how a team of one developer - without prior language experience - learned the language and deployed a well-received multiplayer experience in 6 months."