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/
Contents
The game folder holds one config file and four folders, one for each kind of thing in the game.
| Name | Type | Description |
|---|---|---|
gamehoster-game.json | file | The whole game config. |
gamehoster-player/ | directory | The player: schemas, lifecycle, ship step, relevance. |
gamehoster-instance/ | directory | The instance: state schema and the authoritative update. |
gamehoster-commands/ | directory | The aim and thrust commands. |
gamehoster-entities/ | directory | The 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
}