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

Replication

With Replication a server states what has changed about the units a client can see: for each unit, the groups of values it carries and which values of each follow. What the values are follows from the unit.

The groups follow in the order 0, 1, 2, 3, 5 and then 4: group 4 comes last, each behind the length of its run. A sending end MUST write each group’s length as the number of bytes its run takes.

Each value takes one of two shapes, and the table row naming it says which. Nothing on the wire carries a table, a field name, a width or a shape, so an end that does not already hold the table cannot read a run.

A value that counts is a thirty two bit unsigned integer, and a value with a sign travels as the same thirty two bits. It takes seven bits from each byte, lowest seven first, and the top bit of a byte is set while another byte follows. Five bytes therefore carry anything it holds.

A value that measures takes one of three forms: a single byte of 255 meaning zero; a byte of 254 followed by four bytes; or four bytes on their own. The four bytes are the measure itself, a thirty two bit float, lowest byte first. A sending end MUST write the byte of 254 before a measure whose lowest byte is 254 or 255, and MUST NOT write it before any other. A measure written plain therefore never begins with either, so its first byte says which form it takes.

What settles a reading

A run is a sequence of values with nothing between them, in the order the set bits name them, lowest first.

The bit that names a value means different things for different units. Champions, turrets, minions and units belonging to no side, and buildings each answer to a table of their own, so the same bit in the same group is one value on one unit and another on the next. A sending end MUST write the table the unit it names answers to.

Props answer to a table of their own as well.

Which table a unit answers to follows from the message that put it on the field (see Units). A building, which no message creates, answers to the building table.

A building answers to the building table of the map loaded.

Which batches a client takes

A client answers a batch with TransientAck where it holds every unit the batch names, whether or not it took the values. Ordering says which batches a client takes, and what that requires of a server.

Reading the tables

Each row gives the group and bits that name a value and what the value is.

Each row also gives the shape a sending end writes the value in.

A champion

GroupBitsValueShape
00Gold in handmeasured
01Gold earned in allmeasured
02 to 3Which of the champion’s slots can be cast from, as a set of bits over two wordscounted
04 to 5Which summoner slots can be cast from, as a set of bits over two wordscounted
06Points held for evolving a spellcounted
07Which spells have evolved, as a set of bitscounted
08 to 27What the spell in one slot costsmeasured
10 to 4What the champion is doing, and four kinds of harm it is proof againstcounted
15Damage it deals by strikingmeasured
16Damage its spells deal before modifiersmeasured
17How often it turns a blow asidemeasured
18How often it strikes criticallymeasured
19Armourmeasured
110Spell resistancemeasured
111 to 12How fast health and resource returnmeasured
113How far it strikes frommeasured
114 to 16Flat and percent modifiers on the damage it strikes with, then the flat modifier on its spells’ damagemeasured
117 to 18Flat and percent reduction of the spell damage it takesmeasured
119A multiplier on how fast it strikesmeasured
120A flat addition to how far from the champion an aimed spell’s point is allowed to landmeasured
121A modifier on its cooldownsmeasured
122When its passive’s cooldown ends, as a moment on the match clockmeasured
123How long its passive’s cooldown lasts in allmeasured
124 to 25How much armour it cuts through, flat then as the share left standingmeasured
126 to 27How much spell resistance it cuts through, flat then as the share left standingmeasured
128Life stealmeasured
129Spell vampmeasured
130Crowd-control reductionmeasured
20 to 1How much more armour and spell resistance it cuts through, as the share left standingmeasured
30 to 1Health and resource as they standmeasured
32 to 3Health and resource at their greatestmeasured
34Experiencemeasured
35 to 9Lifetime, and how far the champion seesmeasured
310How fast it movesmeasured
311 to 12Its size, and how wide a path it needsmeasured
313Levelcounted
314 to 16Kills taken from no side, and whether anything is allowed to aim at itcounted

