Live data from Hacker News

Diablo III Economy Broken by an Integer Overflow Bug

minimaxir.com

81–90 of 129 posts

Re: Diablo III Economy Broken by an Integer Overflow Bug

#81
post #48

This is what happens when we let machine constraints trump semantics. When you say int, you usually want an actual integer, not an integer with an arbitrary limit. In this day and age, having that limit there is simply premature optimization. I think having a nice bignum type--one that looks and feels just like a normal numeric type--is very important. It should also probably be the default ; you should only switch t…

> In this day and age, having that limit there is simply premature optimization.

You say this with certainty. Do you know of studies of real-world programs where machine-sized integers were replaced whole-sale with bignums?

Re: Diablo III Economy Broken by an Integer Overflow Bug

#82
post #48

This is what happens when we let machine constraints trump semantics. When you say int, you usually want an actual integer, not an integer with an arbitrary limit. In this day and age, having that limit there is simply premature optimization. I think having a nice bignum type--one that looks and feels just like a normal numeric type--is very important. It should also probably be the default ; you should only switch t…

Depends on the situation.

I assume this was probably a server side bug, since all the accounting would never be trusted to the client side.

If you are writing highly-performant server code, the actually memory size is extremely important. You cannot (should not) abstract away the machine specifics of the datatype if you want to write optimized code.

In some cases where the underlying datatype isn't a concern (e.g. Javascript), I agree with you. But ultimately, this isn't a failure of technology, it is a failure of the software development process.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#83

I feel sorry for the players who were amused by this and will now likely get banned. I don't know when video games started to be like a bad elementary school where you get punished for experimenting or finding a loophole, but it seems like it's punishing one of the fundamental joys of games. Or at least one of the joys I remember being particularly rewarding as a child.

Well, when you're messing with a real-money economy, I think that's a pretty big tip-off that you'll be punished for experimenting or finding a loophole. The same thing happens with other games that deal in real money, such as the stock market.

Also, AFAIK the only parties who exploited this bug were gold-farming bots. The computers won't mind, especially since their owners probably made bank off this.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#84

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.

I think that's just it, the prices haven't remained stable, the economy just undergoes constant inflation as the amount of overall money keeps piling up. Meanwhile new characters still begin with nothing and earn gold at the same rate as players did when the game first launched.

Compare this with World of Warcraft where they deliberately built in mechanisms to keep destroying money through consumables and bind-on-equip items.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#85
post #48

This is what happens when we let machine constraints trump semantics. When you say int, you usually want an actual integer, not an integer with an arbitrary limit. In this day and age, having that limit there is simply premature optimization. I think having a nice bignum type--one that looks and feels just like a normal numeric type--is very important. It should also probably be the default ; you should only switch t…

> In this day and age, having that limit there is simply premature optimization. You say this with certainty. Do you know of studies of real-world programs where machine-sized integers were replaced whole-sale with bignums?

All Ruby code does this. Mathematics can still be performant because of tagged pointers. If the MSB is set, the value is a Ruby object. If it's not set, the value should be considered a native data type.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#86

Hard to understand why people spend so much time on a short game like Diablo III. Even before I finished it on inferno the game didn't make much sense, I just finished for the sake of it, which I regret. Most Super Mario games requires way more abilities than that and less time. Don't waste your limited time on earth playing consumption-driven games. I've been trying Eve online for a few days, It does not looks promi…

Eve was a black whole for me. Played casually for a week, then learned how to make money via trading, then I found out there is a Python API for grabbing data out of the game client, as well as some other JavaScript-APIs using the in-game Browser.

Next thing you know I was crawling all popular market hubs in Eve, storing price history of each item in mysql, and programmatic analyzing the data to find the best trade routes for profit.

Then I realized I need much more data, and prepared a small data-grabber client for other people to run, as well some cloud storage to upload it to.

I looked at the calendar and noticed 2 weeks have past and I didn't do much else, so I came to the conclusion this might not be the most productive thing to do and quit Eve :) Problem is, I can't play these games the "normal" way, when I see it got APIs etc. I just have to go all out on it - or just not play at all.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#87

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 vendor…

Haha - I was the one who was responsible for adding the Pyreal Scarab. I remember freaking out that night when I was playing and went to Teth's vendor and saw what was happening. I called up the producer at the time at 2am and said there was a "problem".

"Oops." --Devilmouse

Re: Diablo III Economy Broken by an Integer Overflow Bug

#88
post #48

This is what happens when we let machine constraints trump semantics. When you say int, you usually want an actual integer, not an integer with an arbitrary limit. In this day and age, having that limit there is simply premature optimization. I think having a nice bignum type--one that looks and feels just like a normal numeric type--is very important. It should also probably be the default ; you should only switch t…

> In this day and age, having that limit there is simply premature optimization. You say this with certainty. Do you know of studies of real-world programs where machine-sized integers were replaced whole-sale with bignums?

Everything written in Python has the automatic promotion from C longs to bignums when the result no longer fits: see http://docs.python.org/2/library/stdtypes.html#numeric-types...

Re: Diablo III Economy Broken by an Integer Overflow Bug

#89
post #48

This is what happens when we let machine constraints trump semantics. When you say int, you usually want an actual integer, not an integer with an arbitrary limit. In this day and age, having that limit there is simply premature optimization. I think having a nice bignum type--one that looks and feels just like a normal numeric type--is very important. It should also probably be the default ; you should only switch t…

Depends on the situation. I assume this was probably a server side bug, since all the accounting would never be trusted to the client side. If you are writing highly-performant server code, the actually memory size is extremely important. You cannot (should not) abstract away the machine specifics of the datatype if you want to write optimized code. In some cases where the underlying datatype isn't a concern (e.g. Ja…

Most servers are x86-64 these days. So using 32 bit signed ints barely improves performance at all. Could have gone with a 64 bit unsigned int as it is a positive value all of the time.

Re: Diablo III Economy Broken by an Integer Overflow Bug

#90

Earlier quoted context omitted.

>Trust me, out of all the customers whose data you don't want to muss with, it's hardcore MMORPG players. Welp, that's what happens when you have only online play on only official servers. Single player offline wouldn't be affected - cheat all you want! Online play on unofficial servers means server admins can take whatever action they want - ban offenders, leave offenders alone, or rollback - depending on what the a…

This game was an MMO.

Not any more than SimCity 2013 was an MMO. There may have been free-to-play MMO-like monitization of every little thing but the game mechanics are all single-player/small-group-of-players.
Post reply on HN