Rounding error when building/removing simple wooden floors

Creating this 7x8 floor costs 40 wood, but when I remove the blueprint, I only get 39 wood back.

Tested multiple times on different sized floors, with the same result each time. Laying 1 floor costs 1 wood, but returns 0 when removing! Not just a visual bug either, I just lost about 10 wood testing this.

Seems to happen with all floors, unless the total resources used is a whole number.


1 Like

Let’s say you always round up in resource costs:

  1. Build 7 tiles for 0.8, pay 5.6
  2. Remove a single tile for 0.8, get 1
  3. Continue removing all the tiles for 0.8 each, get 7 back
  4. Exploit alert!

Let’s say you always round down in resource costs:

  1. Build 1 tile for 0.8, pay 0
  2. Exploit alert!

Different example

  1. Build 1 tile for 1.2, pay 1
  2. Build 6 more single tiles for 1.2 each, pay 6 (7 in total now)
  3. Remove all the tiles together, getting 1.2 per tile back
  4. You get 1.2 * 7 = 8.4 -> 8 wood back
  5. Exploit alert!

Solution:
Round up when paying, round down when refunding and hope players don’t complain :wink:

If you have any other ideas, I’m all ears, though.

3 Likes

Thank you for the explanation!

I do have another idea (and please, take it with a grain of salt).
No fractions!

Inflation has increased the prices of everything to the point where fractions don’t exist, and now we don’t need to round anymore! Everyone is happy! Except Daniel, who now needs to change the base price of every single item in the game :rofl:

Or, even more complex, keep count in the background somewhere and don’t round up or down. People will still complain/report it as a bug, but at least we will know it’s always correct!
Edit: Not necessarily that much more complex. Just keep track of each resource that can be partially used to 1 decimal place, whether you show it on the UI or not is a different story.

1 Like

Or… Easy solution… You leave it like it is, since I allready think it’s weird I get all resources back. Thanks to the trader all resources are now “infinite”, it only adds to the experience :slight_smile:

It’s not ideal :smiley:

Fractions in the background are difficult as well. “I have 0 wood now, why can I build this 0.5 wood floor? Is this a bug?”

And increasing the price certainly works, but I don’t like the idea of people having tens of thousands pieces of wood. And it doesn’t fit in the text box anymore.

So yeah, not easy. I’ll see how many more complain, before I change anything. Thanks for the discussion, though.

1 Like