[0.16.x] inserter rotation speed

Place to get help with not working mods / modding interface.
Post Reply
osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

[0.16.x] inserter rotation speed

Post by osldgoth »

I have been trying to calculate the throughput of inserters for my mod ACT and have been using this wiki as a guide, but I've been unable (as far as I can tell) to come up with reliable numbers. Take the "inserter" as an example; it has a rotation speed of 0.014. The wiki claims that its 'turns per Game-tick'. I don't know how the wiki has calculated .83 for 'Turns per Game-second' for chest to chest. The closest I get is .014 * 60 which is .84. The wiki also calls it 'Arm cycles per second'. Perhaps .83 is not correct I don't know, I have no way of knowing for sure. Can anyone(one of the devs) shed some light on this? thanks

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: [0.16.x] inserter rotation speed

Post by DaveMcW »

The number you really want is "ticks per cycle".

Ticks per cycle
Burner inserter - 102
Inserter - 72
Long-handed inserter - 52
Fast inserter - 26

When calculating ticks per cycle you can see where the rounding error comes from.

1 / 0.014 = 71.4 ticks per cycle = round up to 72
60 / 72 = 0.833 cycles per second

osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

Re: [0.16.x] inserter rotation speed

Post by osldgoth »

Well I'm not going to round the number in the middle of the calculation.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: [0.16.x] inserter rotation speed

Post by DaveMcW »

Then you will get the wrong answer, because that is how the game does it.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.16.x] inserter rotation speed

Post by bobingabout »

osldgoth wrote:
Wed Feb 13, 2019 4:03 pm
Well I'm not going to round the number in the middle of the calculation.
The game works in whole steps called ticks.
For example... You can carry 100 apples at a time in a box, you have 7166 apples. How many trips does it take to carry all those apples from point A to point B. is it 71.66 trips because 7166/100 is 71.66, or is it 72 trips?
it's 72 trips, you can't have 0.66 of a trip. That's how the game works, you can't have 71.66 game ticks, you need to round up to 72 ticks.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

Re: [0.16.x] inserter rotation speed

Post by osldgoth »

ok I understand, the number isn't actually 0.014 but 0.013888... which is 1/72.

inserter: shown - 0.014 actual 0.01388... (1/72)
fast/stack-inserter: shown - 0.4 actual 0.03846... (1/26)

I can round the number for the inserter but rounding isn't going to help the fast/stack inserter. 1/.04 = 25. I really don't want to hard code the numbers. anyone have suggestions? perhaps 25 will be close enough

quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: [0.16.x] inserter rotation speed

Post by quyxkh »

Arm rotation isn't the only thing that matters, you're trying to calculate the total time for a pickup and a drop and two rotations from just the rotation speed, so you're already getting wrong answers, even before belts get involved. Trying to fit results into a deficient model is a recipe for frustration, doing it doggedly frustrates everybody watching too.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: [0.16.x] inserter rotation speed

Post by DaveMcW »

I believe this is the correct formula (at least, it works for all four vanilla inserter speeds, and correctly gives 14 for a double speed fast inserter):

ticks_per_cycle = math.floor(0.5 / rotation_speed) * 2 + 2

The explanation is it takes 1 tick to pick up, 1 tick to drop, and half a rotation each way.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.16.x] inserter rotation speed

Post by bobingabout »

DaveMcW wrote:
Mon Feb 18, 2019 12:55 am
ticks_per_cycle = math.floor(0.5 / rotation_speed) * 2 + 2
Wouldn't it be math.ceil() to round up instead of down?
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: [0.16.x] inserter rotation speed

Post by DaveMcW »

Why don't you just check the source code confirm I'm right. :P

quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: [0.16.x] inserter rotation speed

Post by quyxkh »

bobingabout wrote:
Mon Feb 18, 2019 9:42 am
DaveMcW wrote:
Mon Feb 18, 2019 12:55 am
ticks_per_cycle = math.floor(0.5 / rotation_speed) * 2 + 2
Wouldn't it be math.ceil() to round up instead of down?
Doesn't seem likely. Stack is .04, 1/25. so a half swing is 12.5 ticks, half-swing and a pickup/drop is 13.5 ticks, we can measure a full stack cycle at 26 ticks so if it's really 1-tick pickup/drop, as seems likely, inserter hands just have to get close. One-tick pickup/drop is looking awfully good for burner inserter timing, .01 rotation speed gets you exactly 100-tick full rotation, but the observed burner cycle is 102 ticks.

Anyway, it doesn't really matter much, what matters is how long it actually takes and this model doesn't account for belts and other inserters competing and all. Trying to predict inserter performance with belts involved seems like a quick route to ... I dunno, somewhere I don't want to go.

osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

Re: [0.16.x] inserter rotation speed

Post by osldgoth »

anyone want to tackle picking up items from belts? Throughput (items/sec) = 1 / (t_item + t_arm / n) https://wiki.factorio.com/Inserters#Inserter_Throughput

I have no clue where t_item comes from. I have a little data on the number of ticks each inserter takes to pick up max stack size(3/12) but that doesn't tell me much.
  • yellow belt (only one belt/inserter orientation - I may just assume it's the same for all configurations for simplicity)
    -------basic, fast, stack inserter
    • 18, 11, 74
  • red belt
    • 11, 10, 52
  • blue belt
    • 6, 5, 44
I have no way of calculating or estimating those numbers in lua

Post Reply

Return to “Modding help”