
Determinism in League of Legends: Unified Clock - ingve
https://engineering.riotgames.com/news/determinism-league-legends-unified-clock
======
marknadal
This is a fantastic article! I built something similar a few years ago, except
I couldn't rely on a centralized server. So I had to come up with a
P2P/decentralized variant of it.

There is a test page up for it, so you can test it out in practice across
multiple devices to see how precise (not accurate) it is:
[https://gunjs.herokuapp.com/game/nts.html](https://gunjs.herokuapp.com/game/nts.html)

Turns out the math/algorithm isn't too hard! Less than 50LOC for full
implementation:
[https://github.com/amark/gun/blob/master/nts.js](https://github.com/amark/gun/blob/master/nts.js)

I recommend you have fun and challenge yourself to solve it first before
looking at the code! It made me really understand General Relativity spacetime
so much more, it clicked.

------
kenning
The idea of riot games posting an engineering article is funny to me. They're
famous among their own players for having a very buggy platform, and handling
time between framerates is one of the earlier things you learn in game
development.

I find it believable but sad that there were apparently eight different
implementations of this idea across the codebase. I am not surprised that the
developer had to add an ascii skull and crossbones to his code to encourage
others not to change it.

~~~
holtalanm
> They're famous among their own players for having a very buggy platform

lolwut? Back when I used to play LoL, there was almost -zero- bugs in the
actual game.

Are you sure you're not confusing this with their shitty Adobe Air client
(which does not run the actual game, which is a separate process).

I will append a disclaimer: Have not played LoL in years. So if it has
changed, feel free to tell me so.

~~~
hood_syntax
Lux's ultimate ability used to be (still is?) made of invisible minions.

Mordekaiser at one point in history had over 50 known bugs. (apparently over
200 according to another commenter)

Some champs could walk through Jarvan's ultimate.

There were others but those are the cases that stand out in my memory. I know
you'll probably say something like "three bugs? that's nothing!" but I played
the game off and on for 6 years from 2009-2015 and there were plenty of
examples of stuff like that.

~~~
Bartweiss
LoL was at minimum _distinctively_ buggy. It wasn't the "gamebreaking
bullshit" approach of e.g. Sim City, but it was jarring and frequent. There
seemed to be two major problems.

The first was a reliance on kludges in new code (like that Lux ult) - it was
the distinctive look of a team trying to put out new features faster than
their dev time permitted.

The second was an inability to rely on invariants. Most games can say "X is
always true, Y is always true except in case Z" and maintain that even across
many and expansions. League (and other MOBAs) relied on putting out new
characters with novel, interesting abilities. But that leaves game design and
software design in conflict; a major source of novelty is breaking rules other
characters share. And so _everyone_ has some silly special case that makes all
other development harder, and also reveals the kludges in problem one.

Mordekaiser can copy dead units, so every single unit has to be checked to not
break when he does that. Lux ults are made of minions, so every character with
a "dash to minion" ability has to be safeguarded against dashing to the ult.
And so on, for characters^2 interactions.

Things are vastly better than they used to be, but it's not a surprise the
thing got a reputation for bugginess.

------
brettmburk
Anywhere else I can read this? Blocked at work

~~~
bpicolo
perhaps
[http://webcache.googleusercontent.com/search?q=cache:https:/...](http://webcache.googleusercontent.com/search?q=cache:https://engineering.riotgames.com/news/determinism-
league-legends-unified-clock)

