collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
884 stars 101 forks source link

double check item encoding stat counts #19

Closed collinsmith closed 5 years ago

collinsmith commented 5 years ago

Some stats encode consecutive stats after one another to save space (e.g., max damage stats immediately follow min damage without declaring the max damage stat header [they are 2 different stats encoded as one]). Some of my info is out of date on encoding counts of stats. There are some stats that no longer encode multiple consecutive stats and opt in to use encoded parameters. I have fixed some of them, but I'll need to go back and make sure they are all correct or fix on an ongoing basis.

See ItemStatCost.txt

collinsmith commented 5 years ago

I'm fairly certain the encoding count is used to also generate the display values. E.g., the following stats look to be auto-aggregated by the game code (only all res and attributes are declared as a group):

strModAllResistances        All Resistances +%d
strModFireDamage        +%d fire damage
strModFireDamageRange       Adds %d-%d fire damage
strModColdDamage        +%d cold damage
strModColdDamageRange       Adds %d-%d cold damage
strModLightningDamage       +%d lightning damage
strModLightningDamageRange  Adds %d-%d lightning damage
strModMagicDamage       +%d magic damage
strModMagicDamageRange      Adds %d-%d magic damage
strModPoisonDamage      +%d poison damage over %d seconds
strModPoisonDamageRange     Adds %d-%d poison damage over %d seconds
strModMinDamage         +%d damage
strModMinDamageRange        Adds %d-%d damage
strModEnhancedDamage        Enhanced damage

In the case of EnhancedDamage, this joins item_maxdamage_percent, item_mindamage_percent and changes the format to +%d%% %s (descfunc 4) using strModEnhancedDamage from %d %s (descfunc 3)

collinsmith commented 5 years ago

Spreadsheet of encoded values: https://docs.google.com/spreadsheets/d/15E9d5sSZOi8i4b0E4FYDI4u3S8QLEDvOf6Mg6ohJtVw/edit?usp=sharing

collinsmith commented 5 years ago

I changed all 0 encoding counts to 1, since those all correspond with Save Bits=0 anyways (they will resolve to 0). I think these are all unused and shouldn't appear anyways, if it becomes a problem, I can change them back later -- I think it might be useful to keep them in the item stats just in case.

179-180 were encoded as 2 and 268-303 were encoded as 3, now all of these are set to 1. I think these were supposed to denote parameters/additional fields, since all of these are not paired. 179-180 is just a value/param pair while 268-303 are the _bytime stats and marked as encoding 4 so their parameters are not lost.

collinsmith commented 5 years ago

Changed item_reanimate=1 from 2. Same reasoning as above post.