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
EnterSightstates nothing but the unit it names, and only marks that unit as in view.
In 0.9.25.24–1.0.0.24
EnterSightstates 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
LeaveLocalSighttakes 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:
ShopEnabledchanges the shop only for the client’s own champion.
In 0.8.13.26–0.9.22.13
GoldGainedshows floating gold only for the client’s own champion.
In 0.9.25.24–1.0.0.24
GoldGainednaming 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
GoldGainedshows the gold gained or lost over the unit it names, whichever unit that is.ItemAddedannounces no purchase, a client’s own or another’s.
In 0.9.25.24–0.9.25.35
LevelUpshows 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.
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.
| Field | Type | Present when | What it is |
|---|---|---|---|
| view | record | remaining set | Everything 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.movementState | record | remaining set | Where the unit stands, followed by the direction it faces. |
| view.movementState.movementKind | u8 | What 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.syncId | u32 | The number of this statement about the unit. | |
| view.movementState.movement | Movement | movementKind = 2 | Every point after the first. |
| view.movementState.movementAtSpeed | MovementAtSpeed | movementKind = 1 | Where the unit is going, and how a server makes it travel. WaypointGroupAtSpeed carries the same shape. |
| view.movementState.atX | f32 | movementKind = 3 | Along one ground axis, in world units; the height is the ground’s. |
| view.movementState.atZ | f32 | movementKind = 3 | Along the other ground axis. |
| view.movementState.facingX | f32 | movementKind = 3 | Which way it faces, along one ground axis. |
| view.movementState.facingZ | f32 | movementKind = 3 | Which way it faces, along the other. |
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.
| Field | Type | Present when | What it is |
|---|---|---|---|
| view | record | remaining set | Everything 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.movementState | record | remaining set | Where the unit stands, followed by the direction it faces. |
| view.movementState.movementKind | u8 | What 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.syncId | u32 | The 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.movement | Movement | movementKind = 2 | Every point after the first. |
| view.movementState.movementAtSpeed | MovementAtSpeed | movementKind = 1 | Where the unit is going, and how a server makes it travel. WaypointGroupAtSpeed carries the same shape. |
| view.movementState.atX | f32 | movementKind = 3 | Along one ground axis, in world units; the height is the ground’s. |
| view.movementState.atZ | f32 | movementKind = 3 | Along the other ground axis. |
| view.movementState.facingX | f32 | movementKind = 3 | Which way it faces, along one ground axis. |
| view.movementState.facingZ | f32 | movementKind = 3 | Which 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.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 0.8.13.26–0.9.22.13 | 61 |
| 0.9.22.14–1.0.0.24 | 57 |
A client reads none of the body: it shows the unit and reads nothing more.
| Field | Type | Present when | What it is |
|---|---|---|---|
| vitals | record | remaining set | The unit’s health. A client reads nothing here. |
| vitals.maxHealth | f32 | A client reads nothing here. | |
| vitals.health | f32 | A client reads nothing here. |
Vectors (2)
LeaveSight
What a server sends when a unit passes out of what a side can see. The header names the unit this is about.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 0.8.13.26–0.9.22.13 | 60 |
| 0.9.22.14–1.0.0.24 | 56 |
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)
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.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 0.8.13.26–0.9.22.13 | 62 |
| 0.9.22.14–1.0.0.24 | 58 |
No body.
Vectors (1)
RegionAdded
What a server sends to place a region on the ground. The header names no object: a server writes zero.
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.
| Field | Type | What it is |
|---|---|---|
| kind | u32 | Whose 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. |
| clientId | u32 | Unused; a client reads nothing here. |
| sightRadius | f32 | How far the region shows the map around it, in world units, zero or more. |
| atX | f32 | Where it stands, along one ground axis, in world units. |
| atY | f32 | Its height, in world units. |
| atZ | f32 | Where it stands, along the other ground axis, in world units. |
| lifetime | f32 | How 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. |
| marker | u32 | The id the client keeps the region under. Zero has the client pick one. |
| does | 4-byte bits | What the region does. |
| does.flag | bit 0 | Where kind is 2, a client sets this bit and the one after it itself, whatever was sent. |
| does.second | bit 1 | Kept with the region; a client also sets it where kind is 2. |
| does.unused | bit 2 to 31 | Its value has no effect; a server writes zero. |
| extra | u32 | Kept with the region; it changes nothing a client shows. A server writes zero. |
Vectors (1)
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.
| Field | Type | What it is |
|---|---|---|
| kind | u32 | Whose 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. |
| clientId | u32 | Unused; a client reads nothing here. |
| sightRadius | f32 | How far the region shows the map around it, in world units, zero or more. |
| atX | f32 | Where it stands, along one ground axis, in world units. |
| atY | f32 | Its height, in world units. |
| atZ | f32 | Where it stands, along the other ground axis, in world units. |
| lifetime | f32 | How 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. |
| marker | u32 | The id the client keeps the region under. Zero has the client pick one. |
| does | 4-byte bits | What the region does. |
| does.flag | bit 0 | Where kind is 2 and this bit is set, a client also sets the bit after it. |
| does.second | bit 1 | Kept with the region; a client also sets it where kind is 2 and flag is set. It changes nothing a client shows. |
| does.unused | bit 2 to 31 | Its value has no effect; a server writes zero. |
| extra | u32 | Kept with the region; it changes nothing a client shows. A server writes zero. |
| otherExtra | u32 | Kept 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.
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.
| Field | Type | What it is |
|---|---|---|
| kind | u32 | Whose 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. |
| clientId | u32 | Unused; a client reads nothing here. |
| sightRadius | f32 | How 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. |
| unit | u32 | A player’s champion: the region follows it. A client fails where no player’s champion answers to it. |
| lifetime | f32 | How 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. |
| marker | u32 | The region’s id, which RegionRemoved names; zero has the client pick one of its own. |
| does | 4-byte bits | What the region does. |
| does.flag | bit 0 | Set where the region shows the map. Where kind is 2, a client sets this bit and does.second itself, whatever was sent. |
| does.second | bit 1 | Kept with the region; a client also sets it where kind is 2. It changes nothing a client shows. |
| does.unused | bit 2 to 31 | Its value has no effect, because a client always sets this bit itself; a server writes zero. |
| extra | u32 | Kept with the region; it changes nothing a client shows. A server writes zero. |
Vectors (1)
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.
| Field | Type | What it is |
|---|---|---|
| kind | u32 | Whose 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. |
| clientId | u32 | Unused; a client reads nothing here. |
| sightRadius | f32 | How 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. |
| unit | u32 | The unit the region follows. A client ignores the message where it does not know the unit. |
| lifetime | f32 | How 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. |
| marker | u32 | The region’s id, which RegionRemoved names; zero has the client pick one of its own. |
| does | 4-byte bits | What the region does. |
| does.flag | bit 0 | Set 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.second | bit 1 | Kept with the region; a client sets it wherever kind is 2. It changes nothing a client shows. |
| does.unused | bit 2 to 31 | Its value has no effect, because a client always sets this bit itself; a server writes zero. |
| extra | u32 | Kept with the region; it changes nothing a client shows. A server writes zero. |
| otherExtra | u32 | Kept 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.
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.
| Field | Type | What it is |
|---|---|---|
| region | u32 | The region to take away, by its id. A client takes away every region holding that id, and does nothing where none does. |
Vectors (1)
In 0.9.22.14–1.0.0.24
Command 84 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| region | u32 | The 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.
In 0.9.22.14–1.0.0.24
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 0.9.22.14–0.9.25.35 | 126 |
| 0.9.25.36–1.0.0.24 | 125 |
No body.