DoubleG wrote: ↑Mon Dec 13, 2021 1:05 pm
I did look at the everything input but i was worried about getting circuits crossed. Had to change wire colour to stop the outputs climbing exponentially, even with my separated numbers outputs. The everything input would just be too hard to puzzle out how the signal flows. If you can think of a way to simplify it down to less deciders that would be great, but I stayed away from it for this one.
What you describe is used to create clocks. When you purposefully make it happen
. It does so generally when the output of a combinator is linked back to the input.
Simplest case is an arithmetic combinator A+1 output A with output and input connected. The signal flows is when the value are updated, it happens 60 times per second, ( 60 ticks per second or 60 Update Per Second). In the simplest case you have at the beginning A=0, then after 1 update A+1=A which leaves A=1, then after 1 update A+1=A which leaves A=2, then after 1 update A+1=A which leaves A=3 and so on up to the maximum number and start over.
This is also an advanced mechanism (imo), the climbing can accidentally happen because when wire of the same color touch, the value of each signal is added. So if you have A=2 on a green wire attached to a power pole, and you attach another green wire with A=1, the read value will be A=3.
Another way for this to occur without obvious addition is when you use a decider combinator doing A >= 1 with the input and output connected. Nothing will happen immediatly. But if you just add 1 on the channel A ( with a constant combinator for example), the decider will output 1 after 1 update. It will then receive the 1A because you added it with the constant, and also another 1A from its own output.
Which will be summed up even if you use different color of wire when they are considered as input for the decider combinator. So after another update the decider combinator will read 2 A as input, and will output 2, and the next update it will read 2+1 as input and output 3 for the next update where it will read 3+1 and output 4 and so on.
I avoided all of that in my example, there is just 2 different area connected with wire, before the deciders, and after the deciders, nothing after the deciders connect to anything that is before the deciders, so no need to worry about loops.
I used a different color of wire to provide a special input to the decider used to trigger the "low fuel" state,
this special input is -1 to all color, this is another way to overide the coal/solidfuel color, if there is 19 coal, the coal color is sent to the area of wire after the decider combinator, but the special input is also sent to that area because of the decider used for "low fuel" and the special input is -1 to the coal color, which leaves 0, and the special input also has 1 red, so that becomes the only signal positive, there is also -1 yellow, -1 cyan and -1 blue received by the lamps. But they do not care
, the condition for
lamp is to light up only when "anything >0" and use color. they do not use the color of signal with negative value, that's how it is in the game it is used in my example. I'm not sure afterall it's necessary to have a different color of wire but it felt cleaner in my mind since the other color of wire is used to transmit the quantity read on belts it prevent the color signal to be sent to the belts and the other deciders but it may not have created problems.
I realised you utilized the fact that some colors overides some others in the way you keep the lamp off or have the color of the fuel passing on the input belt, and then that the overiding order is the one in which the colors are displayed from left to right, left having the highest priority. Color black means the lamp is turned off, and is overiden by other colors.
I haven't seen any case where this rules would create problems in your example like coal overiding the others though. but it's possible i've missed them
.
In my example this is also avoided, in the area after the decider combinator there can only be 1 color sent, because only 1 fuel can be triggering the associated decider combinator that check if [everything]<[coal], or [everything]<[solid fuel] in another decider, each decider is necessary as it is where you associate the color to the fuel for the lamps. It only shows the color of the fuel that is the highest in the input amongst all different signals, if you were to add 100 000 iron plate on the same wire it would break
none of the decider will be true.
The bottom decider can be true at the same time as any of the other that's the only one it's the "low threshold", as explained earlier it overides other color and replace them with red.
The use of [everything] as input, then < [wood] and then "output 1 Yellow", act as filter, the ouput will be 1 yellow or nothing . Behind those combinator in parralel there can only be 1 color at a time.
And red is special it comes with -1 to all color, this way it overides all other colors since their value are -1 or 0 for as long as the bottom decider condition is validated. Otherwise the "low fuel" color would have conflicted with the color of the other fuel that is the most present on the belt. here it also "supress" the other signals the subtraction is not very obvious but it comes from storing negative value in the special input combinator. When an update happens, the value are added when present on the same color of wire. The area behind the combinators receive the negative value in the constant and addition them with the output of the other decider combinators "instantly", and the lamps only read the resulting color. It's a different way to see it.
I modified an exisiting blueprint i had to create this one this is why there are the 4 lamps but they are all the same you can add 5 or remove 2 it doesn't change since they are all connected with the same color of wire they act the same. ( like those in your blueprint which have a funny condition
).
TL:DR I think using 1 decider per fuel and an additionnal 1 for the "low fuel" is required to associate a unique color to each of those possible state. ( or at least in the scope of what i can come up with and explain)
using "everything" as input is made less prone to wiring accident as it could feel in this particular case because it can allow for a reduction in combinators numbers which makes the whole build less difficult to predict the different outcome and easier to distingish what is connected to what.