Fun fact: Basic attack range effectively has a random variance.

Khristophoros··26 votes·1,779 views

I didn't post about this when I first discovered it but it's interesting so why not?

Before you read this, please understand that this is a difficult technical limitation and it might not be feasible for Riot to "fix" it. Also, I have a video that shows the effect exaggerated by high movement speed so understand that it's typically not as bad as the demonstration video.

Remember when Klepto had a hidden +25 range buff? When I heard about that I had to test to see if it was true and I found something more interesting. Sometimes after issuing an attack out of range and then using the Klepto attack my character would not need to move closer even though the first attack was made at +25 range. So the character walked into range to attack at +25, but then didn't need to move any closer. What was up with that?

Additional testing revealed that the actual range you will walk into after issuing an attack has a random variance to it. It was possible to position the character exactly so that after using the increased range attack, the character needed to move closer. So that meant that sometimes when moving into range the champion would move closer than required.

Why is it random? This is my theory: The game processes at a certain framerate. When you issue an attack command it will check if you're in range. If you are in range then you attack, otherwise your champ will start pathing to the target. Each frame it will check the range again. That means between each frame you will move a certain distance. Most likely you will end up closer than your actual attack range when the time comes that you are in range. Between the previous frame and the current frame you will have moved farther than needed.

This pretty much always happens unless you're already in range.

The processing framerate is apparently pretty low because the variance appears to be pretty big if you test it a bit. If the processing framerate was 30 FPS and you had 350 movement speed you would be moving ~11 units of distance every frame, so the variance would only be about that much. It feels to be more like 40 or 50 though. That suggests a processing framerate somewhere in the range of like 10-15 FPS. Also, the fact that "just-frame" situations are strangely common in LoL also suggests a low processing framerate.

This probably has significant effects on the game but probably can't be changed due to technical limitations.

Here is a video demonstration: https://puu.sh/zRKFK/de9007b265.mp4

I used Teemo because his high movement speed makes the effect easier to see. When I queue an attack at the dummy with my speed boosts activated I moved I'd guess about 150 distance closer than Teemo's actual attack range. I was able to carefully move back and find his real attack range after that. Notice that for any attack queued from out of range, I moved a little closer than Teemo's actual range. The actual range is a little bigger than the circle because of bounding boxes, and that is also demonstrated here when I move back slightly and am still able to attack.

29 Comments

HalcyonDweller3 votes

This happens to me every time I'm chasing the fucking Scuttle Crab through the river, I go to make attacks and he moves just out of range so that the attack can't start and I end up even farther away, then I have to chase the fucker down again and keep trying.

Quil Evrything2 votes

its not about fps, its about your ping, and your lag. and animation delay.

sometimes the game counts a shot as being fired, before you see the animation acknowleging that you ahve fired a shot.

Khristophoros6 votes

[{quoted}](name=Quil Evrything,realm=NA,application-id=3ErqAdtq,discussion-id=nEa4X16s,comment-id=0001,timestamp=2018-03-29T07:04:23.403+0000)

its not about fps, its about your ping, and your lag. and animation delay.

sometimes the game counts a shot as being fired, before you see the animation acknowleging that you ahve fired a shot.

No. The game is processed entirely serverside. The server tracks your location and determines when you are in range to attack.

Your game just sends commands like "hey I want to issue an attack on this" or whatever

And by framerate I am not talking about graphics framerate. The game server processes what happens in a discrete interval. That is the processing framerate. It is locked at a certain value (probably like 15 like I said) and whatever graphics framerate your game is running at is not related to this.

FurriesAreHot7 votes

I think “tickrate” is the proper term over frame rate, since Framerate is called that because every picture or “frame” is strung together at a certain “rate” to create an animation.

Velzard of Koz2 votes

Strange, it nearly looks as If it checked whether target hitbox crosses with your attack range rather than whether its center is inside. Interesting observation.

Khristophoros3 votes

[{quoted}](name=Velzard of Koz,realm=EUNE,application-id=3ErqAdtq,discussion-id=nEa4X16s,comment-id=0006,timestamp=2018-03-29T20:19:19.913+0000)

Strange, it nearly looks as If it checked whether target hitbox crosses with your attack range rather than whether its center is inside. Interesting observation.

This is a separate thing that's been known for years.

Basic attacks use edge-to-edge of the bounding boxes of the attacker and target. Most targeted abilities are center-to-center.

Dysnomia1 votes

I guess it has to do with "channeled" thing, like when you use ability like Sivir Q, you could flash and extend the range of it. Same with autoattacks, if you have high movement speed you "moved" your position at the moment of autoattacking.

