- Joined
- Aug 7, 2013
- Messages
- 1,338
Hi,
I'm playing a map where units can have their health upgraded many times.
Most of the upgrades are arithmetic bonuses (i.e. adding a flat amount, e.g. +50 HP), however a few do it based on percent, e.g. Increases all units max health by 8% of their current maximum health.
I haven't noticed this before, but it appears sometimes a unit actually gets the wrong amount of max health. In particular, this water elemental should have 720 HP, but some of them get a max of 721! Is this a floating number precision error? If so, why would it apply non-deterministically?
The base health of the elemental was 550 HP. I got a total of +120 flat health bonuses = 670, and then a percent bonus of 9% I believe.
I'm playing a map where units can have their health upgraded many times.
Most of the upgrades are arithmetic bonuses (i.e. adding a flat amount, e.g. +50 HP), however a few do it based on percent, e.g. Increases all units max health by 8% of their current maximum health.
I haven't noticed this before, but it appears sometimes a unit actually gets the wrong amount of max health. In particular, this water elemental should have 720 HP, but some of them get a max of 721! Is this a floating number precision error? If so, why would it apply non-deterministically?
The base health of the elemental was 550 HP. I got a total of +120 flat health bonuses = 670, and then a percent bonus of 9% I believe.