Bit 2 holds which of slots 0 to 3 can be cast from, one bit for each slot, set as a champion learns the spell in it, and bit 4 holds which summoner spells can be cast from, as a mask in which a server sets its bits 4 and 5, one for each summoner slot. Bits 3 and 5 of the group carry zero. Sides and slots numbers the slots.

Bits 8 to 11 carry what the spells in slots 0 to 3 cost. A server sets bits 8 to 27 together and writes zero in bits 12 to 27. It leaves bits 6 and 7, and group 1 bit 31, clear.

A server writes 0x800007 in group 1 bit 0.

What a client shows from this table

A client shows, for a champion:

  • its health and resource bars, as they stand (group 3 bits 0 and 1) out of their greatest (bits 2 and 3);
  • its level (group 3 bit 13), on the portrait and over the health bar, together with the spell points that level brings;
  • its gold (group 0 bit 0);
  • in the panel under its portrait, ability power (group 1 bit 6), armour (bit 9), spell resistance (bit 10), movement speed (group 3 bit 10), and attack speed as the champion’s own base attack speed times group 1 bit 19;
  • in its panel of statistics, group 1 bit 21 as cooldown reduction, its size as a percent whatever its sign; bits 28 and 29 as life steal and spell vamp, and bit 30 as tenacity, each a fraction shown as a percent; and bits 24 and 26 as flat penetration of armour and of spell resistance.

The attack damage the panel under the portrait shows is the client’s own figure for the champion’s level, with group 1 bit 14 added to it and drawn as a bonus.

Until a champion’s first batch arrives, the panel shows figures the client holds for that champion. Once one arrives, it shows the values batches carry, and armour, spell resistance, ability power and movement speed read 0 where no batch has carried them.

Each percent penetration field carries the share of armour or spell resistance left standing, 1 where nothing is cut through. The panel shows what two of them cut through together, as 200 percent less both shares in percent: bit 25 of group 1 with bit 0 of group 2 for armour, and bit 27 of group 1 with bit 1 of group 2 for spell resistance.

A spell’s cooldown lasts its base length times one plus the modifier at bit 21, so a reduction is carried as a negative fraction and the panel shows its size.

Bit 22 sets the countdown a client shows on the champion’s passive. It is a moment on the match clock (see Time), in seconds, on the same clock as the time a ClockSync carries, and not the time left: 120 at the opening of a match starts the countdown from 2:00. Once that moment has passed, the passive shows ready. Bit 23 is how long the whole cooldown lasts, in seconds, and a client shades the passive’s icon by the time left over that length; the countdown itself follows bit 22 alone.

A turret

GroupBitsValueShape
10 to 1Resource at its greatest, then as it standsmeasured
12 to 6What the turret is doing, and four kinds of harm it is proof againstcounted
17Damage it deals by strikingmeasured
18Armourmeasured
19 to 14Spell resistance, the modifiers on its damage, and how fast health returnsmeasured
30 to 1Health as it stands, then at its greatestmeasured
32 to 3How far it seesmeasured
34How fast it movesmeasured
35Its sizemeasured
50 to 1Whether anything is allowed to aim at it, and which side iscounted

Where a server raises a turret’s health at its greatest, it raises health as it stands to the same value.

A minion, and a unit belonging to no side

Both answer to one table.

GroupBitsValueShape
10 to 1Health as it stands, then at its greatestmeasured
12 to 4How long it lives, as it stands and at its greatest, and the count of thatmeasured
15 to 6Resource at its greatest, then as it standsmeasured
17 to 11What the unit is doing, and four kinds of harm it is proof againstcounted
112Damage it deals by strikingmeasured
113 to 31Its defences and the modifiers on themmeasured
30 to 1How far it seesmeasured
32How fast it movesmeasured
33Its sizemeasured
34 to 5Whether anything is allowed to aim at it, and which side iscounted

A building

