How does Damage Display?

Sheen Estevez·3/16/2018, 5:32:28 PM·1 votes·299 views

With reading patch notes and seeing floating points with AD/AP/AD Growth etc. I am curious (from a coder's prospective) how damage is calculated. Is it rounded to a whole number and displayed? Is it only displayed as a whole number but the floating points are still used for calculation? Is the floating point cut off in damage calculation? Or is it something else?

2 Comments

Me Is Gaggy3/16/2018, 5:56:40 PM1 votes

Odds are they round damage display so you don't see that Cassiopeia's Q does 91.4294899 damage with 85 base damage at level 5 with 150 AP scaling at 23.33%

Reference of her current scaling: https://puu.sh/zIZ6N/e44a8a39ff.png

The float value would probably be used during damage, but rounded so the person hit doesn't end up with 900.213 HP left

If your into programming, you could experiment with it yourself. From what I've read, the game is written in C++ (mainly). So a simple script that takes base damage and scales it could help you understand how they display it using functions from the language. Such as round(), ciel(), floor().

DeathBurst3/16/2018, 8:11:23 PM1 votes

I can't find back the original post (sorry), but I'm 99% sure that a Rioter once said that floating point numbers are used everywhere, and that it's only rounded at the last moment for display.

So contrary to what Puabs said, I think the enemy would end up with "900.213" HP left, it's just that their displayed amount of HP is rounded to 900.