Usage
A game on Gamehoster has two halves, both built from one game definition folder. You stand up a server once, then run a local sync tool that pushes your game folders up to it. The server turns each folder into a live authoritative WebSocket API, the backend, and generates a client library you build your frontend against. You author the definition under a domain folder as a game, and upgrade it live as your game grows.
game.gamehoster.org/
pong/
gamehoster-game.json
gamehoster-game-startup.js
gamehoster-player/
gamehoster-player-join-schema.json
gamehoster-player-join.js
gamehoster-player-schema.json
gamehoster-player-leave.js
gamehoster-player-update.js
gamehoster-player-predict.js
gamehoster-instance/
gamehoster-instance-schema.json
gamehoster-instance-update.js
gamehoster-commands/
gamehoster-entities/
The hard part of realtime multiplayer is keeping an authoritative server and every client agreeing with each other. Because Gamehoster generates the server and its client from the same folder, they can't drift: write the game once, and the networking (rooms, presence, per-viewer state deltas, and the interpolation that keeps motion smooth between packets) is handled for you.
Contents
Server →
Stand up the realtime host once on a Linux box. It turns each game folder into a live authoritative WebSocket API.
Local →
Run the local sync tool on your own machine to push your game folders up to the server, configured by one small JSON file.
Domains →
One folder per domain, named for the game-server subdomain it answers on, holding a
gamehoster-games/ folder of your games.
Games →
The game definition the server runs: the folder describing a game (config, instances, players and entities) that becomes an authoritative WebSocket API.
Frontend →
Building your front end with the generated client library: browse and join, subscribe to state and render frames, and send input and commands back.
Upgrading →
Ship changes to a live game without disrupting matches already in progress, from a small tweak to a bigger migration.
Examples
Complete games you can read end to end, each just a folder you could drop onto your own server. Browse them all in Examples.
Pointing →
The smallest possible game: drop into a shared instance and watch each other's cursors move in realtime.
Pong →
Pairs players together and starts a match as soon as two are waiting.
Chess →
ELO matchmaking that widens as you wait, both players accepting, turn-based play with a clock on each side.
Snake →
Straight into a realtime instance with many players; new instances spin up as the existing ones fill.
Asteroids →
Fifty players on a scrolling, wrap-around arena, with per-viewer relevance so you're sent only what's in view.