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

Vision

What a client can see, and how a server tells it. A client draws what a server says it sees and nothing else: the fog of war a client draws is only a picture, and what lies inside it is whatever the server has brought into view.

Bringing a unit into view

A server brings a unit into what a client’s side can see with EnterSight.

In 0.8.13.26–0.9.22.13

EnterSight states nothing but the unit it names, and only marks that unit as in view.

In 0.9.25.24–1.0.0.24

EnterSight states where the unit stands or which path it walks, and nothing of its looks, shields, health or resource.

A client does not draw a champion that no EnterSight has placed: given only its CreateChampion, a client shows the champion’s portrait and spells and nothing on the field. One EnterSight after the CreateChampion draws it, with its name and health bar over it.

EnterLocalSight brings a unit into what one client alone can see. EnterTeamSight brings an object into the view of a whole side.

EnterLocalSight states nothing of the unit.

Losing sight

LeaveSight and LeaveTeamSight take a unit out of the matching view, and leave it held (see Objects and identifiers). Particles come into and leave a side’s view with ParticleEnterTeamSight and ParticleLeaveTeamSight.

In 0.8.13.26–0.9.22.13

LeaveLocalSight takes a unit out of what one client alone can see, and leaves it held.

Regions

A region is a patch of ground with sight of its own, which can reveal hidden units within it. A server places one with RegionAdded or fastens one to a unit with RegionAttached, moves it with RegionMoved and takes it away with RegionRemoved; Objects and identifiers says how regions are named and when one ends. A region granting sight has a client clear its map’s cover over it.

Drawing the fog

FogSet and FogToggled change how a client draws its fog of war.

Who is told what

A client acts on a message about whichever unit it names, its own champion or another, so what a client knows is whatever a server sends it. A server decides, message by message, which clients to tell.

UnitDiedOnMap, InventorySnapshotOnMap, FloatingTextOnMap and SpellSlotChangedForOwner do not exist, so a server sends both audiences of UnitDied, InventorySnapshot, FloatingText and SpellSlotChanged under the one command each.

Messages about a champion’s own state, its gold, its inventory, its spells’ levels, cooldowns and charges, and whether it can shop, are applied to the champion they name on any client that receives them, but a client shows some of them only for its own champion:

  • ShopEnabled changes the shop only for the client’s own champion.

In 0.8.13.26–0.9.22.13

GoldGained shows floating gold only for the client’s own champion.

In 0.9.25.24–1.0.0.24

GoldGained naming the client’s own champion, with an amount above 0 and a source the client holds, shows the gold over the source.

In 0.9.25.24–1.0.0.24

Any other GoldGained shows the gold gained or lost over the unit it names, whichever unit that is. ItemAdded announces no purchase, a client’s own or another’s.

In 0.9.25.24–0.9.25.35

LevelUp shows its effect over any unit the client can see.

A server SHOULD send SpellCooldown, SpellCharges and GoldGained about a champion only to the client whose champion it is.

A client also acts on what it is told about a unit it holds but cannot see:

  • a particle on a hidden unit is created but not drawn until the unit comes into view, unless the particle is bound to a target the client can see;
  • floating text over a hidden unit is dropped;
  • an animation plays on a hidden unit, which comes into view part way through it.

A server SHOULD NOT send a client what its side cannot see, beyond what keeps its world consistent.

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).

EnterSight

What a server sends when a unit comes into what a side can see. The header names the unit this is about.

Definition.

In 0.8.13.26–0.9.22.13

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

A client reads none of the body: it only shows the unit.

FieldTypePresent whenWhat it is
viewrecordremaining setEverything else a client needs to draw the unit. A server sends it for a champion, a minion or another unit with a mind, and ends the message after the items for any other unit.
view.movementStaterecordremaining setWhere the unit stands, followed by the direction it faces.
view.movementState.movementKindu8What follows the sync id: 0 nothing, 1 a path walked at a set speed, 2 a path, 3 a point the unit stands at. Values: 0 nothing, 1 movingAtASpeed, 2 moving, 3 standing.
view.movementState.syncIdu32The number of this statement about the unit.
view.movementState.movementMovementmovementKind = 2Every point after the first.
view.movementState.movementAtSpeedMovementAtSpeedmovementKind = 1Where the unit is going, and how a server makes it travel. WaypointGroupAtSpeed carries the same shape.
view.movementState.atXf32movementKind = 3Along one ground axis, in world units; the height is the ground’s.
view.movementState.atZf32movementKind = 3Along the other ground axis.
view.movementState.facingXf32movementKind = 3Which way it faces, along one ground axis.
view.movementState.facingZf32movementKind = 3Which way it faces, along the other.
Vectors (4)

a-fourth-on-0-8-13-26, a-third-on-0-8-13-26, another-on-0-8-13-26, one-on-0-8-13-26

