Page 1 of 1

Capacity, when moving or stalled, of a transportline

Posted: Thu Apr 11, 2019 7:28 pm
by sparr

Code: Select all

line_caps = {curve_right={5,2},curve_left={2,5},straight={4,4},underground={2,2,4,4},splitter={nil,nil,nil,nil,2,2,2,2}}
This is from one of my mods, determined by trial and error. For a belt that curves left, transportline #1 has a capacity of 2; if two or more items are present then the transportline is stalled (not moving forward).

I'd like to be able to get this info from the entities/prototypes instead of experimentally.

(also these numbers predate the recent changes to belt item density, so I probably need to calculate them again anyway)

Re: Capacity, when moving or stalled, of a transportline

Posted: Fri Apr 19, 2019 11:18 pm
by Rseding91
I'm not sure what you mean. Transport belt entities don't have any built in capacity logic: they simply have some "length" and items have a "size". Items get added until the logic says they can't fit anymore (would collide with other items) and then the belt is "full". What that number ends up being depends on many things - if side loading is happening - and so on. There's no function or set of functions to tell how many of an item can fit on any given belt.

Re: Capacity, when moving or stalled, of a transportline

Posted: Fri Apr 19, 2019 11:33 pm
by sparr
Then how about access to the length, and to the size of items?

Also, I seem to recall that the logic for putting things on belts puts items farther apart than they end up when the belt stalls. Maybe that changed, or I am misremembering? Either way, I'd love to have enough data to calculate my original request.

Re: Capacity, when moving or stalled, of a transportline

Posted: Sat Aug 15, 2020 4:00 am
by sparr
Bumping this. Currently I have to do a bunch of logic to figure out if a belt is curved so that I can know how many items fit on each side of it. I'd really like to be able to just query how long the line is or how many items should fit on it when it's moving or stalled.