Inhibitors and nexuses, each named by the identifier Objects and identifiers gives its name. Where a server replicates a map’s buildings, it sends these two groups and nothing else. On map 8 it replicates none.

GroupBitsValueShape
10A health figuremeasured
11Whether the building is proof against harmcounted
50 to 1Whether anything is allowed to aim at it, and which side iscounted

The health figure does not follow the building’s health. A server SHOULD send an inhibitor’s as 4000 on maps 1 and 11 and 3000 on map 10, a nexus’s as 5500 on those three, and every building’s as 0 on map 12. A server SHOULD NOT change it, even as a building is destroyed. A server first names a building in the EnterSight that brings it into a side’s sight.

A prop

A server need not replicate a prop’s values. Where it does, they follow the table below.

GroupBitsValueShape
10 to 1Health as it stands, then at its greatestmeasured
12Whether the prop is proof against harmcounted
30 to 1How far it seesmeasured
32How fast it movesmeasured
33Its sizemeasured
34 to 5Whether anything is allowed to aim at it, and which side iscounted

Values stated outside a batch

Besides its batches, a server states some values with messages of their own.

A server grants experience with ExperienceGained and gold with GoldGained.

A server can send the gold a unit earns to another with GoldRedirect. A level gained is LevelUp, which on its own is enough for a client to show the new level on its champion’s portrait. A server sets a champion’s tallies for the scoreboard with ChampionStats. A server can also add to a unit’s shield (ShieldAdded), change how its health bar or resource bar is shown (HealthBar, ResourceDisplay), change the sort of resource it has (ResourceKindChanged), set the highest level a champion reaches (LevelCap), and count minions killed, scores and deeds (MinionKillCount, ScoreAdded, StatisticIncremented).

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

Replication

What a server sends to say what has changed about units a client can see. It is the most frequent thing a server sends. The header names no object: a server writes zero.

Definition.

In every range of this book

BuildsCommandCarried
4.1–4.10195on transient, sent by the server, unreliable
4.11–4.17196on transient, sent by the server, unreliable
4.18–4.20196on transient, or on events reliable, sent by the server, unreliable
FieldTypeWhat it is
syncIdu32Names this batch of changes. Replication says which batches a client takes values from.
unitCountu8How many units follow.
unitscount in unitCount × Replication
Vectors (10)

group-four-on-4-10, one-on-4-10, group-four-on-4-17, one-on-4-17, a-later-group-on-4-20, group-four-on-4-20, on-the-events-channel-on-4-20, on-the-transient-channel-on-4-20, one-group-on-4-20, several-groups-on-4-20

TransientAck

What a client sends to say a batch of changes arrived, naming which batch. The header names no object: it carries zero.

Definition.

In every range of this book

Carried on requests, sent by the client, unsequenced, under these commands:

BuildsCommand
4.1–4.10167
4.11–4.20168

It is sent for a batch whose values the client dropped as well as for one it took.

FieldTypeWhat it is
syncIdu32Which batch is being acknowledged, as the batch named itself.
Vectors (4)

first-on-4-10, one-on-4-10, one-on-4-17, first-on-4-20

GoldGained

What a server sends to show a unit gaining gold. The header names the unit whose death earned the gold, as source does.

Definition.

In every range of this book

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

It grants the unit gold.

FieldTypeWhat it is
unitu32The unit granted it.
sourceu32What it came from, or zero where nothing did.
amountf32How much.
Vectors (3)

one-on-4-17, another-on-4-20, one-on-4-20

ExperienceGained

What a server sends to say a unit gained experience. The header names no object: a server writes zero.

Definition.

In every range of this book

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

FieldTypeWhat it is
unitu32The unit granted it.
amountf32How much.
Vectors (3)

one-on-4-17, another-on-4-20, one-on-4-20

GoldRedirect

What a server sends to send the gold a unit earns to another. The header names the unit.

Definition.

In every range of this book

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

