Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The match

How a match runs once play has begun, apart from the field: its clock, holds, its end, and players leaving and coming back.

The clock

A server states how long the match has run with ClockSync, and a client answers on the clock channel with ClockReply. Time says how the match clock is kept, and which clock each time on the wire is measured against.

GameSpeed sets how fast the match runs. StatTick hands every unit a span of seconds.

In 0.8.13.26–0.9.22.13

StatTick asks every unit’s stats to advance by that span.

In 0.9.25.24–1.0.0.24

A client shows the speed GameSpeed sets over its champion. A client changes nothing it shows for StatTick.

In 0.9.25.24–1.0.0.24

The speed GameSpeed sets takes effect at once: sent during a hold, it ends the hold, and a Resumed after it changes nothing.

In 0.9.25.24–0.9.25.35

No unit advances for StatTick.

Holding and resuming

A client asks to hold the match with Pause, and to resume it with Resume. A server MUST attribute each to the connection it arrived on (see Objects and identifiers).

A server holds the match with Paused.

In 0.9.25.24–1.0.0.24

A client reads nothing from Paused. It stops the match clock where the clock is running, keeping the speed it had, and shows nothing.

A server ends the hold with Resumed.

In 0.9.25.24–1.0.0.24

A client reads nothing from Resumed. Where the match is held, it goes on at once at the speed it had, with no countdown and no announcement.

The end

A server ends the match with GameEnded, saying which side won, and takes the interface down with HudDisabled. A client shows the win or loss for its player’s side and sends ClientFinished.

A client sends ClientFinished every time GameEnded arrives in play, while playing a replay too.

In 0.8.13.26–0.9.25.35

A client that receives GameEnded while still loading takes it as in play: it records the result and sends ClientFinished.

VictoryDance sets units moving as winners or losers do. It ends nothing.

Leaving and coming back

A client leaving as one abandoning the match sends Exit: as its player quits or closes the window, as a reconnection fails, or on a server’s Shutdown, which has it leave at once. A client also leaves at once on BotKick with the action that means leave.

In 0.9.25.24–1.0.0.24

A client also leaves as one abandoning as its player declines to reconnect or cancels a reconnection under way, and as its player dismisses the notice that it was dropped for being away.

A server tells the others that a player’s client dropped with PlayerDisconnected.

In 0.9.25.24–1.0.0.24

A client shows a notice in chat for PlayerDisconnected.

SoftReconnect rebuilds a client’s world without a new connection, as Objects and identifiers describes.

In 0.8.13.26–0.9.22.13

A client whose connection drops, while loading or in play, shows its player that it was disconnected, and neither connects again nor leaves.

In 0.9.25.24–1.0.0.24

A client started again for a match in progress knows nothing of it, and joins as at the start: a server takes it through Joining a match from registering to StartGame, with a spawn run that states the field as it stands, and a ClockSync.

A client the server drops with the reason that means its player was away shows that, and does not connect again.

In 0.9.25.24–1.0.0.24

A client sends ReconnectedInMatch on every connection it makes, the first included, with a byte that is 0 where the match is in play and 1 otherwise.

Reconnected announces that a player came back. A client shows it in chat for any other player, ally or enemy.

In 0.9.25.24–1.0.0.24

A client dropped during play connects again only where its player agrees: for the reason 0 it asks, and on a yes connects again, showing that it is reconnecting until it is back or its player cancels. For any other reason but the one that means its player was away, it shows that the reconnection failed. One dropped while loading leaves.

Where Reconnected names the client’s own, the client resynchronises until ResyncEnded.

Staying connected

A client’s view report, Camera, goes out as its view moves at least 200 units, at most every tenth of a second, and never while its view is locked.

Where its last Camera goes unacknowledged, a client sends it again without its view moving, once more than twice the round trip has passed.

In 0.9.25.24–1.0.0.24

A client gives up on a connection where a reliable message it sent goes unacknowledged for 30 seconds, while loading and in play alike.

Messages

Each message of this system in this book, with each layout it has across the book’s patches and every note its definition carries. A layout is the message’s body, after the header its channel’s family puts in front (see Messages).

ClockSync

What a server sends to set a client’s idea of how long the match has run. The header names no object: a server writes zero.

Definition.

In 0.8.13.26–0.9.22.13

Command 77 on events, sent by the server, reliable.

FieldTypeWhat it is
elapsedf32How long the match has run, in seconds.
Vectors (1)

one-on-0-8-13-26

In 0.9.22.14–1.0.0.24

Command 74 on events, sent by the server, reliable.

FieldTypeWhat it is
elapsedf32How long the match has run, in seconds. A client sets its clock to this plus its own measure of the round trip, and answers at once with ClockReply.

ClockReply

What a client sends back when a server states the match clock, carrying both readings so the server can tell how far apart they are. The header names no object: it carries zero.

Definition.

In every range of this book

Carried on clock, sent by the client, reliable, under these commands:

