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.

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.

In 3.10

EnterSight states the unit’s shields and looks and, for a champion or a minion, where it stands or which path it walks, and nothing of its health or resource. A client reads every part of the body whatever its length, so a server MUST NOT end one early. For an inhibitor or a nexus it reads nothing after the messages carried.

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.

In 3.10

EnterLocalSight states the unit’s maximum health beside its health, and nothing of its resource. It can carry whole messages as EnterSight does.

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 3.10–3.15

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.

A client makes only circular regions.

Drawing the fog

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

A client draws its fog of war, or the map with no darkening, as FogSet and FogToggled say. 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.

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 3.01–3.10

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

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.

In 3.10–3.15

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

In 3.10

Where the source of a GoldGained cannot show text, the gold shows over the client’s own champion.

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 3.01–3.10

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.

FieldTypePresent whenWhat it is
carried2-byte bits
carried.sizebit 0 to 10How many bytes the messages below occupy in total.
carried.unusedbit 11 to 15Unused; a server writes zero.
messagessized by carried.size × CarriedMessageWhole messages of the same family, each behind its own length, that a client acts on as though they had arrived on their own.
itemCountu8How many items the unit holds.
itemscount in itemCount × HeldItemThe items themselves.
viewrecordremaining setEverything else a client needs to draw the unit. A server sends this message without it too, ending after the items.
view.hasShieldsu8Whether the three figures below follow. A zero leaves them out. Values: 0 no, 1 yes.
view.magicShieldf32hasShields setHow much of the unit’s shielding turns aside one sort of damage.
view.physicalShieldf32hasShields setHow much turns aside the other.
view.shieldf32hasShields setHow much turns aside either.
view.appearanceCountu32How many layers of look follow.
view.appearancecount in appearanceCount × AppearanceWhat the unit looks like, laid on in order.
view.movementStaterecordremaining setWhere the unit is and what it is doing on the ground. A server also sends this message ending before it.
view.movementState.movementKindu8What 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.syncIdu32The name this statement of movement answers to.
view.movementState.movementMovementmovementKind = 2Where the unit is going. Movement says how a path is read.
view.movementState.movementAtSpeedMovementAtSpeedmovementKind = 1Where the unit is going, and how a server makes it travel. WaypointGroupAtSpeed carries the same shape.
view.movementState.atXf32movementKind = 3Where the unit stands, along one ground axis, in world units.
view.movementState.atZf32movementKind = 3Where it stands, along the other, in world units.
view.movementState.facingXf32movementKind = 3Which way it faces, along one ground axis.
view.movementState.facingZf32movementKind = 3Which way it faces, along the other.
Vectors (10)

a-fifth-on-3-5, a-fourth-on-3-5, a-third-on-3-5, another-on-3-5, one-on-3-5, a-fifth-on-3-10, a-fourth-on-3-10, a-third-on-3-10, another-on-3-10, one-on-3-10

In 3.11–3.15

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.

FieldTypePresent whenWhat it is
carried2-byte bits
carried.sizebit 0 to 10How many bytes the messages below occupy in total.
carried.unusedbit 11 to 15Unused; a server writes zero.
messagessized by carried.size × CarriedMessageWhole messages of the same family, each behind its own length, that a client acts on as though they had arrived on their own.
itemCountu8How many items the unit holds.
itemscount in itemCount × HeldItemThe items themselves.
viewrecordremaining setEverything else a client needs to draw the unit. A server sends this message without it too, ending after the items.
view.hasShieldsu8Whether the three figures below follow. A zero leaves them out. Values: 0 no, 1 yes.
view.magicShieldf32hasShields setHow much of the unit’s shielding turns aside one sort of damage.
view.physicalShieldf32hasShields setHow much turns aside the other.
view.shieldf32hasShields setHow much turns aside either.
view.appearanceCountu32How many layers of look follow.
view.appearancecount in appearanceCount × AppearanceWhat the unit looks like, laid on in order.
view.lookingAtu32What the unit is turned towards, or zero where it is turned towards a place instead.
view.lookKindu8What sort of thing it is turned towards.
view.lookXf32Which way the unit is turned, along one ground axis. The three together are a direction rather than a place.
view.lookYf32Which way it is turned, in height.
view.lookZf32Which way it is turned, along the other ground axis.
view.movementStaterecordremaining setWhere the unit is and what it is doing on the ground. A server also sends this message ending before it.
view.movementState.movementKindu8What 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.syncIdu32The name this statement of movement answers to.
view.movementState.movementMovementmovementKind = 2Where the unit is going. Movement says how a path is read.
view.movementState.movementAtSpeedMovementAtSpeedmovementKind = 1Where the unit is going, and how a server makes it travel. WaypointGroupAtSpeed carries the same shape.
view.movementState.atXf32movementKind = 3Where the unit stands, along one ground axis, in world units.
view.movementState.atZf32movementKind = 3Where it stands, along the other, in world units.
view.movementState.facingXf32movementKind = 3Which way it faces, along one ground axis.
view.movementState.facingZf32movementKind = 3Which way it faces, along the other.
Vectors (5)

