Welcome to the Forum Archive!

Years of conversation fill a ton of digital pages, and we've kept all of it accessible to browse or copy over. Whether you're looking for reveal articles for older champions, or the first time that Rammus rolled into an "OK" thread, or anything in between, you can find it here. When you're finished, check out the boards to join in the latest League of Legends discussions.


Solution for excess delay between (re)casts of low cooldown/multi-part abilities

Comment below rating threshold, click here to show it.




Not sure if this is the right forum for this, but here goes. Right now there's a problem with casting certain skills. It exists to some degree at all pings, but is particularly noticeable with high latency levels. I've seen quite a few posts complaining about the problem but nothing on how Riot could fix it. This post is meant to change that.

What is the problem?

It seems like spell casting currently works like this:

0. Player presses the button to give the cast order.
1. The client checks whether conditions allow for the spell cast (Is it off cool down? Has the projectile finished moving?)
2. The order is sent to the server.
3. The server resolves the order and if the spell is successfully cast, places the spell on a cool down in the server's game state, and sends a message to update the client's game state accordingly.
4. Once the client receives this message, the spell is put on a cool down/deactivated in the client's game state. A new order to give the spell cannot be sent until this cool down has finished or the spell is reactivated.

A consequence of this is that under ideal network conditions, the minimum time between spell cast orders being sent is equal to the sum of the cool down and the player's ping. This means time between actual spell casts ends up being equal to or greater than this value (depending on things like chasing/moving into range, and whether these factors are compensated for by the player). Basically this means that abilities cannot be cast as quickly as intended.

This effect is particularly noticeable with low cool down abilities like Karthus/Cass Qs. A similar effect is observed with abilities that have multiple activations such as Riven's Q or Lux's and Gragas' detonation abilities. Currently with these abilities, it seems that once the client receives confirmation that the ability has been cast, the ability gets disabled until the client receives confirmation that the second part of the ability is ready.

How can it be fixed?

A solution to both of these effects would be to use the 'client cool down' only for displaying the cool down in the HUD, and not for determining whether or not an ability is able to be cast at a particular time. Instead, all checks on casting conditions should be performed only at the server.

The only complication I can think of with this would be the idea that it would require a change in how cast orders are sent to the server (ie: with the Lux example, having to send 'cast E skill' orders instead of 'launch projectile' and 'detonate projectile'). However testing reveals that, in Lux's case at least, the 'cast E skill' type of orders are already sent, so this style of casting is already possible.

Using smartcasted E on Lux, you can double tap the skill button (before the deactivation step 4 above is performed) in order to queue up the next part of the ability. Sending a new order before the second stage of the ability is ready will cancel this queue, so it is clear that double tapping in this case sends two 'cast E ability' orders instead of a single 'launch and immediately detonate E ability' order. ie: The code for this solution already exists in the game. It just hasn't been implemented fully.

What will this change?

This will eliminate the effect described above where successive spell casts are inevitably performed at a slower rate than the cool down dictates, and skill reactivation has delays introduced by network latency.

In the Gragas' barrel roll example, this will:
*Allow Gragas' barrel to be exploded as soon as it finished moving if it is micro'd correctly.

*Make the time between seperate barrel throws equal to the cooldown of the ability.

This will not:
*Remove the delay between the player telling Gragas to throw a barrel and Gragas throwing the barrel.

*Allow Gragas to throw a second barrel before it comes off cooldown.

*Allow Gragas to detonate his barrel immediately while performing other tasks without giving the orders in a specific... order.

ie. Repeated activations of a multi-part ability will queue in the same way as rapid casts of different abilities already queue.

tl;dr: Check whether an ability is able to be cast at the server side only to eliminate the delays between casts of low cool down skills and different parts of repeated activation skills that are caused by lag. The code for implementing this is already used in the game and it will not allow abilities to be cast more quickly than intended.

Comment below rating threshold, click here to show it.


Senior Member


While this would solve the issue you want to solve, it might cause other issues. A lot more data would be sent to the sever. That means bandwidth. And that data needs to be processed. That means processing time. It's small optimizations like this (preventing wasteful data when possible) which make server-hosted games feasible.

Now, I obviously have no knowledge of Riot's servers, so this is just conjecture, but it's something to think about.