NetStack

Introduction

NetStack is a multiplayer backend for games. You get rooms, synchronized properties and server-authoritative Functions without building or operating any servers.

Your game connects to your project over WebSocket (browsers and web builds) or UDP (native engines). Players join rooms, read and write properties, and call Functions you write in the dashboard. The server decides what is allowed, so players cannot cheat by modifying the client.

What you get

  • Rooms. Players join a room by ID. Rooms are created on demand and disposed when empty.
  • Properties. Key-value state attached to a player, a room, or your whole project, synchronized in real time to the players who are allowed to see it.
  • Functions. JavaScript that runs on the server and that your game calls by name. This is where your game rules live.
  • Events. Messages that Functions broadcast to everyone in a room.
  • A subdomain per project. Every project is reachable at yourgame.netstack.network.

How it fits together

  1. Your game connects to wss://yourgame.netstack.network (or the UDP address) and joins a room.
  2. The server sends a snapshot of the room: its properties and the public properties of every player.
  3. Your game calls a Function, for example useItem, with some arguments.
  4. The Function checks the rules, changes properties and broadcasts events. Everything it changed is synchronized to the right players automatically.

Continue with the Quickstart to connect a game in a few minutes.