Skip to content

Server

For the server, we decided to use Colyseus, which is a multiplayer framework for Node.js. It supports delta encoding out of the box, meaning that only changes to the game state are sent to the clients, which reduces bandwidth and therefore can reduce latency.

The server is responsible for managing clients and their game rooms. It shares the current game state and the level tilemap (in JSON format imported from Tiled) with the clients. It also handles client messages, such as entity updates or gravity-shift votes.

Rooms

Colyseus uses rooms to separate different game types. Each room has its own game state and can have different rules. In this project, we only have one room type, the GameRoom.

This class is the entry point for the server logic, which is handled by different managers.

Managers

Managers are responsible for handling different parts of the game logic.