The road file
road.json describes the ground the ride runs on: the route, its lanes, and the fields beside it. The
tables below list every key of its schema, with its type, its default and its meaning. The site reads them from
the schema file when it builds.
The road of a moveby page: its route, its lanes and its fields. This schema holds the rules of shape. The reader (packages/moveby-build/src/road.ts) adds the rules a schema cannot say, each with its own code.
{
"version": 1,
"route": {
"segments": [
{ "length": 120 },
{ "length": 60, "turn": 45 },
{ "length": 150, "rise": 6 },
{ "length": 80, "turn": -90, "rise": -2 },
{ "length": 200 }
]
},
"lanes": [
{ "from": 0, "count": 2, "color": "#ffd400" },
{ "from": 180, "count": 3, "divider": "solid" },
{ "from": 400, "count": 2, "dash": [2, 6] }
],
"fields": {
"tiles": { "grass": 0, "sand": 1, "rock": 3 },
"along": [
{ "from": 0, "left": "grass", "right": "grass" },
{ "from": 250, "right": "sand" },
{ "from": 450, "right": "rock" }
]
}
}The Quick Start walks through this file.
turn counts clockwise, seen from above. A positive turn goes right. A negative turn goes left.
moveby road
The road of a moveby page: its route, its lanes and its fields. This schema holds the rules of shape. The reader (packages/moveby-build/src/road.ts) adds the rules a schema cannot say, each with its own code.
| Key | Type | Default | Means |
|---|---|---|---|
$schema | string | — | — |
versionrequired | integer = 1 | — | — |
routerequired | route | — | One form only: `segments` (length, turn, rise) or `gps` (lat, lng, height). The reader gives ROUTE_FORM when a file has both or neither. |
lanes | lanes | — | The lane change list. Each entry runs from its `from` to the next entry's `from`; the last entry runs to the route's end. A `from` is metres along the route. |
fields | fields | — | The ground beside the road. `tiles` names the tiles of the field atlas by their cell. `along` is the field change list. The grid of the atlas is not here: it lives in atlas.json. |
route
One form only: `segments` (length, turn, rise) or `gps` (lat, lng, height). The reader gives ROUTE_FORM when a file has both or neither.
| Key | Type | Default | Means |
|---|---|---|---|
segments | array of segment | — | — |
gps | array of point | — | — |
segment
One road segment. `length` in metres, at least 0.01 (the track file holds centimetres). Every metre value is at most 10 000 km: the track file holds it as a 32-bit count of centimetres. `turn` in degrees over the segment, positive clockwise (a right turn). `rise` in metres.
| Key | Type | Default | Means |
|---|---|---|---|
lengthrequired | number, 0.01 to 10000000 | — | — |
turn | number, -360 to 360 | 0 | — |
rise | number, -10000000 to 10000000 | 0 | — |
point
One GPS point. `height` in metres. The reader gives ROUTE_HEIGHT when some points have a height and some do not.
| Key | Type | Default | Means |
|---|---|---|---|
latrequired | number, -90 to 90 | — | — |
lngrequired | number, -180 to 180 | — | — |
height | number, -10000000 to 10000000 | — | — |
laneEntry
One lane change. `count` is the number of lanes (default 2). An entry with the defaults alone (2 lanes, dashed, white, 3/9) closes the lanes here: the road is the default from `from` on, and the entry writes no lane span.
| Key | Type | Default | Means |
|---|---|---|---|
fromrequired | number, at least 0 | — | — |
count | integer, 1 to 8 | 2 | — |
divider | "dashed" | "solid" | "double" | "dashed" | — |
color | string, matches ^#[0-9a-fA-F]{6}$ | "#ffffff" | The divider's colour, #rrggbb. |
dash | dash | [3,9] | The painted and the gap length of a dashed divider, in metres. The engine carries it for every divider; it draws it for a dashed one only. |
fields
The ground beside the road. `tiles` names the tiles of the field atlas by their cell. `along` is the field change list. The grid of the atlas is not here: it lives in atlas.json.
| Key | Type | Default | Means |
|---|---|---|---|
tilesrequired | object of integer, 0 to 65535 | — | — |
alongrequired | array of alongEntry | — | — |
alongEntry
One field change. An entry names the sides that change: a side it does not name keeps its span, a side it names with null has no field from `from` on. A named side's span runs from `from` to the next entry that names that side, or to the route's end.
| Key | Type | Default | Means |
|---|---|---|---|
fromrequired | number, at least 0 | — | — |
left | tile | — | A tile of `fields.tiles`, or null: no field on that side. |
right | tile | — | A tile of `fields.tiles`, or null: no field on that side. |