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.
EnterSight also states the unit’s items.
EnterSight can also carry whole messages of the game family, such as the
CreateTurret or CreateNeutral that makes the unit, each taking effect as
though it had arrived on its own.
EnterSight states everything a client needs to draw the unit at once: its
looks, its shields, where it stands or which path it walks, and, in what
follows, its health and resource. A body MAY end early where its layout marks
the remaining parts as present only while bytes remain.
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 the unit’s health.
EnterLocalSight states the unit’s resource beside its health.
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.
LeaveLocalSight takes a unit out of what one client alone can see, and
leaves it held.
LeaveLocalSight naming a client’s own champion changes nothing it shows.
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.
In 4.1–4.19
A client makes only circular regions.
In 4.1–4.19
A client’s regions see over walls or not as the region says.
Drawing the fog
FogSet and FogToggled change how a client draws its fog of war.
In 4.1–4.19
A client draws its fog of war, or the map with no darkening, as
FogSetandFogToggledsay. Neither changes what the client can see.
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.
In 4.1–4.19
UnitDiedOnMap,InventorySnapshotOnMap,FloatingTextOnMapandSpellSlotChangedForOwnerdo not exist, so a server sends both audiences ofUnitDied,InventorySnapshot,FloatingTextandSpellSlotChangedunder the one command each.
In 4.20
Some messages exist in more than one form, each for its own audience, laid out alike:
For every client For the clients that can see the unit For the unit’s own client UnitDiedUnitDiedOnMapInventorySnapshotInventorySnapshotOnMapFloatingTextFloatingTextOnMapSpellSlotChangedSpellSlotChangedForOwnerA server sends the narrower audience as a message of its own, and sends the wider form only where every client is to know.
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.
ItemAdded and InventorySlot announce a purchase only for the client’s own
champion; an ally’s purchase is called out where the message asks for it.
GoldGained shows floating gold only for the client’s own champion.
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.
In 4.1–4.17
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 185 |
| 4.11–4.17 | 186 |
It states everything a client needs to draw the unit at once, and carries whole messages of the same family for anything a layout of its own cannot say.
| Field | Type | Present when | What it is |
|---|---|---|---|
| carried | 2-byte bits | ||
| carried.size | bit 0 to 12 | How many bytes the messages below occupy in total. | |
| carried.unused | bit 13 to 15 | Unused; a server writes zero. | |
| messages | sized by carried.size × CarriedMessage | Whole messages of the same family, each behind its own length, that a client acts on as though they had arrived on their own. | |
| itemCount | u8 | How many items the unit holds. | |
| items | count in itemCount × HeldItem | The items themselves. | |
| view | record | remaining set | Everything else a client needs to draw the unit. A server sends this message without it too, ending after the items. |
| view.hasShields | u8 | Whether the three figures below follow. A zero leaves them out. Values: 0 no, 1 yes. | |
| view.magicShield | f32 | hasShields set | How much of the unit’s shielding turns aside one sort of damage. |
| view.physicalShield | f32 | hasShields set | How much turns aside the other. |
| view.shield | f32 | hasShields set | How much turns aside either. |
| view.appearanceCount | u32 | How many layers of look follow. | |
| view.appearance | count in appearanceCount × Appearance | What the unit looks like, laid on in order. | |
| view.lookingAt | u32 | What the unit is turned towards, or zero where it is turned towards a place instead. | |
| view.lookKind | u8 | What sort of thing it is turned towards. | |
| view.lookX | f32 | Which way the unit is turned, along one ground axis. The three together are a direction rather than a place. | |
| view.lookY | f32 | Which way it is turned, in height. | |
| view.lookZ | f32 | Which way it is turned, along the other ground axis. | |
| view.effectStackCount | u32 | How many effect slots have more than one stacked in them. | |
| view.effectStacks | count in effectStackCount × EffectStack | Those slots and their counts. | |
| view.isChampion | u8 | Whether the unit is a champion. Values: 0 no, 1 yes. | |
| view.movementState | record | remaining set | Where the unit is and what it is doing on the ground. A server also sends this message ending before it. |
| view.movementState.movementKind | u8 | What the unit is doing on the ground, and so which shape follows. A champion stated as standing, with the place and facing below, is drawn there with its name and health bar over it. One stated as moving is drawn at the first point of its path and walks the rest. Values: 0 nothing, 1 movingAtASpeed, 2 moving, 3 standing. | |
| view.movementState.syncId | u32 | The name this statement of movement answers to. | |
| view.movementState.movement | Movement | movementKind = 2 | Where the unit is going. Movement says how a path is read. |
| 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 | Where the unit stands, along one ground axis, in world units. |
| view.movementState.atZ | f32 | movementKind = 3 | Where it stands, along the other, in world units. |
| 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 4.18–4.20
Command 186 on events, sent by the server, reliable.
It states everything a client needs to draw the unit at once, and carries whole messages of the same family for anything a layout of its own cannot say.
| Field | Type | Present when | What it is |
|---|---|---|---|
| carried | u16 | The byte length of the messages carried below, all sixteen bits of it. | |
| messages | sized by carried × CarriedMessage | Whole messages of the same family, each behind its own length, that a client acts on as though they had arrived on their own. | |
| itemCount | u8 | How many items the unit holds. | |
| items | count in itemCount × HeldItem | The items themselves. | |
| view | record | remaining set | Everything else a client needs to draw the unit. A server sends this message without it too, ending after the items. |
| view.hasShields | u8 | Whether the three figures below follow. A zero leaves them out, and everything after them begins twelve bytes earlier. Values: 0 no, 1 yes. | |
| view.magicShield | f32 | hasShields set | How much of the unit’s shielding turns aside one sort of damage. |
| view.physicalShield | f32 | hasShields set | How much turns aside the other. |
| view.shield | f32 | hasShields set | How much turns aside either. |
| view.appearanceCount | u32 | How many layers of look follow. | |
| view.appearance | count in appearanceCount × Appearance | What the unit looks like, laid on in order. | |
| view.lookingAt | u32 | What the unit is turned towards, or zero where it is turned towards a place instead. | |
| view.lookKind | u8 | What sort of thing it is turned towards. | |
| view.lookX | f32 | Which way the unit is turned, along one ground axis. The three together are a direction rather than a place. | |
| view.lookY | f32 | Which way it is turned, in height. | |
| view.lookZ | f32 | Which way it is turned, along the other ground axis. | |
| view.effectStackCount | u32 | How many effect slots have more than one stacked in them. | |
| view.effectStacks | count in effectStackCount × EffectStack | Those slots and their counts. | |
| view.isChampion | u8 | Whether the unit is a champion. Values: 0 no, 1 yes. | |
| view.movementState | record | remaining set | Where the unit is and what it is doing on the ground. A server also sends this message ending before it. |
| view.movementState.movementKind | u8 | What the unit is doing on the ground, and so which shape follows. A server sends the values for standing and moving. Values: 0 nothing, 1 movingAtASpeed, 2 moving, 3 standing. | |
| view.movementState.syncId | u32 | The name this statement of movement answers to. | |
| view.movementState.movement | Movement | movementKind = 2 | Where the unit is going. Movement says how a path is read. |
| 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 | Where the unit stands, along one ground axis, in world units. |
| view.movementState.atZ | f32 | movementKind = 3 | Where it stands, along the other, in world units. |
| 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 4.1–4.17
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 173 |
| 4.11–4.17 | 174 |
| Field | Type | Present when | What it is |
|---|---|---|---|
| carried | 2-byte bits | ||
| carried.size | bit 0 to 12 | How many bytes the messages below occupy in total. | |
| carried.unused | bit 13 to 15 | Unused; a server writes zero. | |
| messages | sized by carried.size × CarriedMessage | Whole messages of the same family, each behind its own length, that a client acts on as though they had arrived on their own. | |
| vitals | record | remaining set | The unit’s health. A server sends this message without it too, ending after the carried messages. |
| vitals.maxHealth | f32 | What the unit’s health tops out at. | |
| vitals.health | f32 | What its health stands at. |
Vectors (4)
ending-early-on-4-10, one-on-4-10, ending-early-on-4-17, one-on-4-17
In 4.18–4.20
Command 174 on events, sent by the server, reliable.
| Field | Type | Present when | What it is |
|---|---|---|---|
| carried | u16 | The byte length of the messages carried below, all sixteen bits of it. | |
| messages | sized by carried × CarriedMessage | Whole messages of the same family, each behind its own length, that a client acts on as though they had arrived on their own. | |
| vitals | record | remaining set | The unit’s health. A server sends this message without it too, ending after the carried messages. |
| vitals.maxHealth | f32 | What the unit’s health tops out at. | |
| vitals.health | f32 | What its health stands at. |
Vectors (3)
EnterTeamSight
What a server sends when a unit comes into the view of a whole side. The header names the object this is about.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 223 |
| 4.11–4.20 | 224 |
| Field | Type | What it is |
|---|---|---|
| side | u8 | Which side the unit came into or out of the view of. |
Vectors (6)
a-third-on-4-10, another-on-4-10, one-on-4-10, one-on-4-17, another-on-4-20, one-on-4-20
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 |
|---|---|
| 4.1–4.10 | 80 |
| 4.11–4.20 | 81 |
No body.
Vectors (4)
LeaveTeamSight
What a server sends when a unit passes out of the view of a whole side. The header names the object this is about.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 224 |
| 4.11–4.20 | 225 |
| Field | Type | What it is |
|---|---|---|
| side | u8 | Which side the unit came into or out of the view of. |
Vectors (6)
a-third-on-4-10, another-on-4-10, one-on-4-10, one-on-4-17, another-on-4-20, one-on-4-20
ParticleEnterTeamSight
What a server sends as a particle comes into what one side can see. The header carries zero.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 225 |
| 4.11–4.20 | 226 |
| Field | Type | What it is |
|---|---|---|
| particle | u32 | The particle. |
| team | u8 | Which side, by an index. |
Vectors (4)
ParticleLeaveTeamSight
What a server sends as a particle passes out of what one side can see. The header carries zero.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 226 |
| 4.11–4.20 | 227 |
| Field | Type | What it is |
|---|---|---|
| particle | u32 | The particle. |
| team | u8 | Which side, by an index. |
Vectors (4)
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 |
|---|---|
| 4.1–4.10 | 52 |
| 4.11–4.20 | 53 |
No body.
Vectors (4)
RegionAdded
What a server sends to place a region on the ground. The header names no object: a server writes zero.
In 4.1–4.17
Command 35 on events, sent by the server, reliable.
A region grants sight, blocks the way, or grows cover.
| Field | Type | What it is |
|---|---|---|
| side | u32 | The side the region belongs to. |
| kind | i32 | What sort of region it is. A client makes one only for 0, a circle. Values: 0 circle. |
| clientId | u32 | The client id of the client the region answers to. |
| unit | u32 | The unit the region follows, or zero where it stands still. |
| marker | u32 | The name the region answers to, which RegionRemoved names to take it away. |
| sightFrom | u32 | The unit whose sight the region grants, or zero. |
| atX | f32 | Where the region sits, along one ground axis, in world units. |
| atZ | f32 | Where it sits, along the other, in world units. |
| lifetime | f32 | How long it lasts, in seconds. A lifetime of 0 never runs out. |
| lineOfSightRadius | f32 | How far out the region’s line of sight is reckoned, in world units. |
| grassRadius | f32 | How far out it grows cover, in world units. |
| sizeMultiplier | f32 | What its stated radius is scaled by. |
| sizeAdditive | f32 | What is added to its stated radius after scaling, in world units. |
| does | 4-byte bits | |
| does.lineOfSight | bit 0 | Set where walls and terrain cut the region’s sight. |
| does.grantSight | bit 1 | Set to turn on the region’s sight; sightFrom and revealHidden apply only where it is set. Where it is set, a client clears its map’s cover over the region. |
| does.revealHidden | bit 2 | Set to show hidden units within it, where grantSight is set. |
| does.unused | bit 3 to 31 | Unused; a server writes zero. |
| baseRadius | f32 | The region’s radius, in world units. |
Vectors (1)
In 4.18–4.19
Command 35 on events, sent by the server, reliable.
A region grants sight, blocks the way, or grows cover.
| Field | Type | What it is |
|---|---|---|
| side | u32 | The side the region belongs to. |
| kind | i32 | What sort of region it is. A client makes one only for 0, a circle. Values: 0 circle. |
| clientId | u32 | The client id of the client the region answers to. |
| otherUnit | u32 | A second unit a client looks up and keeps with the region, or zero. |
| unit | u32 | The unit the region follows, or zero where it stands still. |
| marker | u32 | The name the region answers to, which RegionRemoved names to take it away. |
| sightFrom | u32 | The unit whose sight the region grants, or zero. |
| atX | f32 | Where the region sits, along one ground axis, in world units. |
| atZ | f32 | Where it sits, along the other, in world units. |
| lifetime | f32 | How long it lasts, in seconds. A lifetime of 0 never runs out. |
| lineOfSightRadius | f32 | How far out the region’s line of sight is reckoned, in world units. |
| grassRadius | f32 | How far out it grows cover, in world units. |
| sizeMultiplier | f32 | What its stated radius is scaled by. |
| sizeAdditive | f32 | What is added to its stated radius after scaling, in world units. |
| does | 4-byte bits | |
| does.lineOfSight | bit 0 | Set where walls and terrain cut the region’s sight. |
| does.grantSight | bit 1 | Set to turn on the region’s sight; sightFrom and revealHidden apply only where it is set. Where it is set, a client clears its map’s cover over the region. |
| does.revealHidden | bit 2 | Set to show hidden units within it, where grantSight is set. |
| does.unused | bit 3 to 31 | Unused; a server writes zero. |
| baseRadius | f32 | The region’s radius, in world units. |
Vectors (1)
In 4.20
Command 35 on events, sent by the server, reliable.
A region grants sight, blocks the way, or grows cover.
| Field | Type | What it is |
|---|---|---|
| side | u32 | The side the region belongs to. |
| kind | i32 | Unused; a client makes a circle whatever it holds. A server writes 0. |
| object | u32 | An object the region keeps hold of, or zero; it changes nothing a client shows. |
| unit | u32 | The unit the region follows, or zero where it stands still. |
| marker | u32 | The name the region answers to, which RegionRemoved names to take it away. |
| sightFrom | u32 | The unit whose sight the region grants, or zero. |
| atX | f32 | Where the region sits, along one ground axis, in world units. |
| atZ | f32 | Where it sits, along the other, in world units. |
| lifetime | f32 | How long it lasts, in seconds. A lifetime of 0 never runs out. |
| lineOfSightRadius | f32 | How far out the region’s line of sight is reckoned, in world units. |
| grassRadius | f32 | How far out it grows cover, in world units. |
| sizeMultiplier | f32 | What its stated radius is scaled by. |
| sizeAdditive | f32 | What is added to its stated radius after scaling, in world units. |
| does | 1-byte bits | What the region does, in one byte. |
| does.lineOfSight | bit 0 | Set where walls and terrain cut the region’s sight. |
| does.grantSight | bit 1 | Set to turn on the region’s sight; sightFrom and revealHidden apply only where it is set. Where it is set, a client clears its map’s cover over the region. |
| does.revealHidden | bit 2 | Set to show hidden units within it, where grantSight is set. |
| does.unused | bit 3 to 7 | Unused; a server writes zero. |
| baseRadius | f32 | The radius the three size figures above are applied to, in world units. |
Vectors (2)
RegionMoved
What a server sends to move a region of sight, keeping all else about it. The header carries zero.
In 4.11–4.20
Command 36 on events, sent by the server, reliable.
| Field | Type | What it is |
|---|---|---|
| region | u32 | The region, as RegionAdded named it. |
| x | f32 | Where its centre now stands, in world units. |
| z | f32 | Where its centre now stands, in world units. |
Vectors (2)
RegionRemoved
What a server sends to take away a region RegionAdded or RegionAttached placed. The header names no object: a server writes zero.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 50 |
| 4.11–4.20 | 51 |
| Field | Type | What it is |
|---|---|---|
| region | u32 | The region to take away, by the name RegionAdded gave it. |
Vectors (6)
a-third-on-4-10, another-on-4-10, one-on-4-10, one-on-4-17, another-on-4-20, one-on-4-20
FogSet
What a server sends to turn the drawing of the fog of war on or off. It changes only what is drawn. The header carries zero.
In every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 170 |
| 4.11–4.20 | 171 |
| Field | Type | What it is |
|---|---|---|
| state | 1-byte bits | Whether the fog is drawn. |
| state.drawn | bit 0 | Set to draw the fog, clear to draw the map with no darkening. |
| state.unused | bit 1 to 7 | Unused; a server writes zero. |
Vectors (3)
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 every range of this book
Carried on events, sent by the server, reliable, under these commands:
| Builds | Command |
|---|---|
| 4.1–4.10 | 125 |
| 4.11–4.20 | 126 |
No body.