BuildsCommand
0.8.13.26–0.9.22.1378
0.9.22.14–1.0.0.2475
FieldTypeWhat it is
valueu32The client id the sender holds.
serverSaidf32The time the server last stated, in seconds, carried back as it arrived.
clientSaidf32What the client’s own clock reads, in seconds, just after it set itself from that statement.
Vectors (1)

one-on-0-8-13-26

GameSpeed

What a server sends to set how fast the game’s clock runs. A client shows the new speed over its champion. The header carries zero.

Definition.

In 0.9.22.14–0.9.25.35

Command 136 on events, sent by the server, reliable.

Sent while paused, it takes effect at once, and play runs at that speed.

FieldTypeWhat it is
speedf32How fast, 1 being normal. A client sets no bound.
Vectors (1)

one-on-0-9-25-24

In 0.9.25.36–1.0.0.24

Command 135 on events, sent by the server, reliable.

It takes effect at once, so sent while paused it ends the pause.

FieldTypeWhat it is
speedf32How fast, 1 being normal. A client applies it as given, with no limit.

Resumed

What a server sends to take the match off hold. The header names a champion: that of the player who resumed the match.

Definition.

In 0.9.22.14–1.0.0.24

Carried on events, sent by the server, reliable, under these commands:

BuildsCommand
0.9.22.14–0.9.25.35135
0.9.25.36–1.0.0.24134

A client resumes the match at once where it is held, and announces no one.

No body.

Vectors (1)

one-on-0-9-25-24

Paused

What a server sends to put the match on hold. The header names no object: it carries zero.

Definition.

In 0.9.22.14–1.0.0.24

Carried on events, sent by the server, reliable, under these commands:

BuildsCommand
0.9.22.14–0.9.25.35134
0.9.25.36–1.0.0.24133

A client holds the match at once where it is not already held.

No body.

Vectors (1)

one-on-0-9-25-24

GameEnded

What a server sends to end the match and say which side won. The header names no object: it carries zero.

Definition.

In every range of this book

Command 14 on events, sent by the server, reliable.

A client counts a win where its own side is 100 and result is nonzero, or its side is 200 and result is zero, and a loss otherwise. It ends the match on its screen and sends ClientFinished. A client fails where its own player does not yet exist.

FieldTypeWhat it is
resultu8Nonzero where side 100 won, zero where side 200 did; a client counts a win where its own side is the one that won.
Vectors (1)

one-on-0-8-13-26

ClientFinished

What a client sends when it has finished with the match.

Definition.

In every range of this book

Command 17 on requests, sent by the client, reliable.

A client sends it each time GameEnded arrives.

No body.

Exit

What a client sends as it leaves. It carries nothing of its own.

Definition.

In 0.9.22.14–1.0.0.24

Command 115 on requests, sent by the client, reliable.

A client sends it once, as it leaves without a result: as its player confirms quitting or the window is asked to close, or as its player gives up reconnecting after the connection is lost, or loses it where reconnecting is turned off. It sends none after GameEnded, and none on Shutdown or BotKick.

No body.

Vectors (1)

one-on-0-9-22-14

PlayerDisconnected

What a server sends as a player’s client drops out. The header carries zero.

Definition.

In 0.9.22.14–1.0.0.24

Command 116 on events, sent by the server, reliable.

A client shows a chat notice naming the player that client id belongs to, whenever its interface exists: in a neutral colour where it has no champion of its own, and otherwise coloured for whether that player is on its own side.

FieldTypeWhat it is
clientIdu32The player’s client id, matched against the client id CreateChampion gave each champion the client knows.

ReconnectedInMatch

What a client sends right after the server answers its registration. The header carries zero.

Definition.

In 0.9.22.14–1.0.0.24

Command 117 on requests, sent by the client, reliable.

A client dropped while playing asks its player whether to reconnect; where the drop gives inactivity or another reason, it only says it cannot reconnect. One dropped at any other time closes.

FieldTypeWhat it is
loadingu8Zero while the client is playing, in the state StartGame puts it in; 1 at any other time, including after GameEnded.

Reconnected

What a server sends to say a client has reconnected. The header carries zero.

Definition.

In 0.9.22.14–1.0.0.24

Command 118 on events, sent by the server, reliable.

FieldTypeWhat it is
clientu32The client, by the seat it occupies.

ClockConvergence

What a server sends about how its clock and a client’s are being brought together. The header carries zero.

Definition.

In every range of this book

Carried on clock, sent by the server, reliable, under these commands:

BuildsCommand
0.8.13.26–0.9.22.1379
0.9.22.14–1.0.0.2476
FieldTypeWhat it is
clientTimef32The client’s clock, in seconds, as the client reported it. A client sets its clock offset from it: its running round trip value, less half of its own clock’s reading less this value.
roundTripf32The round trip time the server measures, in seconds. A client blends it into a running value, keeping 0.8 of the old and adding 0.1 of this.
Vectors (1)

one-on-0-8-13-26