Dota2-Gameplay icon indicating copy to clipboard operation
Dota2-Gameplay copied to clipboard

Surplus gold calculation is wrong

Open JustGodlik3 opened this issue 4 years ago • 5 comments

Description

Surplus gold calculation doesn't seem to account for reliable gold and instead calculates it simply using current gold - death cost - buyback cost. Given death cost only uses up unreliable gold, in the screenshot attached the surplus gold should be 112 more than the total unreliable gold (3,456) due to reliable gold being 112 higher than buyback cost. Instead surplus gold shows up as only 3,256 rather than 3,456+112.

Example Match ID (and possibly Timestamp)

6591536376 - 27:11

Screenshots

Screenshot 2022-06-02 195003

JustGodlik3 avatar Jun 02 '22 19:06 JustGodlik3

Surplus gold should be total gold - death cost - buyback cost, in this case, I got 3255, the calculation should be correct.

isRobertMa avatar Jun 02 '22 19:06 isRobertMa

Surplus gold should be total gold - death cost - buyback cost, in this case, I got 3255, the calculation should be correct.

You are not factoring in reliable and unreliable gold which is my entire point. You only lose unreliable gold when you die. But if I spent all of my unreliable gold and all I have left is my reliable gold (which is higher than the buyback cost), I will still be able to buy back because I won't lose anything if I died. Therefore my real surplus gold is all of my unreliable gold (3,456) plus the difference of my reliable gold and buyback cost (1,273-1,161=112).

JustGodlik3 avatar Jun 02 '22 19:06 JustGodlik3

Yes, I was wrong, the death cost only makes a deduction on Unreliable Gold. In this case, our reliable gold is bigger than buy back cost therefore, the correct surplus should be 3,568 instead of 3,256.

isRobertMa avatar Jun 02 '22 20:06 isRobertMa

This one's quite important.

ArachnidaDuality avatar Aug 17 '22 22:08 ArachnidaDuality

This will be fixed in the next update. The label was computing "how much gold will you have left after death and buyback". What it should be computing is "how much gold may I spend and still be able to cover buyback" which is what the new code does.

Thanks for the report!

jeffhill avatar Oct 07 '22 22:10 jeffhill