Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hajis23/room-game

Multiplayer server meshing demo
https://github.com/hajis23/room-game

game matter-js multiplayer phaser react socket-io websocket

Last synced: about 2 hours ago
JSON representation

Multiplayer server meshing demo

Awesome Lists containing this project

README

        

# Room game
![hajis](https://github.com/user-attachments/assets/d3279a3d-7fbe-4875-afa8-beec1eb03e16)

A prototype of a multi-server real-time online multiplayer game, implementing:
- simple Server Meshing / Spatial partitioning between server nodes.
- Object replication between nodes
- Object transfer between nodes
- Server-authoritative physics with simple client-side prediction
- Server node discovery & coordination with a master node

We built it as a course project for the University of Helsinki Distributed Systems 2023 course.

The server nodes are based on NodeJS, run inside docker containers and communicate with the client and other server nodes via [socket.io](https://socket.io/).

The game client is created using [Phaser 3](https://github.com/photonstorm/phaser) with a [React](https://react.dev/) user interface.

The game features a simple dungeon-like map consisting of multiple rooms, created using Tiled. The players can freely move around the map and interact with other players (only by colliding with them). The rooms are simulated on separate servers and the player can seamlessly walk from one server to another.

## Setup

Make sure you have docker and npm installed.

To install all dependencies run following command:
```
npm install
```

## Run

Run the Vite development server:
```
npm run client
```
The dev build is served at localhost:8000.

Run coordinator and 3 room servers with:
```
npm run room_server
```
This builds the required docker images and runs the compose file `room_server/docker-compose.yml`.

If you still come accross any `module not found`-errors, try running `npm install` locally in `room_server/` or `coordinator/`.