FieldTypeWhat it is
targetu32The unit that receives the gold.
Vectors (2)

one-on-4-17, one-on-4-20

LevelUp

What a server sends when a unit gains a level. The header names the unit this is about. On its own, with no replication behind it, it is enough for a client to show the new level on the champion’s portrait and offer the unspent points.

Definition.

In every range of this book

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

BuildsCommand
4.1–4.1062
4.11–4.2063
FieldTypeWhat it is
levelu8The level now reached.
pointsToSpendu8How many spell points are left unspent.
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

ChampionStats

What a server sends to set a champion’s tallies for the scoreboard. The header names the champion.

Definition.

In 4.1–4.17

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

BuildsCommand
4.1–4.1069
4.11–4.1770
FieldTypeWhat it is
sizeu32The whole length of what follows the header, these four bytes included, as a whole 32-bit count. A mismatch has no effect, and does not limit what a client takes.
valuesbytes, sized by size minus 4One value per tally of the match’s mode, the tallies in ascending byte order of their names. An int takes 4 bytes, a float 4, a bool 1, a 64-bit int 8, and text a 16-bit length below 255 then that many bytes. Bytes left over have no effect. A nonzero count of champion kills marks first blood taken.
Vectors (2)

one-on-4-10, one-on-4-17

In 4.18–4.20

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

FieldTypeWhat it is
sizeu32The whole length of what follows the header, these four bytes included, as a whole 32-bit count. A mismatch has no effect, and does not limit what a client takes.
valuesbytes, sized by size minus 4The figures themselves, one after another with nothing between. Which they are comes from the client’s own data for the match’s mode. In a classic match there are 76, in this order: assists, inhibitors destroyed, champion kills, consumables bought, double kills, experience (f32), own inhibitors lost, own nexus lost, own turrets lost, gold earned (f32), gold spent (f32), nexus destroyed, player id, the items in slots 0 to 6, items bought, killing sprees, largest critical strike (f32), largest killing spree, largest multikill, level, longest time alive (f32), magic damage dealt (f32), magic damage to champions (f32), magic damage taken (f32), minions killed, name (text), neutral monsters killed, monsters killed in the enemy’s jungle, monsters killed in the side’s own jungle, never entered the game, deaths, penta kills, physical damage dealt, to champions and taken (f32 each), ping, quadra kills, sight wards bought, skin, casts of spells 1 to 4, casts of summoner spells 1 and 2, epic monsters killed, side, a teammate never entered the game, time since the last disconnection (f32), time played (f32), time disconnected (f32), total damage dealt, to champions and taken (f32 each), total healing, crowd control dealt (f32), time dead (f32), units healed, triple kills, true damage dealt, to champions and taken (f32 each), turrets destroyed, unreal kills, vision wards bought, wards destroyed, wards placed, away from the keyboard, away after a failed surrender, and win (text). Every one not marked otherwise is an i32; a text is a 16-bit length and that many bytes, at most 63, with nothing to end it. ARAM, First Blood and One for All leave out the two jungle counts. The tutorial also leaves out never entered the game, sight wards bought, a teammate never entered the game, crowd control dealt, the three true damage figures, vision wards bought, wards destroyed, wards placed and away after a failed surrender. Dominion and Ascension have 75, in this order: assists, champion kills, combat score (f32), consumables bought, double kills, experience (f32), gold earned (f32), gold spent (f32), player id, the items in slots 0 to 6, items bought, killing sprees, largest critical strike (f32), largest killing spree, largest multikill, level, longest time alive (f32), magic damage dealt, to champions and taken (f32 each), minions killed, name (text), neutral monsters killed, never entered the game, node captures, node capture assists, node neutralizations, node neutralization assists, deaths, objective score (f32), penta kills, physical damage dealt, to champions and taken (f32 each), ping, quadra kills, sight wards bought, skin, casts of spells 1 to 4, casts of summoner spells 1 and 2, side, a teammate never entered the game, team objective, time since the last disconnection (f32), time played (f32), time disconnected (f32), total damage dealt, to champions and taken (f32 each), total healing, total score (f32), total score rank, crowd control dealt (f32), time dead (f32), units healed, triple kills, true damage dealt, to champions and taken (f32 each), unreal kills, victory points (f32), vision wards bought, away from the keyboard, away after a failed surrender, and win (text).
Vectors (2)

