Pondo

Pondo

Is Elixir suited for a performance game server?

Hello to you

I create a private server for World of warcraft, is Elixir a powerful enough language for this kind of project?

Most Liked

rvirding

rvirding

Creator of Erlang

You might checkout the Battlestar Galactica Online game which is written in Erlang. At this level of discussion Erlang and Elixir are equivalent. It definitely shows that implementing a game in Erlang is definitely feasible to do.

yawaramin

yawaramin

I’m not familiar with World of Warcraft servers, can you explain a bit more what kind of server this is? What does it do mostly? What kind of traffic are you expecting? I/O bound or CPU bound? Etc.

Cochonours

Cochonours

game servers don’t perform a lot of computation usually. Most of the time it’s about receiving new coordinates and sending that data to the other players in the same zone, send data about the movement of fauna and NPC (and this could be computed on the client as well if we just send the paths they are supposed to take), and less often sending info about other actions like fighting and etc. Aside from message passing, it stores every meaningful actions in logs/DB/whatever and that’s it, so the computation can really be minimal (depending on the game most things could be done on the clients, with the server only arbitering the results).

The server has to check the players are not cheating of course, but that can be done in another program which analyses the logs output by the elixir server. Or at least that’s how I would do it, except for really important stuff related to money which would be computed on the main server.

adrianrl

adrianrl

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.

Where Next?

Popular in Questions Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
New
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

Other popular topics Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New

We're in Beta

About us Mission Statement