You can defeat the Dream Devourer from Chrono Trigger using an int overflow
Thread
Unofficial Hacker News client; not affiliated with Y Combinator.
You can defeat the Dream Devourer from Chrono Trigger using an int overflow
Unofficial Hacker News client; not affiliated with Y Combinator.
PlunderBunny · · focus · HN ↗
I never understood how that particular bit of logic could have been coded that way - it seemed so unnatural.
LoganDark · · focus · HN ↗
Nition · · focus · HN ↗
- 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.
chii · · focus · HN ↗
thaumasiotes · · focus · HN ↗
How would that be one of the easiest mistakes to make? There are no operations for working with percentages, nor is it a thing you'd want to do.
To make that helm work as you describe, you'd need to multiply the stat by 1.1 when equipping the helm and then by 0.9 when deequipping it. But at that point you've lost any justification for making the mistake; those are just two random numbers that don't cancel each other out. It's not like you're adding a number in one place and then erroneously subtracting that same number somewhere else.
(Also, these are very strange multipliers to use this way, because they can never produce exact results. You're bound to see rounding errors if you insist on update-when-equipping and update-when-deequipping instead of recalculate-stats-when-equipment-changes.)
Nition · · focus · HN ↗
Garlef · · focus · HN ↗
Garlef · · focus · HN ↗