another-on-4-20, one-on-4-20

ShieldAdded

What a server sends to add to a unit’s shield. The header names the unit.

Definition.

In every range of this book

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

BuildsCommand
4.1–4.10101
4.11–4.20102

Both physical and magical set adds amount to the shield that takes either kind of damage; one of them, to that kind’s shield; neither, to nothing. A negative amount lowers it, and any shield left below 0.001 becomes zero. noFade clear does not restart a fade already stopped.

FieldTypeWhat it is
flags1-byte bitsWhich shield.
flags.physicalbit 0Set where the shield turns aside physical damage.
flags.magicalbit 1Set where it turns aside magical damage. Both set means either.
flags.noFadebit 2Set where the shield does not fade.
flags.unusedbit 3 to 7Unused; a server writes zero.
amountf32How much is added.
Vectors (4)

another-on-4-10, one-on-4-10, one-on-4-17, one-on-4-20

HealthBar

What a server sends about a unit’s health bar. The header names the unit.

Definition.

In 4.1–4.19

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

BuildsCommand
4.1–4.10205
4.11–4.19206
FieldTypePresent whenWhat it is
flags1-byte bitsWhat changes.
flags.showbit 0Set to show the bar, clear to hide it.
flags.changeTypebit 1Set where the bar’s type changes; the type and side below apply only then.
flags.unusedbit 2 to 7Unused; a server writes zero.
barTypeu8flags.changeType setWhich sort of bar, applying only where changeType is set and side is the client’s player’s side or zero: 1 a unit’s, 2 a champion’s; any other value only makes sure the unit has a bar.
sidei32flags.changeType setThe side that sees the change, or 0 for every side.
Vectors (4)

another-on-4-1, one-on-4-1, another-on-4-11, one-on-4-11

In 4.20

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

FieldTypePresent whenWhat it is
flags1-byte bitsWhat changes.
flags.showbit 0Set to show the bar, clear to hide it.
flags.changeTypebit 1Set where the bar’s type changes; the type and side below apply only then.
flags.unusedbit 2 to 7Unused; a server writes zero.
barTypeu8Which sort of bar, applying only where changeType is set and side is the client’s player’s side or zero: 1 a unit’s, 2 a champion’s; any other value only makes sure the unit has a bar.
sidei32flags.changeType setThe side that sees the change, or 0 for every side.
Vectors (1)

one-on-4-20

ResourceDisplay

What a server sends to change how a unit’s resource bar is shown. The header names the unit.

Definition.

In every range of this book

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

BuildsCommand
4.1–4.10146
4.11–4.20147
FieldTypeWhat it is
unusedu32Unused; its bytes carry no meaning. The header names the unit.
statei32Which way the resource is shown; a client sets the unit’s resource bar by it, and what each value looks like depends on the unit’s own data.
Vectors (4)

another-on-4-10, one-on-4-10, one-on-4-17, one-on-4-20

ResourceKindChanged

What a server sends to change what sort of resource a unit has, which its bar’s colours and art follow. The header names the unit.

Definition.

In 4.1–4.10

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

FieldTypeWhat it is
kindu8The kind. A client knows 0 to 11, and takes any higher value as none. Values: 0 mana, 1 energy, 2 none, 3 shield, 4 battleFury, 5 dragonFury, 6 rage, 7 heat, 8 ferocity, 9 bloodWell, 10 wind, 11 other.

In 4.11–4.20

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

