Live data from Hacker News

Diablo III Economy Broken by an Integer Overflow Bug

minimaxir.com

31–40 of 129 posts

Re: Diablo III Economy Broken by an Integer Overflow Bug

#31
I remember a similar bug in the original Asherons Call (amazingly, still running with regular content updates!). Three or four years in, they added a new, very expensive object to the game (a "Pyreal Scarab" for anyone who cares). It cost a lot, so the idea was that people wouldn't be (at that point in the economy) buying many.

Now, in Asheron's Call, the world is huge. There are hundreds, if not thousands of vendors. And three of these vendors were set to sell their goods in stacks of up to 1000. Unfortunately, Cost of Pyreal Scrab * 1000 > 2^31, which wrapped. I can't remember if you either just got the goods for free (which you then sold back for huge profit), or if you actually got paid to take these things. Either way, overnight, the economy was destroyed. The entire game state had to be reset from backups; a dreaded rollback. Worse, the developer took a few days to do this.

Trust me, out of all the customers whose data you don't want to muss with, it's hardcore MMORPG players. Even though I was just a player, I can still remember the outrage all these years later. It taught me to always use appropriate types for objects with "value", and I've never accidentally used signed or floating point storage for currency again.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#32
post #19
post #14

Earlier quoted context omitted.

Well, if no-one is pretty much all the non-english-speaking world, then yes.

The Chinese don't use the long scale either, at least not in this form - we count in magnitudes of 10,000.

I wasn't aware of that. To be sincere, I also made the mistake of looking too close home. I was mostly talking about the non-English-speaking 'western hemisphere'.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#33
Kingdom of Loathing had an integer overflow bug way back in 2004. It let players set their currency (in this case: meat) to the max value of a 64-bit integer. The game spent the next several months setting up meatsinks in an attempt to reduce the amount of meat in circulation.

http://kol.coldfront.net/thekolwiki/index.php/Black_Sunday

http://kol.coldfront.net/thekolwiki/index.php/Bugmeat

http://kol.coldfront.net/thekolwiki/index.php/Meatsink

Re: Diablo III Economy Broken by an Integer Overflow Bug

#34
post #29
post #3

Just another reminder that it's never worth bypassing the normal deployment process. Every year or two I learn a similar lesson myself: it's so tempting, the fix is so small, it couldn't possibly break anything (heck, I once had a data-gathering script that made a bunch of read-only calls to our system's API cause a live issue). Just say no.

To be fair, I am not sure if anyone would try posting 6 billion gold onto a PTR equivalent of the RMAH or whether the RMAH is even available on the PTR, which might explain why it wasn't tested.

[deleted]

Re: Diablo III Economy Broken by an Integer Overflow Bug

#35
post #3

Just another reminder that it's never worth bypassing the normal deployment process. Every year or two I learn a similar lesson myself: it's so tempting, the fix is so small, it couldn't possibly break anything (heck, I once had a data-gathering script that made a bunch of read-only calls to our system's API cause a live issue). Just say no.

> heck, I once had a data-gathering script that made a bunch of read-only calls to our system's API cause a live issue I don't think you can just throw that out here with no story. Well...I guess you can , it just makes me sad.

The script was a permission checker; roughly, for each client check whether they had any object types they didn't have permission for, plus a bit more logic for things like "they have permission A which is a superset of B but don't have permission B", and output a report. There was a bug in the DB cache used by our security service (I think caused by a broken clone() implementation that shallow-copied when it should have deep-copied, but this was a while ago now) that meant that if permissions for two different clients were requested in quick succession, both would end up with the intersection of their permissions - which were then cached in the main application (I guess there must have been some logic like the API always triggered a refetch to ensure it returned the canonical value, whereas for the rest of the application performance was more important?). In theory it could've been happening already, but I guess we never had two clients loading the same webpage close enough to the same time (and they would have to both have had the local cache expire - plus almost all of our live clients had very similar permissions, whereas we had some "test" clients with no permissions at all), whereas of course my script just called as fast as possible.

It was fairly easy to track down the bug once we passed the initial disbelief stage, and I don't think many clients noticed. But it could've been a lot worse - I'd been so close to running this last-thing on a Friday before I left.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#37

The fact that the diablo economy has reached the point where users are running around with 6 billion gold shows its been broken for much longer.

Why? It's just a matter of scale. Until very recently, Romania's currency was such that most middle-class families had 8-10 digits in their bank account at any given moment, and the economy is relatively healthy. Good items sell for hundreds of millions. The number of zeroes doesn't matter, as long as the balance between items and monetary value is stable.

"The number of zeroes doesn't matter, as long as the balance between items and monetary value is stable."

And you're not just starting the game. The way that D3 drops work, the first few times you're visiting the auction house, it's to buy, not sell (unless you get very lucky).

The game was also balanced around the auction house - meaning fewer high quality items drop, with the belief being that you're selling those few high quality items & kitting yourself out from the auction house.

When I first played, the difference between playing with just the drops I got versus kitting myself out from the auction house were vast. Some people might enjoy the challenge of just playing with dropped gear, but just as many do not.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#38
post #5
post #2

420,081,335,014 is 420 billion not 420 trillion.

English is handy enough to have two "scales", where these words have different meanings. In the short scale, you'd be right, but the author probably uses the long scale. See http://en.wikipedia.org/wiki/Long_scale#Comparison . It's one of those things that makes English ... interesting to learn as a foreign language. :) EDIT : Actually no, I mis-read the table on the Wikipedia page. The author was simply mistaken, an…

In the long scale ins't 420 trillons either, it's 420 millards.

Source: your link.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#39
post #23

Earlier quoted context omitted.

It's basically a very pretty slot machine. I played quite a bit of D2 and D3. The thrill comes from grinding for hours (and hours and hours) and finding that one item that earns you hundreds of dollars. (Yes real dollars) You can thank the the Real-Money Auction House for both destroying the game and being the one thing that keeps so many people coming back for more.

I loved Diablo 2 and probably spent a good portion of my high school hours playing it. I was very excited for Diablo 3 and tried to get into it but just couldn't. I felt that they just took a ton of ideas from WoW and implanted them into Diablo. Sure it may have made them more money but it made it a lot less fun.

I've heard Path of Exile is a worthy successor to D2.

For this very reason I must on no account ever install it.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#40
post #5

Earlier quoted context omitted.

English is handy enough to have two "scales", where these words have different meanings. In the short scale, you'd be right, but the author probably uses the long scale. See http://en.wikipedia.org/wiki/Long_scale#Comparison . It's one of those things that makes English ... interesting to learn as a foreign language. :) EDIT : Actually no, I mis-read the table on the Wikipedia page. The author was simply mistaken, an…

Also, basically no-one uses the long scale anymore. Which is a shame. -illiard is a fantastic suffix.

So are thousands of billions called billiards? :)
Post reply on HN