In 0.9.22.14–1.0.0.24

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

What a server sends to bring a unit into what a client can see. A client draws a unit only once this has named it, except turrets, which it draws regardless; the header names the unit. It states everything a client needs to draw the unit at once.

FieldTypePresent whenWhat it is
viewrecordremaining setEverything else a client needs to draw the unit. A server sends it for a champion, a minion or another unit with a mind, which a client reads past the end of the message without it. For any other unit a server ends the message before it, and a client reads none of the body.
view.movementStaterecordremaining setWhere the unit stands, followed by the direction it faces.
view.movementState.movementKindu8What follows the sync id: 0 nothing, 1 a path walked at a set speed, 2 a path, 3 a point the unit stands at. A client reads nothing more for any other value. Values: 0 nothing, 1 movingAtASpeed, 2 moving, 3 standing.
view.movementState.syncIdu32The number of this statement about the unit; a client takes a path or a point only where it is not behind the last one the unit took.
view.movementState.movementMovementmovementKind = 2Every point after the first.
view.movementState.movementAtSpeedMovementAtSpeedmovementKind = 1Where the unit is going, and how a server makes it travel. WaypointGroupAtSpeed carries the same shape.
view.movementState.atXf32movementKind = 3Along one ground axis, in world units; the height is the ground’s.
view.movementState.atZf32movementKind = 3Along the other ground axis.
view.movementState.facingXf32movementKind = 3Which way it faces, along one ground axis.
view.movementState.facingZf32movementKind = 3Which way it faces, along the other.

EnterLocalSight

What a server sends when a unit comes into what one client can see. The header names the unit this is about.

Definition.

In every range of this book

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

BuildsCommand
0.8.13.26–0.9.22.1361
0.9.22.14–1.0.0.2457

A client reads none of the body: it shows the unit and reads nothing more.

FieldTypePresent whenWhat it is
vitalsrecordremaining setThe unit’s health. A client reads nothing here.
vitals.maxHealthf32A client reads nothing here.
vitals.healthf32A client reads nothing here.
Vectors (2)

another-on-0-8-13-26, one-on-0-8-13-26

LeaveSight

What a server sends when a unit passes out of what a side can see. The header names the unit this is about.

Definition.

In every range of this book

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

BuildsCommand
0.8.13.26–0.9.22.1360
0.9.22.14–1.0.0.2456

What a server sends to take a unit out of what a client can see; the client stops drawing it. The header names the unit.

No body.

Vectors (1)

one-on-0-8-13-26

LeaveLocalSight

What a server sends when a unit passes out of what one client can see. Sent for the receiving client’s own champion, it changes nothing the client shows. The header names the unit this is about.

Definition.

In every range of this book

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

BuildsCommand
0.8.13.26–0.9.22.1362
0.9.22.14–1.0.0.2458

No body.

Vectors (1)

one-on-0-8-13-26

RegionAdded

What a server sends to place a region on the ground. The header names no object: a server writes zero.

Definition.

In 0.8.13.26–0.9.22.13

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

On this range a region stands where the message places it; RegionAttached places one that follows a unit. Every RegionAdded adds a region; where marker repeats an id the client holds, both regions are kept under that id.

FieldTypeWhat it is
kindu32Whose map shows the region: 0 side 100’s, 1 side 200’s, 2 everyone’s, 3 side 300’s, 4 any other. A client takes the value as it stands, so 100 or 200 here matches no one, and draws the region only where it is 2 or names the player’s own side.
clientIdu32Unused; a client reads nothing here.
sightRadiusf32How far the region shows the map around it, in world units, zero or more.
atXf32Where it stands, along one ground axis, in world units.
atYf32Its height, in world units.
atZf32Where it stands, along the other ground axis, in world units.
lifetimef32How long it lasts, in seconds. A client counts it down and removes the region once it reaches zero or less, so one that starts at zero or less goes at its first count.
markeru32The id the client keeps the region under. Zero has the client pick one.
does4-byte bitsWhat the region does.
does.flagbit 0Where kind is 2, a client sets this bit and the one after it itself, whatever was sent.
does.secondbit 1Kept with the region; a client also sets it where kind is 2.
does.unusedbit 2 to 31Its value has no effect; a server writes zero.
extrau32Kept with the region; it changes nothing a client shows. A server writes zero.
Vectors (1)

one-on-0-8-13-26

In 0.9.22.14–1.0.0.24

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

On this range a region stands where the message places it; RegionAttached places one that follows a unit. Every message adds a new region, even one matching a region the client holds; each counts down on its own.

