I wold like to know couple of things about how Critical Strike works

Pastramka··10 votes·1,412 views

I just watched this and I started asking myself about Critical Chance in LoL and its random number generator (RNG): What does League uses to generate a random number for the critical chance? Does it use the most simple equation and instead of random gets back a nice pattern/sequence of numbers ?

Does the equation has safeguards? if u have 50% Critical chance and the RNG gave back less than 50 on all of your last(lets say) 10 strikes - does it say "next one must be A critical strike"? or just if u are unlucky u can do 30 AA and none will critically strike?

Runes get u a chance with a decimal - like +0.93%: Are they rounding up? I mean Is 16.4% as same as 15.6% (think they both round up on 16)?

I read that a random number is generated before each strike: Is there? Or the game is calculating in advance for the next strikes (for example for the next 50 AA)?

I would appreciate if Reds gave some answers on this, or "under the hood" stuff is a company secret? By the way are there any well known reds that work just as a programmers at Riot?

15 Comments

ImHerVoice3 votes

its not rng its prng Every non crit hit increases chance for next crit hit with PRNG RNG is completely luck based. PRNG favors crits more often. it was changed in season 1. Should be removed imo.

Pastramka1 votes

its not rng its prng

I know it is, its not very random when computer is generating :D The video says that computers/equations are very good with PRNG and very bad with RNG.

Should be removed imo

I think so too :D Or at least : "Critical strike gives only + 0.25 bonus damage"

Narsicus3 votes

Riot has stated that their crit system uses a modified rng, although they have not released the exact equation.

It basically works to smooth out your crits so that the more you fail to crit your chance increaces but securing a crit reduces it so that the overall number of critical hits should be as close to your crit chance as possible.

This way you are less likely to have hot streaks of multiple crits in a row, as well as cold streaks where you go attack after attack and fall short every time.

This can be abused slightly to predict when you are going to get a crit, it you have 25% crit chance and do not score a critical hit after 4-5 hits or so the next strike is going to have a rather high chance to crit. This way if you are Ganplank or Tryn you can watch yourself for streaks of misses so that you can strike at the opponent with a greater likelihood of a critical strike.

That's the side effect for making it less luck based though.

SlackerboyTC3 votes

That waas a pretty interesting video, but onto riots "RNG" they use a system that basically says if you did not land a crit with your first AA the chance of landing a crit on your next AA is high and higher till it finally happens, it can't be completely random if it was calculated.

TheSlappySlap2 votes

Can't say for sure but I presume it's just a simple Random.Range(0,1.00);

This means that there is no safeguard and no truncating of the float.

I'd imagine this is calculated at the time of firing an AA. Not sure why it would make any difference.

Matthias91194 votes

It used to be like this and then they put in what the OP calls "safeguards". I don't believe they have published the exact formula, but if you have a lucky/unlucky streak of crits then it will make it less/more likely that your next attack is a critical strike to keep you closer to the expected crit rate.

I would guess that if they round it's to a small enough degree to be essentially irrelevant, like .01% or less. e.g. If they use 16-bit integers rather than floats it would effectively round to the closest 0.0015%.

TheSlappySlap1 votes

Seems strange to add safeguards like that. It should be a positive number rather than a percentage if that's the case. Ie. Infinity Edge gives you +200 Crit Accuracy or something. It's a bit misleading to advertise it as a percentage chance

Matthias91191 votes

I don't understand your comment. It is a percentage chance. The effect of what they do is basically to lower the variance of the distribution of critical strikes.

Pastramka2 votes

I guess u understand it wrong?;

item 3031 gives u 25% Critical Chance, or that in a 100 AA u will have around 25 Critical Strikes.

Critical strikes amplify ur damage by 2, the item 3031 busts that amp to be 2.5. So if u Critically strike and ur regular damage is 200 ur critical strike will be 400. And with I.Edge it will bee 500.

Pastramka1 votes

I asked about the rounding coz I wan to know: if i have lets say 5.75% Critical will i waste a rune slot if I bought just one more Seal rune with +0.42% critical chance?

If thy take 2 decimals in to account the RNG would have to range from 0 - 1000, than it wont be the same if u have 5.5% and 6.4% it wont mater much : ) , but it wont be the same.

Matthias91192 votes

My guess would be that if they "round" in any meaningful way, it is to a precision significantly smaller than the smallest unit of critical strike that you can "buy". Like .01% or smaller. It would be pretty lousy to have it round to, say, the closest 1% when you can buy 0.5% crit runes. But you would need someone from Riot with knowledge of their actual code to confirm that. (And some games DO work like this; World of Warcraft rounds to whole percentages for things like crit and miss rates, or at least it did a few years ago.)

If you want to get really technical, all real-number values in a digital computer system get "rounded" to some degree. (Unless you use arbitrary-precision numbers, but that is way too slow for a game engine because then all your non-integer math has to be done in software.) The rounding/truncation is just usually too small to matter.

Pastramka1 votes

I'd imagine this is calculated at the time of firing an AA. Not sure why it would make any difference.

Im just guessing here but: I imagine it would be in advance just to make space if to many things and functions need to be calculated before an AA, I imagine there is a lot to calculate and check from start of the AA animation to Hit - So instead of doing an calculation while the attack speed is lets say 2 AA per second, the AA pulls info from a short list for the Critical with true and false values.

TheKingDodo1 votes

Rito writes their own pseudo random number generator? wot? No sane person would bother...

Pastramka1 votes

:D

I now think they use already well known function for getting the number, that favors non-picked numbers in a cycle until all from the range are picked.

More from [ARCHIVED] Miscellaneous

More by Pastramka