FieldTypeWhat it is
kindu8The kind. Values: 0 mana, 1 energy, 2 none, 3 shield, 4 battleFury, 5 dragonFury, 6 rage, 7 heat, 8 gnarFury, 9 ferocity, 10 bloodWell, 11 wind, 12 other.
Vectors (2)

one-on-4-17, one-on-4-20

LevelCap

What a server sends its player’s champion to set the highest level it can reach. The header names the champion.

Definition.

In every range of this book

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

FieldTypeWhat it is
capu8The highest level; zero restores the usual 18.
Vectors (2)

one-on-4-17, one-on-4-20

MinionKillCount

What a server sends to add one to a champion’s count of minions killed. The header carries zero.

Definition.

In 4.3–4.20

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

FieldTypeWhat it is
championu32The champion.
Vectors (2)

one-on-4-17, one-on-4-20

ScoreAdded

What a server sends to add to a player’s score. The header names no object: a server writes zero.

Definition.

In every range of this book

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

BuildsCommand
4.1–4.10216
4.11–4.20217

A client ignores the message where player names no champion it holds.

FieldTypeWhat it is
championu32The champion whose score it is.
categoryu8Which part of the score. Values: 0 offense, 1 defense, 2 combat, 3 objective.
eventu8What earned it.
flags1-byte bitsHow it is shown.
flags.calloutbit 0Set where the client announces it.
flags.unusedbit 1 to 7Unused; a server writes zero.
pointsf32How much is added.
Vectors (3)

objective-on-4-1, objective-on-4-11, objective-on-4-20

StatisticIncremented

What a server sends to add one to a champion’s count of a deed, as counted for the end of a match. Nothing shows at once. A client ignores it where the id names no champion. The header carries zero.

Definition.

In every range of this book

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

BuildsCommand
4.1–4.10217
4.11–4.20218
FieldTypeWhat it is
championu32The champion.
statisticu8Which count. A value past those named has no defined effect. Values: 0 pointCaptured, 1 pointNeutralised, 2 killWhileAttackingPoint, 3 teamObjective, 4 defendedPointNeutralised, 5 killWhileDefendingPoint, 6 timeDefendingPoint, 7 lastStand, 8 captureAssist, 9 neutraliseAssist.
Vectors (4)

another-on-4-10, one-on-4-10, one-on-4-17, one-on-4-20

GoldEarned

What a server sends about gold a champion earned. The header carries zero.

Definition.

In every range of this book

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

BuildsCommand
4.1–4.10227
4.11–4.20228

A server sends it to clients watching a match. It credits the champion with the gold.

FieldTypeWhat it is
owneru32The champion credited.
amountf32How much gold. 0.95 is what a champion earns for each step it stands still.
Vectors (4)

another-on-4-10, one-on-4-10, one-on-4-17, one-on-4-20

GoldSourcesLog

What a server sends to carry a text to a client. It changes nothing a client shows. The header carries zero.

Definition.

In every range of this book

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

FieldTypeWhat it is
lengthu32How many bytes of text follow. Zero, or a value above 2147483647, carries no text.
texttext, sized by lengthThe text, with no terminating zero. A client looks each word up in its own text and writes the result a line at a time.
Vectors (2)

one-on-4-17, one-on-4-20

MultikillCount

What a server sends a client watching a match to state a champion’s run of kills. The header carries zero.

Definition.

In every range of this book

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

FieldTypeWhat it is
owneru32The champion.
countu8How many kills in the run.
Vectors (2)

one-on-4-17, one-on-4-20

StatTick

What a server sends to advance every unit’s stats by a span of time. The header carries zero.

Definition.

In every range of this book

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

BuildsCommand
4.1–4.1039
4.11–4.2040

A client takes it and changes nothing it shows.

FieldTypeWhat it is
secondsf32The span, in seconds.
Vectors (3)

one-on-4-10, one-on-4-17, one-on-4-20