Click to open network menu
Join or Log In
Mobafire logo

Join the leading League of Legends community. Create and share Champion Guides and Builds.

Create an MFN Account






Or

's Forum Avatar

Math. Lots of it.

Creator: Chandro October 16, 2011 4:33pm
1 2 3
Chandro
<Member>
Chandro's Forum Avatar
Posts:
53
Joined:
Jun 27th, 2011
Permalink | Quote | PM | +Rep October 16, 2011 4:33pm | Report
Hey all, Chandro here. For those of you who don't know me, I main AD carries; they've interested me since I started playing LoL in beta and, because I played a DPS class character in WoW, the math of their autoattacks has always interested me. As a math nerd roughly 1 year away from a B.A. in mathematics, I've always had a running rough math analysis of the game while playing it, and I wanted to share with you guys my general findings and open this stuff up to further discussion.

Note: As with most things I write about LoL, this is aimed for a slightly higher level. I will not take the time to explain the basics of what a carry is or the notion of farming up a BT (Bloodthirster), so if you are very new to the game, my work is not yet for you. However, if I am unclear to those of you with experience in the game, feel free to say so and I will do my best to clarify.

Note^2: The purpose of this specific thread is to open up the ground level of my work to those of you who are also mathy, and essentially show that I know what I’m talking about and have put a lot of work and thought into this. For the 99.9% of you who don’t want to hear the grueling specifics and would like practical applications, you’ll want to read my applications post which I hope to be able to publish within a week or so.

Introduction


After my first few games of LoL on an open server weekend of the private beta, it occurred to me that DPS in this game could be modeled by some function I could not yet find, DPS(x,y,z)=D(x)S(y)C(z), where the functions D, S, and C would represent some other functions detailing attack damage, attack speed, and critical strike {chance, modifier, coefficient}. Two years and several spreadsheet revisions later, I arrived at an equation involving far more variables than the original 3.

Glossary


DPS=Total Damage per second
D=Attack Damage
S=Attack Speed
Cc=Crit Chance
Cd=Crit Damage
A=Armor (of your target)
P#=Flat Armor Penetration
P%=Percentage Armor Penetration
M=Magic Damage on-hit
Mr=Magic Res (of your target)
Mr#=Flat Magic Penetration
Mr%=Percentage Armor Penetration


The Master Equation


