feat: omit scalings that apply at a rate of zero - #437
Open
Vergir wants to merge 1 commit into
Open
Conversation
A scale function with m_flStatScale of 0 is how the game files opt an attribute out of a stat it would otherwise grow with, eg. Card Trick's 0.6s cooldown ignoring cooldown reduction, or Naptime's channel time ignoring ability duration. Exporting those is accurate but says nothing: a rate of zero and no scale at all describe the same attribute. Leaving them out makes the data say the same thing in less space, and means a reader can take a Scale at face value rather than checking its rate before believing it. items.py has left them out of item data all along, so this also brings the two parsers into line. Nine attributes keep their value and lose a scale that claimed nothing, including Doorway's throw distance, where only the zero spirit half goes and the range it really grows with stays. The other 24 held a zero value as well as a zero rate, so they fall out of the output entirely, as every other zero-valued attribute already does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Don't write scaling to ability-data / ability-cards if it is zero.
Since
scaling: 0is the same as no scaling (I've checked all abilities to make sure it's true) we can just omit it to say the same thing in less space, and it means an editor reading ability-cards.json can know a scaling is present when they see it, rather than checking its value before believing itAlso items.py has left them out of item data all along, so this brings the two parsers into line.
Also it would omit weird zero scalings from ability cards for Doorway and Fixation and make them look closer to their in-game counterparts.
Parsed data in deadlock-data PR - Reopen deadbot PR or run deploy workflow for this branch here to reparse the data