r/heroes3 Oct 16 '23

Question - Solved Wierd gold bug

I was playing around a bit, wondering the amount of troops i could get, then suddenly got to negative gold, why does that happen?

I had 2 ramparts and 8 other towns with a grail

46 Upvotes

9 comments sorted by

21

u/rudduman Oct 16 '23 edited Oct 16 '23

Integer overflow.

Once you reached the largest value possible, it wraps around to the smallest possible number.

This is also how you can bake for 4.5 Years in Paper Mario when you should only bake it for 30 seconds.

2

u/anisaidheeyeeyeee Oct 17 '23

Oh, I see. Thanks for the explanation!

3

u/JehnSnow Oct 17 '23

Very similar funny scenario in civ 2, for the "aggressiveness" factor of each civ they used an unsigned byte (meaning it can be 0-255), Gandhi was set to 1, the highest anyone was was something like 10.

If you got some specific diplomacy upgrade it would lower everyone's aggressiveness by two, so ghandi would go from 1 to -1, but since it was unsigned number it instead wrapped around to 255 and as a result Ghandi became mega aggressive and legend tells he would start to nuke everyone!

1

u/delphius356 Oct 17 '23

Yeah, probably from Ranparts dwarf treasury(or whatever it was called), that gives ya 10% bonus every week. Very fun to do every once in a while

32

u/OhNoMeIdentified Oct 17 '23

Probably one of your heroes went to First Aid Tent without insurance.

4

u/guest_273 Thunderbirds Oct 17 '23

Shoulda gone to the Skeleton Transformer instead.

6

u/BulutTheCat Oct 17 '23

No pain only gain

5

u/Jerzozwierz123 I like the lord of war map :D Oct 17 '23

I think you are in debt 😅

6

u/Toadinator2000 We stan a queen with damage reduction Oct 17 '23

Bone Dragons are so bad, they actually pay YOU to recruit them.