Khristophoros2 votes

{quoted}

I guess it has to do with "channeled" thing, like when you use ability like Sivir Q, you could flash and extend the range of it. Same with autoattacks, if you have high movement speed you "moved" your position at the moment of autoattacking.

This is a different thing. You can flash after activating an ability and the game will allow the ability to complete.

What I'm talking about here has to do with the framerate of the game. When you have an attack or ability queued up it will not activate until you are in range, but the game processes on a discrete interval (framerate) so inevitably you will move slightly closer than the actual range in between the frames.

Let's say on frame 1 you are not in range, so your character moves this frame. If you have 350 MS and the processing framerate is 15 FPS then you will move 350/15 = 23.3 distance. Frame 2 you are now in range, but you probably moved farther than needed. If the range you needed to move was 10, then you moved 23.3 - 10 = 13.3 extra distance.

Ifneth1 votes

Maybe Riot should raise the frame-rate, then? This sounds like it could affect professional play.

Khristophoros2 votes

{quoted}

Maybe Riot should raise the frame-rate, then? This sounds like it could affect professional play.

I doubt that it's a simple thing to do. Also if the server is running games at a higher framerate it takes more processing power so it would cost more money.

Starcraft243ver1 votes

I've already seen this behaviour in some other games, one of the possible reasons behind this is when you attack move, or target attack someone, checks in the code are probably the following :

  • Check if in range of attacking
  • Yes : Try to Attack
  • No : Move distance d.

Most of time to prevent your champion to stop - cancel auto - move - stop - cancel auto - it moves a bit closer than required to hit the target. So even when it loses the bonus range, it can keep attacking, as long as the target has not moved too far away.

Also for performances issues, the check is not run each frame.

There can also be the fact you dont actually see the true hitbox of your champion, maybe it's not a perfect circle.

Khristophoros1 votes

{quoted}

I've already seen this behaviour in some other games, one of the possible reasons behind this is when you attack move, or target attack someone, checks in the code are probably the following :

  • Check if in range of attacking
  • Yes : Try to Attack
  • No : Move distance d.

Most of time to prevent your champion to stop - cancel auto - move - stop - cancel auto - it moves a bit closer than required to hit the target. So even when it loses the bonus range, it can keep attacking, as long as the target has not moved too far away.

There can also be the fact you dont actually see the true hitbox of your champion, maybe it's not a perfect circle.

Nope you've got it wrong. Think of movement as a series of tiny teleports. It is graphically smoothed so that you don't notice.

It's not "move distance d", it's "this frame, move towards the attack target at full movement." which really means, your position will be instantly moved x distance closer where x is your MS stat divided by the processing frame rate.

non-attack movement works differently because the exact destination is known. So on the final frame before you arrive it will move you a shorter distance to arrive at the exact position you requested.

An attack order cannot assume an exact destination because your target might also move on the current frame. So it just checks if you're in range, and if you are not in range then you will move your full movement on the current frame. Your full movement being your MS stat divided by the processing frames per sec.

If the game tries to place you exactly on the edge of your range on the current frame, but your target also moves away on the current frame, then the next frame when you should be able to attack you will not be in range anymore and you will not be able to attack.

So the point is that on an attack order, your movement is not allowed to be any more accurate than the full amount you move per frame and this ensures that you will be able to attack if you get in range of a fleeing target.

edit: Upon closer inspection maybe we're saying the same thing. Sorry.

Starcraft243ver1 votes

edit: Upon closer inspection maybe we're saying the same thing. Sorry.

Np, maybe I was oversimplifying the process.

Starcraft243ver1 votes

Can you try to clic very fast on your target and see if each clic refreshes the test on "Am i in range of attacking ?", and so your champion stops at the limit range instead of getting closer than needed ? (i'm at work, so I can't try it now).

Furious Delisha1 votes

But this is how the code works for basically every game...

What do you propose instead?

Khristophoros1 votes

[{quoted}](name=Furious Delisha,realm=NA,application-id=3ErqAdtq,discussion-id=nEa4X16s,comment-id=000300000002,timestamp=2018-03-29T15:01:54.875+0000)

But this is how the code works for basically every game...

What do you propose instead?

I don't propose that they change it. It's just something we have to deal with.

SanKakU1 votes

What if the other target were a Teemo? Could we somehow guarantee that your Teemo is standing where it appears to be standing?

I assume there is no error with the display of where your Teemo is at, but it's dangerous to assume such things.

This reminds me of the randomly inaccurate skill shots, which are only inaccurate visually, which means it's impossible for opponents to dodge at random times and difficult for allies to predict you landing it.