FieldTypeWhat it is
kindu32Whose map shows the region: 0 side 100’s, 1 side 200’s, 2 everyone’s, 3 side 300’s, 4 any other. A client takes the value as it stands, so 100 or 200 here matches no one, and draws the region only where it is 2 or names the player’s own side.
clientIdu32Unused; a client reads nothing here.
sightRadiusf32How far the region shows the map around it, in world units, zero or more.
atXf32Where it stands, along one ground axis, in world units.
atYf32Its height, in world units.
atZf32Where it stands, along the other ground axis, in world units.
lifetimef32How long it lasts, in seconds. A client counts it down, taking each frame’s time off before it checks, and removes the region at the first count that reaches zero or less.
markeru32The id the client keeps the region under. Zero has the client pick one.
does4-byte bitsWhat the region does.
does.flagbit 0Where kind is 2 and this bit is set, a client also sets the bit after it.
does.secondbit 1Kept with the region; a client also sets it where kind is 2 and flag is set. It changes nothing a client shows.
does.unusedbit 2 to 31Its value has no effect; a server writes zero.
extrau32Kept with the region; it changes nothing a client shows. A server writes zero.
otherExtrau32Kept with the region; what it names is not recorded. A server sends zero.

RegionAttached

What a server sends to place a region that follows a unit, showing the map around it until it runs out or the unit is gone.

Definition.

In 0.8.13.26–0.9.22.13

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

Every RegionAttached adds a region; nothing is compared, and a repeated marker gives two regions under one id.

FieldTypeWhat it is
kindu32Whose map shows the region: 0 side 100’s, 1 side 200’s, 2 everyone’s, 3 side 300’s, 4 any other. A client takes the value as it stands, so 100 or 200 here matches no one, and draws the region only where it is 2 or names the player’s own side.
clientIdu32Unused; a client reads nothing here.
sightRadiusf32How far the region shows the map around it, in world units, zero or more. Zero takes the unit’s own sight radius, followed as it changes, or a default where it has none.
unitu32A player’s champion: the region follows it. A client fails where no player’s champion answers to it.
lifetimef32How long it lasts, in seconds. A client counts it down and removes the region once it reaches zero or less, so one that starts at zero or less goes at its first count.
markeru32The region’s id, which RegionRemoved names; zero has the client pick one of its own.
does4-byte bitsWhat the region does.
does.flagbit 0Set where the region shows the map. Where kind is 2, a client sets this bit and does.second itself, whatever was sent.
does.secondbit 1Kept with the region; a client also sets it where kind is 2. It changes nothing a client shows.
does.unusedbit 2 to 31Its value has no effect, because a client always sets this bit itself; a server writes zero.
extrau32Kept with the region; it changes nothing a client shows. A server writes zero.
Vectors (1)

one-on-0-8-13-26

In 0.9.22.14–1.0.0.24

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

Every message adds a new region, even one matching a region the client holds; each counts down on its own.

FieldTypeWhat it is
kindu32Whose map shows the region: 0 side 100’s, 1 side 200’s, 2 everyone’s, 3 side 300’s, 4 any other. A client takes the value as it stands, so 100 or 200 here matches no one, and draws the region only where it is 2 or names the player’s own side.
clientIdu32Unused; a client reads nothing here.
sightRadiusf32How far the region shows the map around it, in world units, zero or more. Zero takes the unit’s own sight radius, followed as it changes, or a default where it has none.
unitu32The unit the region follows. A client ignores the message where it does not know the unit.
lifetimef32How long it lasts, in seconds. A client counts it down and removes the region once it reaches zero or less, so one that starts at zero or less goes at its first count.
markeru32The region’s id, which RegionRemoved names; zero has the client pick one of its own.
does4-byte bitsWhat the region does.
does.flagbit 0Set where the region shows the map; where kind is 2, a client sets both this bit and does.second, whatever was sent. What else it changes is not recorded.
does.secondbit 1Kept with the region; a client sets it wherever kind is 2. It changes nothing a client shows.
does.unusedbit 2 to 31Its value has no effect, because a client always sets this bit itself; a server writes zero.
extrau32Kept with the region; it changes nothing a client shows. A server writes zero.
otherExtrau32Kept with the region; what it names is not recorded. A server sends zero.

RegionRemoved

What a server sends to take away a region RegionAdded or RegionAttached placed. The header names no object: a server writes zero.

Definition.

In 0.8.13.26–0.9.22.13

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

It takes away regions RegionAttached placed as well.

FieldTypeWhat it is
regionu32The region to take away, by its id. A client takes away every region holding that id, and does nothing where none does.
Vectors (1)

one-on-0-8-13-26

In 0.9.22.14–1.0.0.24

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

FieldTypeWhat it is
regionu32The region to take away, by the id RegionAdded or RegionAttached gave it. A client takes away every region it holds under that id.

FogToggled

What a server sends to turn the drawing of the fog of war off where it is on, or on where it is off. It changes only what is drawn: what can be seen is still what a server sends. It carries nothing of its own. The header 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.35126
0.9.25.36–1.0.0.24125

No body.

Vectors (1)

one-on-0-9-25-24