This project is a fork of the popular Colyseus project TOSIOS by halftheopposite. It serves as a demonstration for integrating a serverless hosting offerring (in this case, Hathora Cloud) with the Colyseus multiplayer framework.
You can view the integration code diff here. The key difference is that in the Hathora Cloud version, server instances are created and destroyed on demand rather than having a fixed set of server instances running 24/7. There are three main benefits with this approach:
- Scale: every time a player creates a room, a new server instance is dynamically provisioned in Hathora Cloud (it takes ~5s for a server instance to boot). Each server instance has a unique host+port for connecting. This ensures that even if many thousands of rooms are requested by players at the same time, you'll never run out of server capacity.
- Cost: the serverless model means that you only pay for the resources you use. Instead of paying for the server 24/7, you only pay for the duration of active game sessions.
- Performance: Rather than running your servers in a single region, the server placement is automatically chosen to be the closest Hathora region to the player who creates the room. This lets you deliver a good gameplay experience to players around the world.
You can try out a live deployment of this project at https://tosios-hathora.surge.sh.
Desktop version
Mobile version
Want to play right away? You can play the game by following (and sharing) this link https://tosios.online/ (or https://tosios-demo.herokuapp.com/).
Rules
The game principles are fairly easy to grasp:
- Every player is positionned randomly on the map during the
lobby
. - When the
game
starts, each player must take down others (either in death match, or team death match). - There are some
potions
on the map that restore health. - The last player (or team) alive wins 🎉.
You can see a very small amount of gameplay below (the framerate of this GIF is low):
Movements
- Move: W A S D or ↑ ← ↓ →.
- Aim: Mouse
- Shoot: Left click or Space