Multiplayer Server Framework

I´m working on a racing game, and it´s time to start looking at online multiplayer.

I´ve been doing some research, and it seems that most (all?) Phaser online games use Node in some way or another.

Is this the only way to do it?

It seems like Node and JS is a bad choice for a game server, and being single threaded it will probably struggle to serve many users running their seperate sessions.

Does anone have some experience or knowledge about working with Phaser and other server technologies than Node?

Hey,

I know there are some frameworks, but I’ve never used any:

Hope I was able to help with something :sweat_smile:

Thank you, Photon Engine sounds promising if it can be integrated with Phaser! I´ll have to do some more research on that one.

Hi,

There is a newcomer in this field :

It looks quite easy to use (perhaps it’s Node-based)

Good luck with your game !

Yep, it´s node based!

I wonder if I´m wrong about Node/JS being bad for game servers, seeing that there are a whole bunch of different frameworks for it.

Or maybe they pop up like mushrooms because Node is the only backend 95 % of self taught developers know… Even if it is scalable it doesn´t mean it´s effective, and you might spend a lot more money on server power than you would have with a multi threaded language.

Either way I realised it will be very difficult to make an authoritative server using anything else than javascript, since I would have to re-create my game logic and physics in another language, so I will probably be taking the Node-route after all.

1 Like

Here is an interesting thread with comments from both the developers and users of Hathora if anyone is interested:

Hi there, I work on the Hathora framework and was glad to see it mentioned here!

A number of multiplayer games have been built using Phaser and Hathora, and we think the technologies go well together. Even though node is single threaded, node processes are relatively lightweight and Hathora makes it easy to scale horizontally by adding multiple processes.

I’m actually currently working on making a tutorial on how to make a 2D multiplayer platformer on Hathora using Phaser on the client + server side. If you want a sneak peak and read some code, the tutorial is going to be based on this game that I made for a gamejam: GitHub - hathora/star-jump

If you have any questions about Hathora or want to keep up with updates, I’d recommend joining the discord community.

1 Like
  • NodeJS uses V8 to execute JS (same as chromium browsers). It’s very fast JIT based engine that can produce code very close to C/C++ speeds.
  • Putting aside that actually writing multithreaded code is quite difficult, you can do multithreading in NodeJS using Web Workers. Even real multithreading with shared memory by using SharedArrayBuffer.
1 Like

I did not know that, that is very interesting!