Game

The top-level files describe the whole of Asteroids rather than any one player, instance or entity. Asteroids has a single top-level file, its config; everything the game does lives in the four folders below. When the game is synced the server also writes two generated bundles beside these, gamehoster.server.js and gamehoster.client.js, built from the files in those folders.

<gamehoster-config-contentRoot>/
  game.gamehoster.org/
    gamehoster-games/
      asteroids/
        gamehoster-game.json
        gamehoster-player/
        gamehoster-instance/
        gamehoster-commands/
        gamehoster-entities/
The asteroids game folder: its config and the four component folders.

Contents

The game folder holds one config file and four folders, one for each kind of thing in the game.

NameTypeDescription
gamehoster-game.jsonfileThe whole game config.
gamehoster-player/directoryThe player: schemas, lifecycle, ship step, relevance.
gamehoster-instance/directoryThe instance: state schema and the authoritative update.
gamehoster-commands/directoryThe aim and thrust commands.
gamehoster-entities/directoryThe ballistic rock and bullet.

gamehoster-game.json

The whole config: the title, that players are dropped straight in with no browse or create, the 30 per second simulation rate and 15 per second send rate, up to 50 players in one arena, the 5 per second rate the bot brains run at, one warm arena kept alive at all times so the game is always running, and the two bot-padding fields that hold up to five bots when a lone player is flying and ease to zero at twenty players.

{
  "gamehoster-game-title": "Asteroids",
  "gamehoster-game-browse": "none",
  "gamehoster-game-create": "none",
  "gamehoster-game-tickRate": 30,
  "gamehoster-game-sendRate": 15,
  "gamehoster-game-capacity": 50,
  "gamehoster-game-botRate": 5,
  "gamehoster-game-warmInstances": 1,
  "gamehoster-game-botsMax": 5,
  "gamehoster-game-botsZeroAt": 20
}
asteroids/gamehoster-game.json