Types
Every field in a gamehoster-schema.json declares a
type. The type fixes how the value is stored, and it guides how the client shows it between
the updates it receives: a numeric value is eased from one update to the next so motion
stays smooth, and the rest are shown as they arrive. How a field is drawn is finally the
front end's choice; this is the built-in default.
| Type | Meaning | Default display |
|---|---|---|
number | A decimal number: a position, a velocity, an angle. | eased between updates |
int | A whole number: a score, a count, a grid cell. | eased between updates |
bool | Either true or false. | shown as received |
string | Free text: a name, a square like e4, a stable id, or one of a fixed set of choices such as a phase. | shown as received |
tick | A game tick: a spawn time, the tick a shot last fired. Stored as a whole tick number and sent compactly, relative to the tick you joined on, so it stays a byte or two. | shown as received |
Notes
- The default display comes from the value, not a separate attribute: numeric fields
(
number,int) are eased between the updates the client holds, and the rest are shown as they arrive. Easing affects only what is drawn; the server's state is always exact. The front end can override this for any field, for example snapping a score rather than easing it. - Every field declares a
visibility(see Schema keys), one ofpublicorprivate. A public field (the default) is streamed to every viewer who can see the object, whenever it changes. A private field is owner-only: on a player it reaches only that player, and no one else. (Private is only meaningful on players; instances and entities have no owner.) State that no client should ever see is not a schema field at all — it lives in a server-only persistent bag, which is never streamed. - Bounded numeric fields may add range hints:
minandmaxgive the value's range, and (on anumber)decimalsgives the significant decimal places to keep. They are used to validate a field and, on the wire, to pack it to the fewest bits. Unbounded counters (a tick, a score) omit them. See Schema keys. - A numeric field on a wrap-around world may add
wrap, naming the instance field that gives the axis length (an arena width). The client then eases the value the short way round the seam, so a thing crossing the edge slides across rather than flying back the long way. - A
stringfield may fix a small set of allowed values with avalueslist (a phase, a colour). It is then sent as a compact index into that list rather than as text, and a value outside the set is rejected.