Kinda weird belt thing

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Post Reply
ColonelSandersLite
Fast Inserter
Fast Inserter
Posts: 208
Joined: Tue Apr 24, 2018 5:42 am
Contact:

Kinda weird belt thing

Post by ColonelSandersLite »

So this *might* be useless, it might not be. In any case, it's probably worth knowing about as it might cause a bug in your design.

Here's the design -
kinda weird.jpg
kinda weird.jpg (404.58 KiB) Viewed 1596 times
And here's the BP (iron plates sold separately)


So here's what this does -
You start the constant combinator on the left.

It releases the plate on the left track.

Releases the plate on the right track exactly 11 ticks (iirc) afterwards.


Now here's the weird part -

Mousing over the power pole when the plates pass through shows a single iron plate signal that lasts 22 ticks.

Unless it doesn't.

Sometimes there's a 1 tick delay between the left plate entering and the right plate entering!


My best guess ATM is that this is a rounding issue in how the game handles the curves.

mmmPI
Smart Inserter
Smart Inserter
Posts: 2675
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Kinda weird belt thing

Post by mmmPI »

ColonelSandersLite wrote:
Fri Sep 16, 2022 1:52 am
Mousing over the power pole when the plates pass through shows a single iron plate signal that lasts 22 ticks.
Oh so you did measure this ?

You might be interested viewtopic.php?f=18&t=100292

Although in the other thread it's not exactly the same method to measure things, it's the thing that is measured :D
ColonelSandersLite wrote:
Fri Sep 16, 2022 1:52 am
My best guess ATM is that this is a rounding issue in how the game handles the curves.
No for the rounding and yes for the handling of curve i would say ; there is no roundings but there are some particular numbers choosen to handle the curve (those are integer.)

ColonelSandersLite
Fast Inserter
Fast Inserter
Posts: 208
Joined: Tue Apr 24, 2018 5:42 am
Contact:

Re: Kinda weird belt thing

Post by ColonelSandersLite »

mmmPI wrote:
Fri Sep 16, 2022 2:29 am
No for the rounding and yes for the handling of curve i would say ; there is no roundings but there are some particular numbers choosen to handle the curve (those are integer.)
ColonelSandersLite wrote:
Fri Sep 16, 2022 1:52 am
My best guess ATM is that this is a rounding issue in how the game handles the curves.
What about rounding the bend?

Oh god.... It's the rounding/truncation controversy all over again. How scandalous!


But more seriously, yeah, it's an interesting behavior. I'm not sure it's a useful one but interesting anyways. Maybe some sorcerer of the dark arts will find an interesting use for it.

mmmPI
Smart Inserter
Smart Inserter
Posts: 2675
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Kinda weird belt thing

Post by mmmPI »

ColonelSandersLite wrote:
Fri Sep 16, 2022 4:09 am
What about rounding the bend?
Oh god.... It's the rounding/truncation controversy all over again. How scandalous!
But more seriously, yeah, it's an interesting behavior. I'm not sure it's a useful one but interesting anyways. Maybe some sorcerer of the dark arts will find an interesting use for it.
I'm sorry to hijack your thread and somewhat shamelessly copy pasting links of my own, only doing so to illustrate that even if you are no sorcerer of the dark arts you can use the behavior to make counter :D ( sorry for controversy )

viewtopic.php?f=208&t=100376
viewtopic.php?f=208&t=100464

Your observation on the time it takes for an item to trigger the signal when being carried away by belts is due to how the item move on the belts that have 256 different positions.
Given the data added by boskid on the post linked in my previous post it was possible to confirm what was the original value used by the game to precisely predict the behavior of one item on such belt, given that an item is 64 position wide, and adding the number of position per tick that an item will move depending on the belt speed and also how many position contain the special parts like curves that have different lengh for the inside and outside lane.

