Questions regarding rounding

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
User avatar
Jackalope_Gaming
Fast Inserter
Fast Inserter
Posts: 230
Joined: Wed Oct 07, 2015 10:11 pm
Contact:

Questions regarding rounding

Post by Jackalope_Gaming »

I was looking at the mining numbers and I'm wondering if or where rounding happens in the calculation and how rounding is handled if at all in the game. For example, an electric mining drill with no modules mines iron at a rate of .525 per second which ends up as 1 iron mined every 1.90476(repeating) seconds. Given how the game does calculations in tick increments that are 1/60th of a second, would the actual output be rounded up or down? The previous 1.904 and so on would round down to an even 1.9 or 114 ticks if the rounding was done at the end, or round up to 1.91666 which is 115 ticks. My guess given the flow chart listed at https://www.factorio.com/blog/post/fff-70 would be it would round up to 115 ticks since the process isn't done at 114.

Or does the game do something entirely different?
User avatar
oLaudix
Filter Inserter
Filter Inserter
Posts: 285
Joined: Sun Jun 14, 2015 3:24 pm
Contact:

Re: Questions regarding rounding

Post by oLaudix »

Rounding is done at each tick. Taking your drill as example, it mines 1 ore per 1.90476 seconds. This is 114,2856 ticks but since order to start new mining comes in next tick its actually rounded to 115 ticks which is 1,91(6) seconds. This is for normal production though. Productivity is not rounded at all.
Image
Post Reply

Return to “Gameplay Help”