a-fifth-on-3-11, a-fourth-on-3-11, a-third-on-3-11, another-on-3-11, one-on-3-11

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

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

FieldTypePresent whenWhat it is
carried2-byte bits
carried.sizebit 0 to 10How many bytes the messages below occupy in total.
carried.unusedbit 11 to 15Unused; a server writes zero.
messagessized by carried.size × CarriedMessageWhole messages of the same family, each behind its own length, that a client acts on as though they had arrived on their own.
vitalsrecordremaining setThe unit’s health. A server sends this message without it too, ending after the carried messages.
vitals.maxHealthf32What the unit’s health tops out at.
vitals.healthf32What its health stands at.
Vectors (4)

another-on-3-11, one-on-3-11, ending-early-on-3-15, one-on-3-15

EnterTeamSight

What a server sends when a unit comes into the view of a whole side. The header names the object this is about.

Definition.

In every range of this book

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

FieldTypeWhat it is
sideu8Which side the unit came into or out of the view of.
Vectors (3)

a-third-on-3-15, another-on-3-15, one-on-3-15

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

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

No body.

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.

Definition.

In every range of this book

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

FieldTypeWhat it is
sideu8Which side the unit came into or out of the view of.
Vectors (3)

a-third-on-3-15, another-on-3-15, one-on-3-15

ParticleEnterTeamSight

What a server sends as a particle comes into what one side can see. The header carries zero.

Definition.

In every range of this book

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

FieldTypeWhat it is
particleu32The particle.
teamu8Which side, by an index.
Vectors (2)

another-on-3-15, one-on-3-15

ParticleLeaveTeamSight

What a server sends as a particle passes out of what one side can see. The header carries zero.

Definition.

In every range of this book

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

FieldTypeWhat it is
particleu32The particle.
teamu8Which side, by an index.
Vectors (2)

another-on-3-15, one-on-3-15

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

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

No body.

RegionAdded

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

Definition.

In every range of this book

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

A region grants sight, blocks the way, or grows cover.

FieldTypeWhat it is
kindu32What sort of region it is. Where it is 2, the region belongs to the client clientId names; what other values mean is not recorded.
clientIdu32The client the region belongs to where kind is 2. A client takes 4294967294 as 4294967295, no client.
sightRadiusf32How far the region shows the map around it, in world units. Zero takes a default radius.
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. Whether one that starts at zero or less is kept is not recorded.
markeru32The region’s id, which RegionRemoved names; 4294967295 has the client pick one of its own. A region sent again with the same id, kind and radius changes the one held rather than adding another.
does4-byte bitsWhat the region does.
does.flagbit 0What this changes on a client is not recorded.
does.unusedbit 1 to 31Unused; a server writes zero.
Vectors (1)

one-on-3-15

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 every range of this book

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

A region matching one the client holds in view, sightRadius, the first three bits of does, marker, sightFrom and unit only gives that one the new lifetime.

FieldTypeWhat it is
kindu32What sort of region it is. Where it is 2, the region belongs to the client clientId names; what other values mean is not recorded.
clientIdu32The client the region belongs to where kind is 2. A client takes 4294967294 as 4294967295, no client.
sightRadiusf32How far the region shows the map around it, in world units. Zero takes the unit’s own sight radius, or a default where it has none.
unitu32The unit the region follows. A client takes the region even where it does not hold the unit.
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. Whether one that starts at zero or less is kept is not recorded.
markeru32The region’s id, which RegionRemoved names; 4294967295 has the client pick one of its own. A region sent again with the same id, kind and radius changes the one held rather than adding another.
does4-byte bitsWhat the region does.
does.flagbit 0What this changes on a client is not recorded.
does.unusedbit 1 to 31Unused; a server writes zero.
Vectors (1)

one-on-3-15

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 every range of this book

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

FieldTypeWhat it is
regionu32The region to take away, by the name RegionAdded gave it.

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.

Definition.

In every range of this book

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

FieldTypeWhat it is
state1-byte bitsWhether the fog is drawn.
state.drawnbit 0Set to draw the fog, clear to draw the map with no darkening.
state.unusedbit 1 to 7Unused; a server writes zero.
Vectors (1)

one-on-3-15

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 every range of this book

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

No body.

Vectors (1)

one-on-3-15