A blue belt for example requires 10.66666667.. ticks for an item to move past it. Which for 2 blue belts means 21.3333332 and will in game have a periodic behavior, although if you were to take for a distance to measure of 3 straight blue belt, the result would always be 32. The true value being calculated considering the lengh of a straight blue belt is 256 positions, and that the speed of the blue belt is 24/256 position per tick. 256/24= 10.666666. If you do 256*3 you have the total distance in position that an item needs to move to clear the distance that is 768 positions. And the speed being 24, it takes 768/24=32 ticks for an item to go through the 3 belts.

( this is why i said there was no rounding, the lengh of the inner and outer part of a curve are choosen integer to handle curve ; you get the 32 from 3 times 10.6666666, you do not get 31.999999999, the actual exact value is what is used by the game)

Given those numbers with a combinaison of yellow red and blue belts one can create a loop whose lengh is precisely choosen. And then activate those belts via pulse to move 1 item through the loop to create a counter requiring a precise number of pulse to complete.

In one design of nuclear power plant it is used to count the number of trains filled with steam leaving the nuclear power plant to trigger the refuel of those reactor.

In the other design the same trick is applied to create wireless synchronized 0 combinator timer to manage trains in no-signal train network, using a solar pannel to drop an item on such loop of identified lengh would allow to have anywhere on the map synchronized loops, one could be added during the night, the next morning an isolated solar pannel will produce enough energy to activate an inserter to drop an item in a counter loop at the exact same location of the other loops of the map, provided your belt loop is of integer number regarding the total time required to complete a lap, in tick. This can be used to trigger train departure condition to have them cross as predictible location so that you double the track only at this location and place a train stop acting as a waypoint to force train to avoid frontal collision ( in case they both try to path through the same rail of the locally doubled track).

There are still some little details that i'm not going into such as when one item is inserted on a curve and then get stuck on a disabled belt, it offset it a little compared to if the item was to be inserted in a disabled curve directly. Because the first tick of this item being blocked against another belt will reduce its movement by a different number of position than the number of position this item would have moved into the disabled belt, if it was not disabled, but those are not necessarily encountered for all use case of the belt-counter magic can be mathed or avoided :)

Oh and also splitters, i avoid those they make things more complicated.

I'm not sure it's "useful" as there exist alternative requiring only combinators but it's fun to use and when working with such design, you have a visual feedback to debug things.

Nidan
Fast Inserter
Fast Inserter
Posts: 225
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Kinda weird belt thing

Post by Nidan »

https://wiki.factorio.com/Transport_bel ... nd_lengths

An item needs 256/24 = 10 2/3 ticks to traverse a blue belt. If you measure three consecutive straight belts you should see an item requiring 11 ticks on two of them and 10 on the third.
In your setup the items are 11 * 24 = 264 positions apart, which is more than one belt. If your measuring circuit happens to be on a belt that (currently) needs 10 ticks while the previous belt needs 11 ticks you'll notice the described one tick gap in the output. On average, you should see this once every three loops.

For yellow and red belts items need an integral number of ticks to traverse them, therefore you won't observe the issue there.

Edit: looks like mmmPI was faster

mmmPI
Smart Inserter
Smart Inserter
Posts: 2675
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Kinda weird belt thing

Post by mmmPI »

Nidan wrote:
Fri Sep 16, 2022 10:21 am
https://wiki.factorio.com/Transport_bel ... nd_lengths
Edit: looks like mmmPI was faster
This link contain updated and more accessible information, i was not aware those information were on the wiki.
Below is a schematic example showing some items moving over two straight fast transport belt tiles and what their read signals would be at each tick. Their center points are marked with *. (The space between belt tile 1 and 2 is only for visualisation - in the game there are no such gaps between tiles.)
This part explain better what i attempted to describe with the item being offset if getting stuck against a disable belt. The center point can be moved a different number of position compared to the regular movement induced by belt transport as it would perform an incomplete movement.

Post Reply

Return to “Combinator Creations”