Khristophoros1 votes

{quoted}

What if the other target were a Teemo? Could we somehow guarantee that your Teemo is standing where it appears to be standing?

I assume there is no error with the display of where your Teemo is at, but it's dangerous to assume such things.

This reminds me of the randomly inaccurate skill shots, which are only inaccurate visually, which means it's impossible for opponents to dodge at random times and difficult for allies to predict you landing it.

There is some unavoidable desync between client and server. In my video if you look closely after my first attack, my position changes ever so slightly. I believe this was the client correcting the position after receiving an update from the server. The client has to make a bunch of assumptions to make the game feel more realtime and then it makes tiny adjustments moments later as it gets better information from the server.

If you got hit by a skillshot that looked whack it's because of this slight desync which affects your position, the position of the skillshot, and the timing of the skillshot. The game can only do so much to mitigate or hide latency and even something as small as 30ms can potentialy make something look whack.

But ultimately the game state on the serverside is the correct game state.

SanKakU2 votes

How much ms do you have to the LoL servers? I consistently have about double that of 30 ms. The error I mentioned has nothing to do with where champions are. I tested it by going into a practice mode game and just throwing Blitzcrank's Q all around me. It's absurd to tell me that this same visual inaccuracy is due to lag.

Khristophoros1 votes

{quoted}

How much ms do you have to the LoL servers? I consistently have about double that of 30 ms. The error I mentioned has nothing to do with where champions are. I tested it by going into a practice mode game and just throwing Blitzcrank's Q all around me. It's absurd to tell me that this same visual inaccuracy is due to lag.

I play with 60 ms

The point is, the client has to make some guesses about positioning and the server actually has the correct game state.

Well also the hitboxes don't match the visuals exactly. They are usually larger. So there are multiple reasons why skillshots sometimes feel really whack.

SanKakU1 votes

Hitboxes are a different problem from visual inaccuracy of angles of skillshots. Take a look at the maximum distance the skillshot goes, and see the inaccuracies. You can completely 'dodge' things and still get hit by them, while also get 'hit' by something but dodge it. That's not bad hitboxes, that's just visual inaccuracy when displaying the skillshot. I've played a lot of this game, had a lot of time to confirm this.

Khristophoros1 votes

{quoted}

Hitboxes are a different problem from visual inaccuracy of angles of skillshots. Take a look at the maximum distance the skillshot goes, and see the inaccuracies. You can completely 'dodge' things and still get hit by them, while also get 'hit' by something but dodge it. That's not bad hitboxes, that's just visual inaccuracy when displaying the skillshot. I've played a lot of this game, had a lot of time to confirm this.

It's a little bit of everything. The latency adds a tiny bit of inconsistency, the visuals being slightly off or different from the hitbox adds a little, etc... It's not just one thing.

Pierce The Veal1 votes

When Kog used to be able to pass the attack speed limit, you could occasionally get two auto attacks off with rapid fire cannon instead of just one. Fun stuff.

Khristophoros1 votes

{quoted}

When Kog used to be able to pass the attack speed limit, you could occasionally get two auto attacks off with rapid fire cannon instead of just one. Fun stuff.

That must be a "just-frame" thing. That used to happen with spell shields blocking multiple spells on the same frame.

Still happens with a few things here and there.

Pierce The Veal1 votes

I doubt it is a matter of frame, but a matter of attacking fast enough such that the check for rapidfire cannon doesn’t activate soon enough to prevent a second attack.

ahferroin71 votes

My educated guess would be that it's checked every quarter-second, just like CC effects are.

If that is indeed the case, then it's almost certain it can't be changed easily.

Khristophoros1 votes

{quoted}

My educated guess would be that it's checked every quarter-second, just like CC effects are.

If that is indeed the case, then it's almost certain it can't be changed easily.

If it were checked every quarter sec (250 ms) it would be way more extreme.

A 350 movement speed champ moves 87.5 units every 250 ms. The effects would be extremely noticeable even for slow champions.

My observations suggest that it is checked 15 times per sec (every 66.666 ms)

Meep Man1 votes

It depends on your ping mainly, as basically the game is constantly pinging the server to check to see if you are in basic attack range with the other player.

Khristophoros1 votes

[{quoted}](name=Emperor Churger,realm=NA,application-id=3ErqAdtq,discussion-id=nEa4X16s,comment-id=0009,timestamp=2018-03-30T15:30:37.162+0000)

It depends on your ping mainly, as basically the game is constantly pinging the server to check to see if you are in basic attack range with the other player.

No that's not how it works. The server handles everything and sends the client updates on what is happening.

More from Gameplay

More by Khristophoros