Original Post — Direct link

For as long as I can remember, Riot has had an immense amount of tech debt between the client, champions, items, store, pretty much everything. I'd pretty much accepted that this was always going to be the case and the client would remain forever buggy a long time ago, but recently between the immense amount of bugfixes and the scripting of older champions to use data values and the like, it seems like bugs might actually be on the down for once. Just wanted to make a post to say it hasn't gone unnoticed, and I greatly appreciate the effort.

External link →
over 1 year ago - /u/PhreakRiot - Direct link

Originally posted by TheScyphozoa

Could someone explain what this data values thing is about?

Currently there are about about three ways to tell Ashe W how much damage it deals:

  1. (This is horrible don't do it) - Write down everything in the spell's script. Define a data table with damage values for each rank, tell it to look up what rank the ability is, then tell it to look up your total AD or whatever, then do some math with the AD ratio you've also defined here, and then do some more math, and then deal damage. You also need to send those values to the tooltip via the scripting of the spell, which means you also have to run some sections of the script pretty frequently... Unless you duplicate all your numbers into a data file that only feeds the tooltip and pray you never make a mistake in only editing one of them. If you want to update this damage value you have to re-upload the entire script and remember to also update the data file if applicable. This is extremely "expensive" to micropatch because scripts are often relatively large and they're much riskier. Azir's passive before being re-scripted for 13.5 behaved this way. To be fair, this was actually one of the cleaner ways to do it back when he was released.

  2. Half and half. Data files (.JSON) can contain all kinds of information that does very little on its own, but it's very easy to reference in the script. So for example, "Effect 1" can be a table with "50, 150, 200, 250, 500" and then when you ask for damage in the script you can say "Look up my spell rank, and look up 'Effect 1' then look up 'Coefficient 1' then look up my total attack damage and then do the math." You can feed "Effect 1" and "Coefficient 1" into a tooltip within the tooltip file itself. At some point, Riot's tools got better and so interacting with JSONs wasn't absolutely horrible but apparently it used to be. I've never used the tools in that phase, only when method 1 and method 3 (below) were in vogue. Anyways, this method isn't too bad because everything is defined in one location in one easy-to-update file and it's much less error-prone to modify since you aren't touching the ability's scripting. The downside is that you literally have to reference them as "Effect 1" (technically @f1@ in tooltips) and they're just simple data tables. The software supports commenting them but wasn't always the case. That unwieldiness is why some designers simply defined the data in the character's or spell's script itself.

  3. Modern. Our tools are a lot better now. We now have the ability to define data tables with official names while the software does the math for you. So you can take an ability and say "The level 0 damage is -5, and give it +15 damage per rank (among other possible functions). Call this 'BaseDamage.'" This is a "Data Value." Now everyone knows what this does and you don't get accidental math mistakes. You can also define "ADRatio" as a bespoke thing if you want. You also get more fancy tools that will do the math for you here. So I can make something else called "TotalDamage" and tell it to add BaseDamage to my Total/Bonus AD/whatever multiplied by ADRatio (or an arbitrarily defined number, whatever). I can tell the tooltip to display "TotalDamage" and I can tell the spell's script to also look up "TotalDamage." Now the math gets to be defined inside the .JSON and it's even more foolproof. When updating Samira's passive I simply made a new variable called "MoveSpeedNew" and told it that at levels 1 it was n%, at level 6 increase it, at 11 increase it some more, and then again at 16. Then I changed exactly one reference in the script. Theoretically I could have named it the same as her old move speed buff and saved myself the hassle.

Many abilities now live between 2 and 3. Their scripts reference "Effect 1" and "Coefficient 1" while they have their total damage mathed out in the JSON so that tooltips are nice and pretty. This makes it easy to accidentally only change the damage or the tooltip in isolation.

At this point, converting every ability to work the new way requires you to make sure there are no edge cases where things are defined weird. They shouldn't be, but who knows? What's the value of risking bricking an entire champion for simply making future design work a little easier? I shipped an Ashe change (only internally) where I nerfed Volley's "BaseDamage" by 10 damage but BaseDamage was only a tooltip variable (this is how you can have "87 damage" instead of "10 damage + 100% AD Ratio"). Volley was still using "Effect 1" in its script. But it was also caught pretty quickly and the right changes are shipping to the live game.

over 1 year ago - /u/PhreakRiot - Direct link

Originally posted by SuperMrBlob

Hello, thanks for the insights, is interesting, but why did you decide that "MoveSpeedNew" was a good name? The next time someone updates Samira's movement speed buff, will they create a variable called "MoveSpeedNewNew"?

Are you a programmer by any chance? Do the tools not let you refactor, checking for occurrences, like an IDE?

IDK I'm new and my practices are likely sh*t.

over 1 year ago - /u/PhreakRiot - Direct link

Originally posted by Draganos

Don't you guys do code reviews before checking into source control?

Yeah

over 1 year ago - /u/PhreakRiot - Direct link

Originally posted by Scrambled1432

To be fair, this was actually one of the cleaner ways to do it back when he was released.

I'm kind of surprised this was ever the case. Option 3 is how I assumed the game worked from the start.

We didn't have software to cleanly edit JSONs with a good GUI. It was supposedly a mess but I've never looked into it.

over 1 year ago - /u/PhreakRiot - Direct link

Originally posted by Altricad

Appreciate the indepth response as a software programmer myself, pretty cool to see how the lookup references damage values

How many champions have you converted to the modern tools of Data value vs leaving it in the spells scripts would you say?

Personally? Like four. Newer champions, like Samira, are already done in the newest way.