Is Elixir suited for a performance game server?

I think they are, not because the type of game, but the number of players connected simultaneously, since those kind of games have a multiple servers available and limited to X number of players. Riot blogs about its infrastructure and other things, so their engineering blog should be a very valuable resource for you: https://technology.riotgames.com/. Let me highlight a piece of this article:

We write Riot chat servers primarily in Erlang (check out this video if you’re curious about the language), although we use C for bindings to certain lower-level operations such as XML parsing, SSL handling, and string manipulation. 10% of our chat server codebase is written in C while 90% is pure Erlang (ignoring external libraries and the Erlang VM itself).

Replace Erlang by Elixir and you have a nice use-case for using it in a professional game, they also use Electron as its GUI client. The key takeaway here is “use the right tool for the job”, a complete game like WoW, LoL, CS… requires a stack of many technologies playing together, for example:

Game: C / C++ / Rust / C# / Java
Game server: C / C++ / Rust
AI: Lua / Python / JavaScript
Chat system: Elixir / Erlang
GUI client: Electron / C# / Java

Of course some parts are redundant, for simple games you implement multiple things with the same language, this is just to illustrate a very complex and professional stack, and it’s not viable to do something like this alone. However when it comes to experimenting, prototypes and so on, you can ignore the initial step of valuating technologies in search of the best performance, sometimes the initial result is better than you would expect.

This is not about gaming but online servers, an interesting article of how Figma started with a pure TypeScript stack before migrating to Rust: How Mozilla’s Rust dramatically improved our server-side performance | Figma Blog.

The multiplayer server we launched with two years ago is written in TypeScript and has served us surprisingly well, but Figma is rapidly growing more popular and that server isn’t going to be able to keep up. We decided to fix this by rewriting it in Rust.

As you can see, the initial implementation were not that bad, and it was pure JavaScript at the end of the day, something like Elixir should have played better than this.

2 Likes