106 comments

PlunderBunny11 days ago
I figured out that, in the early versions of Realmz for the Mac, there was an enchanted item (a helm?) that added a few points to the wearer’s stats when equipped, but when removed it took away more than it added (i.e. left you worse off). It only took a few seconds for my programmer brain to start me furiously equipping and then un-equipping it, and sure enough, when that stat went to -127, one more equip-and-unequip was sufficient to give me a +128 bonus for that stat.

I never understood how that particular bit of logic could have been coded that way - it seemed so unnatural.

jerf10 days ago
There were games being written in days where every byte was precious, and the indirection necessary for something like the decorator pattern was just infeasible. There was a lot of direct stat manipulation upon equip & unequip back in the day.

Following that there was the era in which the only way to be competitive in the games space was to write in assembler directly, which would be my guess for how the bug you described happened, since a more sophisticated algorithm should probably have fit just fine by the time we're in the color Mac era but it would have been more painful to write, and nobody has any time for that. Lots of bizarre shortcuts were taken in this era. Some of the posts from Raymond Chen about Windows providing backwards compatibility for games of this era give an idea of the situation, which are related to how the games interacted with the OS rather than with game mechanics but it's a similar process.

Finally, games have this perverse effect going on where if you write down a bunch of effects you want things in your game to have ("armor can add % bonuses to this part of the strike calculation", etc.), it creates a set of boundaries within which the game's systems can function, and the ironic effect of the creation of those boundaries is to immediately bring to mind ways of violating those boundaries and demands from the designers to do so. These violations of the boundaries will tend to be buggy.

LoganDark11 days ago
I would figure the reason was because calculating it based on your inventory every time it's needed would've been expensive, so the developers decided to cache it, but instead of recalculating it from scratch when there's a stat change, they decided to try updating it incrementally, but I guess also imperatively. A string of mistakes has to happen to lead to such a situation but it doesn't seem super unnatural to me.
Nition11 days ago
I wonder if it was percentage based. That'd be one of the easiest mistakes to make.

- Player has a stat of 100

- Wears "+10%" helm

- Player has a stat of 110

- Removes helm, game subtracts 10%

- Player has a stat of 99

Actually, now that I think about it more, that wouldn't work as described above because once your stat got close to zero you'd enter a kind of Zeno's Paradox situation.

anon_cow111111 days ago
If you still like video games and are a bit of a masochist you might try playing Noita sometime, a lot of the late game is basically built around this type of logic.

For example there's a wizard-type enemy that temporarily debuffs your max health by 50%, and the effect can stack if you get hit more than once. But what happens if you pick up a permanent health boost item while the debuff spell is on you? You gain the normal health boost, then it multiplies itself when the wizard's spell expires; you can can go from 100 to several thousand HP in seconds and there's basically no limit.

In any other game this would be considered a bug and patched out in the next update. NOT NOITA, motherfucker. You're almost required to do things like this for a lot of the end-game optional content.

Filligree11 days ago
The programmer adjusted the way it works to make it slightly less OP. Just so we could all be sure the bug was now a feature.
angled11 days ago
somat10 days ago
Noita is mad, in the best sort of way.

So it is this very hard amalgamation of rogue and powder toy that controls like terreria, Very hard, With none of that silly meta progression nonsense you find in most roguelikes, But you push through, get good and beat it. Guess what? That was at most 10% of the game(probably closer to 1%), the other 90% is deliberately obtuse, hidden and optional. What sort of madmen make 90% of their game a easter egg?

EPWN3D10 days ago
I haven't thought about Realmz in a long-ass time. It had some really crazy tracks and was the only game I know of that used MOD instead of MIDI for its music.
somat10 days ago
Deus Ex Used MOD, At least I think they were mod, There were a fair number of what was basically MIDI + samples formats.

Also while trying to get my facts straight (All I remember was trying to find a mod player to play the deus ex music found on the cd) apparently Unreal tournament and tyrian2000 used mod music as well, Someone at Epic Megagames must have liked them.

mitxela11 days ago
thevinter11 days ago
While I agree that fandom is shit - the link you shared doesn't contain any mentions about int overflow
handoflixue11 days ago
It's buried at the bottom of Boss Battle Strategy:

"Since the Dream Devourer has 32000 HP, which is close to the signed 16-bit integer limit, it is actually possible to defeat it by healing it. By using powerful magic that it absorbs during its second phase, it can be (temporarily) healed past 32767 HP, which overflows the counter and makes its HP go negative."

avaer11 days ago
Parallel rabbit holes if you like this stuff:

  - in Pokemon gen 1 you can wrap your stats back to zero by buffing them too much
  - In FF7 you can overflow the damage calculation to kill Ruby in one hit
  - Mario 64 has a mountain of usable glitches; "parallel universes" let you skip collisions at high speeds
  - GTA 3/VC/SA have crazy mission/wrong warp corruptions involving parallel game simulations
  - NES Mario can be corrupted to execute arbitrary code in TAS
  - OOT can be heap-corrupted so badly you can write a loader for an entire DLC via controller ("triforce%", my choice for most insane controller based hack of a game)
matheusmoreira11 days ago
> NES Mario can be corrupted to execute arbitrary code in TAS

Pokémon, too!

https://tasvideos.org/3358M

https://youtu.be/zZCqoHHtovQ

Ndymium11 days ago
A classic way of getting endless money in Transport Tycoon was to build a tunnel going from one edge of the map to another. The money counter would overflow and you'd get enough money to last you a lifetime.

As kids we didn't know why this would happen, we just knew that it did and used it every game.

torlok10 days ago
Fandom Wiki leaves 5 lines of readable text on my iPhone after about 3 seconds of loading.
MisterTea10 days ago
It's an ad ridden sewer. The final straw was disabling comment visibility to only those who are logged in. I used that site a bunch for Kenshi and the comments were a trove of information. No more. I refuse to make an account on that visual nightmare.
xp8410 days ago
Always replace “fandom” with “breezewiki” in the url. It’ll take you to a de-crapified version, and also check for the existence of a real wiki separate from fandom and link to that:

https://breezewiki.com/chrono/wiki/Dream_Devourer

They have a chrome extension too, to do this for you automatically.

hightrix10 days ago
Fandom and fextralife are the two “wiki” providers that do this. It’s best to exclude them both from all search results. Fextralife is even worse as it autoplays a twitch steam.

Read the full thread on Hacker News →

Related stories