Skysoft13

Skysoft13

I have an idea for a mobile game app, I want to use elixir for backend, how is the elixir performance for game backend, any idea?

Showing Posts 1 to 10

greven

greven

Elixir is a great fit for a game server, if you did come to find some bottlenecks there is always space to optimize performance by using a NIF (Rust with Rustler, etc), but that would only be the case if CPU bound tasks would come into play.

But to answer correctly it really depends on what you are doing on that game server, If it would be taxing on the CPU maybe a better solution could be found on a lower level language.

You can find a good discussion about the same topic here: Is Elixir suited for a performance game server?

Rustixir

Rustixir

Elixir is great for backend of games
When that game is multiplayer .
Or need Process players data and communicate between them .

Like Chess,

But you enjoy from Elixir performance when you write a game like GTA Online.

My mean is you have 1K / 100K / 1M players
they can be play over your servers and very simple share information without think about which player exist on which server .

If you need write many rule based logic or handling level of each player or some low cost processing Just use Elixir and forget NIF ( using aother language with Elixir )

If you need some heavy algorithm processed inside your server instead of mobile/Xbox/Ps4
then your work is harder.

I wrote a Rule based game engine that need to much share info between players. In Erlang ( that is brother of Elixir :grin: ) works great.

My suggest :

  1. Use ETS to much ( storage in-memory )

  2. Use Mnesia to much ( storage in-memory + persistent + Distributed )

  3. For implementing Room/Channel if you
    need, use pg module or phoenix pubsub

Good luck my friend

kartheek

kartheek

Game Backend Servers are different from Game Servers when it comes to gaming domain:

  • Game Backend Servers: infra services like auth, storage, economy, etc
  • Game Servers: multiplayer servers handle player presence and sync data between clients like mobile apps, web pages, etc.

Game Backend Servers you can build in Elixir/Erlang. When it comes to Game Servers the answer is a little bit complicated.

There are different genres of games like FPS, RPG, MMORPG, Casual, Turn based, etc and each one has a different latency requirement. First person shooter (FPS) games need a very low network latency (in milliseconds). Turn based games on the other hand can have higher network latency like a second or two.

Most of the game engines like Unity have multiplayer frameworks like Mirror, DarkRift, Unet, etc. There are different client server architectures in game networking like authoritative, relay, etc.

Process of building a multiplayer game server using networking libraries like mirror on Unity, etc is completely different from regular servers. Take an example of building an authoritative multiplayer game in Unity using Mirror:

  • Few Mirror framework callbacks relating to game functionality need to be implemented for Server and Client in C# classes. Callbacks for client and server are colocated in C# classes - like client code and server code are in same file but with annotations that it is server code and this is client code.
  • Select a transport which is most suitable for the game - tcp or udp based.
  • Two builds can be generated from Unity Editor a game client build (which can be android app or iOS app) and a headless server build.
  • A headless server build is generated using Unity Editor. This headless server build contains everything except graphics. This is no different from a unity game client (iOS/Android) - Unity runtime manages everything.
  • For every game session, a new instance of headless game server is spawned. This instance is killed when the game is over.

For games with low latency requirements like FPS, MMORPG - Elixir/Erlang runtime is more suitable to build relay servers(not authoritative servers) which fan out the incoming messages. One of the client acts as Server and it will makes all decisions relating to the game. Other clients contain approximations relating to game data until state is synced by Client Server(client which is acting as server). Relay is used as medium to sync data between Client Server and clients. Physics simulations, transforms, lag compensations are very difficult to implement in Elixir/Erlang for lack of libraries and a way to import game environment( OBJ files like models, meshes, etc) into the Elixir/Erlang world. There is no point in reinventing the wheel - there are many mature networking libraries which handle these scenarios. Even if some one wants to use Elixir/Erlang for relay servers - they have to implement a custom relay transport in the networking libraries like Mirror.

In case of turn based casual games like card games, board games, bingo, battleship, chess, etc - Elixir/Erlang runtimes can be used to build Game Servers. Phoenix Channels + GenServer + Postgres using Ecto will be enough to implement a turn based game server.

What are you looking to build Game Server or Game Backend Server? What genre is your game? What are the latency requirements ?

23
Post #3
Skysoft13

Skysoft13 OP

tnx so much :slight_smile:

Skysoft13

Skysoft13 OP

tnx I get it :slight_smile:

Skysoft13

Skysoft13 OP

I have a planing to develop mobile game app like soccer online, but simple app, I get it, but I do not know which game engine I can use for it?

Rustixir

Rustixir

Unity is best and simple for mobile app.

and also Call of duty use Erlang/Elixir for whole backend

Rustixir

Rustixir

If you need drawing great player face ( 3D ) maybe need to ZBrush and may need other tool/software if you want great textures for teams shirt

Skysoft13

Skysoft13 OP

I guess ZBrush not a game engine right?

Rustixir

Rustixir

Yes . ZBrush is a tool/software for Drawing great 3D object

And often all charactor designer use it
For drawing Face

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews