# Multiplayer Server Framework

**URL:** <https://phaser.discourse.group/t/multiplayer-server-framework/12018>\
**Category:** Phaser 3\
**Created:** [July 14, 2022, 2:29pm UTC](https://phaser.discourse.group/t/multiplayer-server-framework/12018 "2022-07-14T14:29:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tastey](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@Tastey](https://phaser.discourse.group/u/Tastey)\
**Post date:** [July 14, 2022, 2:29pm UTC](https://phaser.discourse.group/t/multiplayer-server-framework/12018/1 "2022-07-14T14:29:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![201flaviosilva](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/201flaviosilva/32/5386_2.png) [@201flaviosilva](https://phaser.discourse.group/u/201flaviosilva)\
**Post date:** [July 15, 2022, 5:34pm UTC](https://phaser.discourse.group/t/multiplayer-server-framework/12018/2 "2022-07-15T17:34:51Z")

</div>

Hey,

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

- [https://www.colyseus.io/](https://www.colyseus.io/)
- [On-Premises Cross Platform Multiplayer Game Backend | Photon Engine](https://www.photonengine.com/en/server)
- [https://firebase.google.com/](https://firebase.google.com/)
- [https://www.gamesparks.com/](https://www.gamesparks.com/)

Hope I was able to help with something 😅

---

<div class="post-metadata">

**Author:** ![Tastey](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@Tastey](https://phaser.discourse.group/u/Tastey)\
**Post date:** [July 16, 2022, 9:45am UTC](https://phaser.discourse.group/t/multiplayer-server-framework/12018/3 "2022-07-16T09:45:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jhice](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/jhice/32/6391_2.png) [@jhice](https://phaser.discourse.group/u/jhice)\
**Post date:** [July 19, 2022, 7:47am UTC](https://phaser.discourse.group/t/multiplayer-server-framework/12018/4 "2022-07-19T07:47:03Z")

</div>

Hi,

There is a newcomer in this field :

> **[Hathora - Multiplayer Game Development Framework](https://www.hathora.dev/)**
>
> Hathora is a high-powered framework for developing real-time applications and multiplayer games. Prototype in minutes, scale to millions.

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

Good luck with your game !

---

<div class="post-metadata">

**Author:** ![Tastey](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@Tastey](https://phaser.discourse.group/u/Tastey)\
**Post date:** [July 19, 2022, 11:05am UTC](https://phaser.discourse.group/t/multiplayer-server-framework/12018/5 "2022-07-19T11:05:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tastey](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@Tastey](https://phaser.discourse.group/u/Tastey)\
**Post date:** [July 19, 2022, 1:26pm UTC](https://phaser.discourse.group/t/multiplayer-server-framework/12018/6 "2022-07-19T13:26:33Z")

</div>

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

> **[Modern cloud for multiplayer games](https://news.ycombinator.com/item?id=31934181)**
>
> 208 points —
> 52 comments —
> hpx7 —
> 3:46 PM - 30 Jun 2022

---

<div class="post-metadata">

**Author:** ![hpx7](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hpx7](https://phaser.discourse.group/u/hpx7)\
**Post date:** [July 19, 2022, 11:45pm UTC](https://phaser.discourse.group/t/multiplayer-server-framework/12018/7 "2022-07-19T23:45:13Z")

</div>

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](https://github.com/hathora/star-jump)

If you have any questions about Hathora or want to keep up with updates, I’d recommend joining the [discord community](https://discord.gg/6nVdeCBffR).

---

<div class="post-metadata">

**Author:** ![Antriel](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/antriel/32/15_2.png) [@Antriel](https://phaser.discourse.group/u/Antriel)\
**Post date:** [July 20, 2022, 11:36am UTC](https://phaser.discourse.group/t/multiplayer-server-framework/12018/8 "2022-07-20T11:36:43Z")

</div>

> [@Tastey](#):
>
> I wonder if I´m wrong about Node/JS being bad for game servers

- 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`.

---

<div class="post-metadata">

**Author:** ![Tastey](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@Tastey](https://phaser.discourse.group/u/Tastey)\
**Post date:** [July 21, 2022, 9:03pm UTC](https://phaser.discourse.group/t/multiplayer-server-framework/12018/9 "2022-07-21T21:03:55Z")

</div>

I did not know that, that is very interesting!
