Page 1 of 1

Rounding down on certain calculations

Posted: Fri Jan 27, 2012 11:38 pm
by SumBum
It's a minor thing that seems to have started recently but still a little annoying.

First noticed this with sailing. At 100% you're fine, there is no change no matter how often you change direction. If you adjust your speed to, for example, 75 it changes to 74 after submitting it. If you then go back in to adjust your direction (not changing the speed) your speed is reduced to 73 once submitted. And so on each time you click continue from the Alter Sailing screen (you don't even have to change any settings - I just testing that with a sloop and it dropped the speed by 2% each time).

I haven't had a chance to test this on land travel.


Also occurs with projects, but a little differently. I did some testing and it seems that if you have more than enough materials in your inventory then it creates the project as requested. If you enter an amount equal to how much you have in your inventory then it rounds things down by 1.

Example 1: I had 275g meat and a lot of wood in inventory. Set the cooking project to use 275g of meat and let it automatically adjust for the wood etc. When I submitted it using the "only if I have everything" option, the project was set to 274g.

Example 2: I had 500g meat and a lot of coal in inventory. Set the cooking project to 225g of meat and followed the same steps as example 1. The project was created for 225g.

Sorry, I don't have a char I can test this using the "Select how much you want to make" field and ran out of ovens doing the projects above. :) And hopefully I got this worded clearly enough...

Re: Rounding down on certain calculations

Posted: Sat Jan 28, 2012 12:25 am
by Addicted
I noticed both of these. I didn't realise it was new for sailing, but was perplexed by the growing of herbs when it was rounded down and not up. To my advantage, as I got more product for less input.

Re: Rounding down on certain calculations

Posted: Sat Jan 28, 2012 12:46 am
by Henkie
It has to do with the math I believe. Some projects will cost you wood and meat and end you up with only 65% of the used meat actually smoked/cooked/grilled. If so, there is often a number with decimals in the end, forcing the script to round it off.

Re: Rounding down on certain calculations

Posted: Sat Jan 28, 2012 1:10 am
by SumBum
Henkie wrote:It has to do with the math I believe. Some projects will cost you wood and meat and end you up with only 65% of the used meat actually smoked/cooked/grilled. If so, there is often a number with decimals in the end, forcing the script to round it off.


I don't believe that's the issue. I'm not talking about the amounts of resources input versus how much is returned upon project completion. Rather, I'm talking about the amount of resources put into the project initially. This has only started recently and I've only seen the problem occur when you are holding the exact amount required by your requested project. If you hold more materials than you need, the requested amount isn't changed by the mechanics upon submission. I should have used the same sized projects in my testing but was working with limited resources.

Re: Rounding down on certain calculations

Posted: Sat Jan 28, 2012 7:28 am
by psychowico
SumBum wrote:First noticed this with sailing. At 100% you're fine, there is no change no matter how often you change direction. If you adjust your speed to, for example, 75 it changes to 74 after submitting it. If you then go back in to adjust your direction (not changing the speed) your speed is reduced to 73 once submitted. And so on each time you click continue from the Alter Sailing screen (you don't even have to change any settings - I just testing that with a sloop and it dropped the speed by 2% each time).

viewtopic.php?f=35&t=22690
When planing to implement this in the moment, so this problem should dissaper.


About projects raws rounding you should speak with GreeK.

Re: Rounding down on certain calculations

Posted: Sun Jan 29, 2012 3:46 am
by SumBum
Thanks, psychowico. :)

Re: Rounding down on certain calculations

Posted: Sun Jan 29, 2012 7:22 am
by EchoMan
Sailing speed round-offs were covered in a global announcement some time back.

viewtopic.php?p=467579&f=1#p467579

There has been a slight change to the boat speed event handling. Previously, if you set the speed to 5% with a very slow vessel, the actual speed would have been rounded to 0%, but the event would still say 5%. This had the effect that some vessels didn't move at all, though the event led the sailors to believe they were in fact moving.

Now the event will communicate the actual speed after rounding, no matter what you originally tried to set the speed to.

Re: Rounding down on certain calculations

Posted: Sun Jan 29, 2012 9:22 am
by Addicted
SumBum wrote:First noticed this with sailing. At 100% you're fine, there is no change no matter how often you change direction. If you adjust your speed to, for example, 75 it changes to 74 after submitting it. If you then go back in to adjust your direction (not changing the speed) your speed is reduced to 73 once submitted. And so on each time you click continue from the Alter Sailing screen (you don't even have to change any settings - I just testing that with a sloop and it dropped the speed by 2% each time).


Yes, I understood that as a rounding due to the way it has been programed. It can't actually sail at 5% so rounds down. But SumBum is saying it rounds down each time which is not what that global announcement says. So we thought it was a new bug. But as it's being fixed/ changed, this is redundant.

What about the second point? Did that change also effect the amount of project resource used? It is different and uses less; rounding down instead of up. Before if you set up a project for just under the whole gram amount required it would take the whole amount. Now it takes less from your inventory. If you intended this or know about it, then it's fine, but we don't know that so we report what's different.