The equation needed to be broken into two separate pieces (for everyone but Vayne, that *****), one for physical DPS and one for magical DPS, which then get added together. The two crit stats do their little dance on the side to make one coefficient, while the two trios of each defensive stat and its two penetration stats work together in Riot’s armor equation to form the bulk of the equation in their two respective parts.
Expressed solely in unmodified variables, the master equation modeling DPS is
DPS=(S)(D)(1+(1+Cd)Cc))(100/((100+(1-P%)(A-P#))))+(S)(M)(100/((100+(1-Mp%)(Mr-Mp#))))
This can also be written as a function for some applications, DPS(S,D,Cd,Cd,P%,A,P#,M,Mp%,Mr,Mp#)=(S)(D(1+(1+Cd)Cc))(100/((100+(1-P%)(A-P#))))+(S)(M)(100/((100+(1-Mp%)(Mr-Mp#)))). The needed difference here being that we are accurately expressing total DPS as a function of 11 independent variables, which is necessary for both of the methods of approach I have used henceforth: Geometry and Calculus.

Note before I move on: There are actually two master equations. Riot’s armor function is calculated in a manner that, as far as I can see, cannot be modeled as a continuous differentiable function, only as two such functions conjoined in a piecewise manner about A=0. A(a)={(100/(100+a)), a>=0; (2-(100/(100+a))), a<0}. As such, theoretical calculations will take place with the equation representing a nonnegative enemy armor value, and applications will have to switch back and forth as needed, which I will discuss in detail at such time.

Geometry: The Intuitive Approach


Geometry time! Since we have seen that DPS can be modeled as the dependent variable output of 11 independent variables, i.e., a differentiable closed function in Euclidean 12-space, R12, calculus-based approaches will hinge off of that fact. However, since it is the 11-dimensional projection of what got me starting on all of this thinking, it’s anecdotally pretty interesting. Imagine, if you can, an 11-dimensional rectangular hyper-prism. If you can’t, just picture a cube. We’re going to pour water (11-dimensional hyper-water) into this hyper-prism with the limitations on each of the 11 dimensions determined by our current AD stats. So, the hyper-water only flows out as wide as our attack damage, as long as our attack speed, as deep as our crit chance, et cetera. Now imagine the FILLED hyper-prism. You may be wondering where the outer walls of this prism would be; good point! Intuitively, they are determined by maximum conceivable stats in-game, attack speed is limited to 2.5, crit chance to 100%, et cetera. The closer our current limitations are to the walls of this hyper-prism, the closer we are to the impossible-to-reach maximum DPS, which would take something like 20 items. However, what we gain from this is the realization that, as is a property of Euclidean Real-spaces of any order k, the greatest-volumed hyperhedron with boundaries limited by linear limits (in our case the limitation of only 6 items plus other minor factors) will be a k-dimensional hyper-cube. What we gain from that is the realization that at any given time, the relative weight of one of our DPS stats is most lacking from reaching a hyper-cube, from this we can always determine what would be our best next item to buy. From here, the calculus kicks in.

Calculus: The Productive Approach


Namely Differential Calculus. Since we have a function on 11 variables, we should be able to find a partial differential of each of those and receive some kind of some form of a differential that may have applications. Unfortunately this raw value will be very… raw, but with appropriate tweaking It can do work for us bearing in mind that a differential value for our enemies’ armor is quite useless to us.
So without any further adieu…
Given DPS=(S)(D)(1+(1+Cd)Cc))(100/((100+(1-P%)(A-P#))))+(S)(M)(100/((100+(1-Mp%)(Mr-Mp#)))),

δS/δDPS=(D)(1+(1+Cd)Cc))(100/((100+(1-P%)(A-P#))))+(M)(100/((100+(1-Mp%)(Mr-Mp#))))
δD/δDPS=(S)(1+(1+Cd)Cc))(100/((100+(1-P%)(A-P#))))
δCc/δDPS=(S)(D)(1+Cd)(100/((100+(1-P%)(A-P#))))
δCd/δDPS=(S)(D)(Cc))(100/((100+(1-P%)(A-P#))))
δP%/δDPS=(S)(D)(1+(1+Cd)Cc))((100A-100P#)/(100+(1-P%)(A-P#))^2)
δP#/δDPS=(S)(D)(1+(1+Cd)Cc))((100-100P%)/(100+(1-P%)(A-P#))^2)
δM/δDPS=(S)(100/((100+(1-Mp%)(Mr-Mp#))))
δMp%/δDPS=(S)(M)((100Mr-100Mp#)/(100+(1-Mp%)(Mr-Mp#))^2)
δMp#/δDPS=(S)(M)((100-100Mp%)/(100+(1-Mp%)(Mr-Mp#))^2)
These 9 equations mean we can make a series of 9 outputs in a DPS spreadsheet (namely mine) and have ourselves a DPS growth differential for any given specific circumstance. This will finally answer questions like “If I am Tristana with an I-Edge and 2 Doran’s, what stat should I get next?” which previous spreadsheets could not do. I will therefore be having all sorts of fun over the next few days working with this and hopefully can bring you guys some meaningful results soon.

Thanks for reading and props to you if you made it through alive. The findings of the work I have posted here shall be processed and I'll be reporting every useful information I can to you guys. For now, the one thing that I don't need is comments along the lines of "I don't see how this is useful" or "This is incomplete" because I am well aware of those things for now, I'm just giving you all some preliminaries to share and possibly improve upon before I go off theorycrafting the actual numbers with them.
Puhi
<Member>
Puhi's Forum Avatar
Posts:
2
Joined:
Aug 31st, 2011
Permalink | Quote | PM | +Rep October 16, 2011 4:40pm | Report
Not enough pictures
ilikesushi
<Member>
ilikesushi's Forum Avatar
Posts:
2
Joined:
Sep 2nd, 2011
Permalink | Quote | PM | +Rep October 16, 2011 4:40pm | Report
What he said
Cartographer7
<Member>
Cartographer7's Forum Avatar
Posts:
35
Joined:
Aug 10th, 2011
Permalink | Quote | PM | +Rep October 16, 2011 4:50pm | Report
So wait, YOU can imagine an 11-dimensional rectangular hyper-prism? O.O

The math is over my head, but I can't wait for the application post!

Edit: So, tell me if I'm getting this right: the whole "filling the hyper-prism" analogy boils down to you being able to determine which dimension (Attack speed, armor pen, etc.) to expand in order to maximize the total volume (aka DPS)?
Queso
<Member>
Queso's Forum Avatar
Posts:
343
Joined:
Nov 10th, 2010
Permalink | Quote | PM | +Rep October 16, 2011 7:54pm | Report

Edit: So, tell me if I'm getting this right: the whole "filling the hyper-prism" analogy boils down to you being able to determine which dimension (Attack speed, armor pen, etc.) to expand in order to maximize the total volume (aka DPS)?

Fairly certain that is correct.

OP: While these stats aren't as common, they do exist if you wish to include them: Magic Resist Reduction(scepter and champ abilities), % Magic Resist Reduction , Armor Reduction (starks, champion abilities), %Armor Reduction

they are applied in the order:
1.Percentage resistance reduction
2.Flat resistance reduction
3.Flat penetration
4.Percentage penetration

I have no real programming knowledge, but it seems like matlab or something of the sort would be useful to you.
NinjaGinge
<Editor>
NinjaGinge's Forum Avatar
Posts:
1000
Joined:
May 28th, 2011
Permalink | Quote | PM | +Rep October 16, 2011 8:04pm | Report
theory-crafting at its finest. keep it up
Credit goes to JEFFY40HANDS for this godly imposing Viktor
Hey, you should help me on acquiring Medieval Twitch!! :D
http://signup.leagueoflegends.com/?ref=507f1031d2ab3250817727
DuffTime
<Member>
DuffTime's Forum Avatar
Show more awards
Posts:
12302
Joined:
Oct 31st, 2010
Permalink | Quote | PM | +Rep October 16, 2011 10:21pm | Report
I got some Good Math.

Vayne + Red Buff = (Triple kill*huehuehue)
Cartographer7
<Member>
Cartographer7's Forum Avatar
Posts:
35
Joined:
Aug 10th, 2011
Permalink | Quote | PM | +Rep October 16, 2011 11:44pm | Report
I wonder if Riot has done the math on this level?
DuffTime
<Member>
DuffTime's Forum Avatar
Show more awards
Posts:
12302
Joined:
Oct 31st, 2010
Permalink | Quote | PM | +Rep October 16, 2011 11:48pm | Report
^ You kidding breh.

Rioters don't do math.

Rioters play LoL and shoutcast tournaments.

And make skins for Teemo.
Cervance
<Member>
Cervance's Forum Avatar
Posts:
56
Joined:
Feb 17th, 2011
Permalink | Quote | PM | +Rep October 17, 2011 2:01pm | Report
Can you explain how to calculate (1+(1+Cd)Cc))? I've tried doing the math for Cc = 10% and Cd = 200%. I come up with (1+(1+2).1))........ My dear Aunt Sally doesn't really help me here. If I had to guess I'd say its either .4 or 3.3 DPS, both of which seem wrong when you have S = 1 and D = 100. I'm stumped. X_X

Intuitively, the answer is 10, since you have a 10% chance to deal 100 extra damage.... I know 10(DPS) with the stats I listed is 1100... so the answer is 10.

I can't figure out how to make it work. It may have something to do with the fact that Cd is dependent on D, and yet D isn't worked into its equation. I don't know how to make it work, but I think it may be wrong...
1 2 3

You need to log in before commenting.

League of Legends Champions:

Teamfight Tactics Guide