Live data from Hacker News

Aztec monks with 1/55 HP no longer die when picking up or dropping a relic

reddit.com

51–60 of 267 posts

Re: Aztec monks with 1/55 HP no longer die when picking up or dropping a relic

#51

Earlier quoted context omitted.

Seems all that could have been avoided by using rationals in general and the condition for living being >0 instead of dying The more I write code, the more I notice how rarely one truly should want floats in most kinds of programs and how they almost always carry a whole bag of problems with them.

> Seems all that could have been avoided by using rationals in general It's 2023: I'm still surprised that so many new languages/platforms still only provide only basic integer and IEEE-754 types for numerics: Rust, C#, Java, Swift and others still lack built-in, runtime-provided, nor even standard-library-provided rational types, which I assume really should be the preferred type for most business/domain/application…

> and Java's lack of operator overloading makes this even more painful

Why?

Re: Aztec monks with 1/55 HP no longer die when picking up or dropping a relic

#52
post #45

What’s the best way to play AoE on a MacBook? I can’t afford a dedicated game rig so any pointers would be of great help.

I use a small machine at Paperspace (P4000 with 100GB) and play it remotely with Parsec. The experience is very good and costs me about 10-15$ a month.

How is it that a modern laptop manages to be worse at gaming than the average PC 20 years ago? Surely you one can at least run it in an emulator of some kind?

Re: Aztec monks with 1/55 HP no longer die when picking up or dropping a relic

#53
post #51

Earlier quoted context omitted.

> Seems all that could have been avoided by using rationals in general It's 2023: I'm still surprised that so many new languages/platforms still only provide only basic integer and IEEE-754 types for numerics: Rust, C#, Java, Swift and others still lack built-in, runtime-provided, nor even standard-library-provided rational types, which I assume really should be the preferred type for most business/domain/application…

> and Java's lack of operator overloading makes this even more painful Why?

Because you can't make your own types that work better.

Re: Aztec monks with 1/55 HP no longer die when picking up or dropping a relic

#55

Earlier quoted context omitted.

Aren't rationals subject to exponential blowup in storage/precision? IMO the best approach for business logic values is picking the smallest meaningful unit and representing it with integers. Precision and storage requirements become very easy to reason about.

> IMO the best approach for business logic values is picking the smallest meaningful unit and representing it with integers. How would you design an RTS unit stats system to avoid this AoE Monk HP bug using only integer types?

How much health precision do you need? Make hp an int. Or like a /64 fixed point.

Re: Aztec monks with 1/55 HP no longer die when picking up or dropping a relic

#56

Earlier quoted context omitted.

Aren't rationals subject to exponential blowup in storage/precision? IMO the best approach for business logic values is picking the smallest meaningful unit and representing it with integers. Precision and storage requirements become very easy to reason about.

> IMO the best approach for business logic values is picking the smallest meaningful unit and representing it with integers. How would you design an RTS unit stats system to avoid this AoE Monk HP bug using only integer types?

Well, in this case, if a unit is converted to a different type and back, it would just keep its (absolute) value of HP (in this case 1), no need to scale anything.

Re: Aztec monks with 1/55 HP no longer die when picking up or dropping a relic

#57

It’s great that Microsoft are still actively maintaining a ~24 year old game! Blizzard ought to take note. A few years back they announced “Warcraft 3 reforged” with great fanfare: a remastered version of the classic Warcraft 3, updated for modern systems with improved graphics etc. It looked/sounded fantastic! But despite it being a paid upgrade, what they released was a buggy mess that did little justice to the cla…

It's not just maintenance, Microsoft has released several expansion packs to the original Age of Empires II, plus an Xbox port to boot.

Re: Aztec monks with 1/55 HP no longer die when picking up or dropping a relic

#58
post #51

Earlier quoted context omitted.

> Seems all that could have been avoided by using rationals in general It's 2023: I'm still surprised that so many new languages/platforms still only provide only basic integer and IEEE-754 types for numerics: Rust, C#, Java, Swift and others still lack built-in, runtime-provided, nor even standard-library-provided rational types, which I assume really should be the preferred type for most business/domain/application…

> and Java's lack of operator overloading makes this even more painful Why?

Some aspects of the problem, exagerated for effect: boolean isDead = (new I("0.9")).divide(new I("55")).multiply(new I("0.1")).lessThan(new I("1"))

Re: Aztec monks with 1/55 HP no longer die when picking up or dropping a relic

#59

Earlier quoted context omitted.

> IMO the best approach for business logic values is picking the smallest meaningful unit and representing it with integers. How would you design an RTS unit stats system to avoid this AoE Monk HP bug using only integer types?

Well, in this case, if a unit is converted to a different type and back, it would just keep its (absolute) value of HP (in this case 1), no need to scale anything.

You haven’t thought it through yet. In this case, HP _is_ an integer, and so is the MaxHP for the unit type. And yet the bug still occurs! Storing the HP as an integer does not prevent the problem from ever occurring, because fundamentally the user still expects HP to be proportional.

That is, suppose a unit is sitting there at full health, and you research a tech that increases that unit’s max hp? Should the unit now be at less than full health, as if it had been in combat? Users probably don’t like that.

Suppose it is at full health, and then it gets downgraded to a type with less maximum health. Does it stay at it’s current HP? Users probably won’t like being attacked with supercharged units that have extra HP; they’ll think that the other player was cheating somehow.

What if it is damaged and at half health, then gets upgraded. Should it be fully healed? Gain HP equal to the difference between the new and old maximum HP? Or should it gain half of that, so that it stays at half health?

Or perhaps HP is too limiting, and the game should do what Dwarf Fortress does. DF knows the approximate surface area of every body part (based on each creature’s body plan, plus individual stats such as strength, fatness, size, etc), and the size of every weapon. Every attack therefore deals damage to a certain area, measured in square inches, and individual body parts will be destroyed once a sufficient percentage of that surface area is damaged by wounds.

Or maybe you are designing this game in the 90’s, and you have to worry about squeezing unit updates for 200 units per player into the bandwidth provided by the average modem of the day (probably 28.8kbaud), so you stick to one integer because it’s the simplest think that can possibly work, and the number of bytes per update can be calculated in advance. And then some other schmuck gets stuck with the job of handling unit type changes (but be warned that the schmuck might be yourself in six months).

Re: Aztec monks with 1/55 HP no longer die when picking up or dropping a relic

#60
post #45

Earlier quoted context omitted.

I use a small machine at Paperspace (P4000 with 100GB) and play it remotely with Parsec. The experience is very good and costs me about 10-15$ a month.

How is it that a modern laptop manages to be worse at gaming than the average PC 20 years ago? Surely you one can at least run it in an emulator of some kind?

You can just run with Wine, it seems to work mostly fine.

Also you could probably just install ARM Windows in a VM, not sure how good is the Windows translation thing compared to Rosetta though you might end up with a worse experience than just by using Wine.

Post reply on HN