Original Post — Direct link
over 5 years ago - /u/RiotLtRandolph - Direct link

Originally posted by VeryExtraSpicyCheese

It wasn't random, the dash (and all others previous to season 4) were coded linearly in the xy plane, but Lee's dash followed the target like a parabola if the target moved. In order to make it appear that Lee was curving he had to travel in a straight line over and over updating every time the server ticked over, and there was a chance that he could be hit by skillshots in that path. This "bug fix" changed dash tracking to be able to curve without starting a new path.

Close. Actually the parabola part didn't play a part. What actually occurred is that, when you're dashing to another unit (for reasons I cannot fathom) you arrive at a random short distance from them. If you started your dash at a closer distance than that random short distance, but not exactly on top of them, some funny math happens.

In order to smooth the arrival (again, for reasons that I cannot fathom), the two distances are divided by each other to come up with a speed scaling factor. Unfortunately, that can lead to dividing a larger number by a smaller number. Sometimes a much smaller number. So for a single frame of simulation, Lee (or Irelia, Jax, Yuumi, etc.) could report that they're going hyperspeed. Like cross Summoner's Rift in a tenth of a second fast.

Then, in the area trigger/missile collision, we ask "hey, where were you last frame" so we can do "capsule collision" (pretty standard game collision technique). In order to compute that, Lee says, "Well, I'm going super ridiculously fast, so apparently I was waaaaaaay the f*ck over there."

The fix was to take the min of the scaling factor (from dividing the distances) and 1, to make sure that we're not blowing our speed way out of proportion.

over 5 years ago - /u/RiotLtRandolph - Direct link

Originally posted by RiotLtRandolph

Close. Actually the parabola part didn't play a part. What actually occurred is that, when you're dashing to another unit (for reasons I cannot fathom) you arrive at a random short distance from them. If you started your dash at a closer distance than that random short distance, but not exactly on top of them, some funny math happens.

In order to smooth the arrival (again, for reasons that I cannot fathom), the two distances are divided by each other to come up with a speed scaling factor. Unfortunately, that can lead to dividing a larger number by a smaller number. Sometimes a much smaller number. So for a single frame of simulation, Lee (or Irelia, Jax, Yuumi, etc.) could report that they're going hyperspeed. Like cross Summoner's Rift in a tenth of a second fast.

Then, in the area trigger/missile collision, we ask "hey, where were you last frame" so we can do "capsule collision" (pretty standard game collision technique). In order to compute that, Lee says, "Well, I'm going super ridiculously fast, so apparently I was waaaaaaay the f**k over there."

The fix was to take the min of the scaling factor (from dividing the distances) and 1, to make sure that we're not blowing our speed way out of proportion.

The key for me to debug it was when our QA pointed out to me that it always was behind the dashing unit. Thus I rescripted Caitlyn trap to spawn like 50 traps in a circle around where she casts it, and encircled Lee as he repeatedly dashed at blue buff. The bug would happen every 20 seconds or so, letting me set breakpoints and figure out where the bogus values were coming from.