Unable to buy at market despite having enough gold

:arrow_forward: GAME INFORMATION

  • GAME BUILD #: 101.101.54684.0 7486483
  • GAME PLATFORM: Steam
  • OPERATING SYSTEM: Windows 10

:arrow_forward: ISSUE EXPERIENCED

I had 79 gold and the price of wood was 79 gold. But I was unable to buy the wood. Unlike the stone, which was out of my price range, the button was not disabled. It was clickable. But clicking it did nothing.

:arrow_forward: FREQUENCY OF ISSUE

  • Less than 25% of the time / matches I play (RARELY)

:arrow_forward: REPRODUCTION STEPS

Retrace steps from blue’s point of view around 46:30 in the attached game.

:arrow_forward: EXPECTED RESULT

Either the button should be disabled if I don’t have enough gold, or it should be enabled if I have enough, and I should be able to buy the resource.

:arrow_forward: IMAGE

:arrow_forward: GAME FILES (SAVE / RECORDING)

MP Replay v101.101.54684.0 @2021.11.13 181558 (6).aoe2record (3.5 MB)

I think the game uses decimal numbers that you don’t get shown, and I’m not sure how it rounds them. So it’s possible that you had something like 69.9 gold, so it shows the button, but it can’t actually perform the transaction. That would be my best guess. Not really sure why that might have happened otherwise.

Yeah, float rounding limitations can definitely cause that – here’s some Python 3 as an example:

>>> 78.9 == 79.0
False
>>> 78.999999999999999 == 79.0
True

I guess the weird thing is that it shows the button as enabled while not doing anything. It can round oddly if it wants, but at least use the same calculation for button-showing and allowing transaction, I guess.

The resources in your stockpile are rounded down so that you are not misled into believing you can afford anything. I assume that market prices are rounded in this case the fair market price is 61 plus a 30% trading fee so the actual price is 79.3

1 Like