Combinators 101

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.
XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Combinators 101

Post by XKnight »

nobodx wrote:Is there a smarter / better way to control your factory storage with less than a single constant combinators (to set the max items) + 2 decider combinators for each items you want to control ?

The way I set them up:

- a Constant combinator (eg. 50 lamps)

- a Storage chest (with lamps)

- a decider combinator
Inputs: lamps > 0
Output: signal 1 & amount of lamps
wires: green from storagechest to input

- another decider
input: signal 1 < lamps
output: lamps & amount of signal 1
wires: green from 1st decider output, red from constant combinator as input

- lamp (or green inserter)
input: lamps = 1
wires: green from 2nd deciders output

I hoped i described the setup well enough.
first way: connect lamp (or green inserter) directly to the storage chest and write necessary restriction in lamp/inserter
+ the simplest setup
- if you want to change item limitation you will need to change it in every lamp/inserter

second way: use negative values inside constant combinator and condition >0 in lamp/inserter
+ changing limitation can be done only in constant combinator
- not so simple as previous, requires 1 constant combinator

nobodx
Fast Inserter
Fast Inserter
Posts: 157
Joined: Mon Jul 06, 2015 3:22 pm
Contact:

Re: Combinators 101

Post by nobodx »

=O didn't even thought about negative values

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 950
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Combinators 101

Post by ratchetfreak »

nobodx wrote:Is there a smarter / better way to control your factory storage with less than a single constant combinators (to set the max items) + 2 decider combinators for each items you want to control ?

The way I set them up:

- a Constant combinator (eg. 50 lamps)

- a Storage chest (with lamps)

- a decider combinator
Inputs: lamps > 0
Output: signal 1 & amount of lamps
wires: green from storagechest to input

- another decider
input: signal 1 < lamps
output: lamps & amount of signal 1
wires: green from 1st decider output, red from constant combinator as input

- lamp (or green inserter)
input: lamps = 1
wires: green from 2nd deciders output

I hoped i described the setup well enough.
Just wire the chest to the inserter/lamp directly.

The second parameter can be set to a constant.

Or set the signal from the constant combinator to signal 1

Or set the constant combinator to - the amount you want and connect to the same circuit as the chest and set the inserter/lamp to work when lamps < 0

nobodx
Fast Inserter
Fast Inserter
Posts: 157
Joined: Mon Jul 06, 2015 3:22 pm
Contact:

Re: Combinators 101

Post by nobodx »

I wanted to control my entire factory from a central (constant combinatorial) place.
Eg I set it to 1000 solar panels, and my multiple assembler start to fill up my chests to 1000 panels.
Currently I use smart inserters, but I don't want to change countless inserters every time I upgrade my factory

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 950
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Combinators 101

Post by ratchetfreak »

nobodx wrote:I wanted to control my entire factory from a central (constant combinatorial) place.
Eg I set it to 1000 solar panels, and my multiple assembler start to fill up my chests to 1000 panels.
Currently I use smart inserters, but I don't want to change countless inserters every time I upgrade my factory
then the constant combinator emitting the negative value you want is simpler.

in the inserter the values will be added together and if the result is less than 0 you still need some made

theit8514
Inserter
Inserter
Posts: 46
Joined: Sun Apr 20, 2014 2:11 am
Contact:

Re: Combinators 101

Post by theit8514 »

Thanks for this post. I was finally able to get my terminus station logic worked out. Fun, but exhausting.
Images

nobodx
Fast Inserter
Fast Inserter
Posts: 157
Joined: Mon Jul 06, 2015 3:22 pm
Contact:

Re: Combinators 101

Post by nobodx »

Also a big thanks, just tested it on a small scale and it is working wounderfull. All I need is combinator, and (literally) tons of red wires to connect all my inserters and countless more wires to connect all my storage chests. Maybe it's time to build a red wire production ;)

GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

Re: Combinators 101

Post by GopherAtl »

nobodx wrote:Also a big thanks, just tested it on a small scale and it is working wounderfull. All I need is combinator, and (literally) tons of red wires to connect all my inserters and countless more wires to connect all my storage chests. Maybe it's time to build a red wire production ;)
If you play with mods at all, you might wanna check out my logistic combinators mod (link in my sig). It has the gui of a constant combinator where you select signals, but then the values for those signals are copied from the logistics network, so they let you do combinator logic on logistics network numbers, saving you from wiring hoards of chests if what you want is just a total of all storage.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections

zKruki
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Sep 06, 2015 5:05 pm
Contact:

Re: Combinators 101

Post by zKruki »

Mr. GopherAtl,

What subject(s) do you recommend studying to understand the principles of your concepts? Factorio has changed forever ever since I stumbled upon the Build Code Circuit you coded for Negative Root. Thanks!

User avatar
Astrella
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Wed Sep 16, 2015 11:33 am
Contact:

Re: Combinators 101

Post by Astrella »

GopherAtl wrote:Everything
Everything tests just that - every signal it's getting. The condition will be true only if it was true for every one of those signals. For example, a decider with "everything > 10" with it's input connected to a constant combinator outputting only "iron plates = 11" will test true. Add a second signal to the constnat combinator, "copper plates = 1", and now it will test false, because it is getting a copper plates signal, and it is not greater than 10. Change it to 11 as well, and the condition will be true again.

Now, remember when I said 0 values tend not to actually be sent as signals? Here's where that's important. If you have 1 copper and 10 iron, the "everything>10" test will fail, but if you take away that 1 copper, the test will pass. 0 copper is no copper signal, and will not be considered in the test at all! Bear this in mind, as it sometimes limits the usefulness of "everything" as a setting.
Not sure if I've grasped everything but could you not fix the "0 is no signal" problem for everything by adding a Constant Combinator for everything you're testing for that puts out 1? E.g. add one that puts out 1 for iron and one that puts 1 one for copper to the network in your example and raise your testing value by 1.

BlaatMekker
Inserter
Inserter
Posts: 29
Joined: Sun Dec 28, 2014 10:01 am
Contact:

Re: Combinators 101

Post by BlaatMekker »

A simpler S-R latch design: two binary (0/1) signals (A and B) being fed into one signal decider combinator which feeds back into itself. Because the signals need to be binary you require additional decider combinators when hooking up chests.
Screen Shot 2015-10-03 at 13.15.14.png
Screen Shot 2015-10-03 at 13.15.14.png (311.09 KiB) Viewed 20410 times
The condition on the light is "A > 0". It holds the S or R signal, which ever was active first. I don't think it can flicker either.

I think that I copied it from one of the FFF, though it might have been this forum itself.

BlaatMekker
Inserter
Inserter
Posts: 29
Joined: Sun Dec 28, 2014 10:01 am
Contact:

Re: Combinators 101

Post by BlaatMekker »

I use the setup from my previous post to control how much cracking is going on at my chemical plant. The output of the S-R latch (C1) is attached to a pump (C2) which controls how much of the cracked product is put into the next storage tank. By controlling the output of the cracking plants instead of the input the system becomes more responsive.
Screen Shot 2015-10-03 at 13.23.08-1.png
Screen Shot 2015-10-03 at 13.23.08-1.png (887.85 KiB) Viewed 20410 times
I have added some extra components to not make it jumpy when the fluid levels keep changing. The lights are used to see if Set, Reset, or Output is active.

Signal A (set) is defined as "Light Oil > Petroleum Gas", outputting A = {0,1}. Before the amount of Light Oil is put into the decider I first subtract 500. This creates a small buffer so that the oil refineries can have some time to catch up.

Signal B (reset) is defined as "Petroleum Gas > 2.4K", outputting B = {0, 1}. The reason that I create this signal using a constant is to ensure that a reset signal can be generated, by not including the ever changing levels of Light Oil.

I could have probably used a couple fewer wires if I hadn't used the storage tank contents as the binary output signals, but had actually used A/B.

Malkasphia
Inserter
Inserter
Posts: 22
Joined: Wed Dec 18, 2013 4:18 am
Contact:

Re: Combinators 101

Post by Malkasphia »

Here is a video demonstrating Combinator clocks, I know it is a couple of months late but it might help the wiki with a video for the clock segment instead of text - https://youtu.be/r1o73wvdZr8

Bizz Keryear
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Thu Oct 22, 2015 5:08 am
Contact:

Re: Combinators 101

Post by Bizz Keryear »

Hi I was reading this and it helped me a lot (since RS latches will never go into my head ... not here not in minecraft ... not in RL), but I stumbled over the
GopherAtl wrote:[...]
a blueprint string[...]
H4sIAAAAAAAA/9WS0WrDMAxFf6X42SmNuz4V7UfKCJ7tDIEjB8cZDSb/PscJo+3WtRuDsUcn0tXV0dVuZZ2SdlVBNBQwoOkgRpKNAaYcdUFSKJRrnpFkcJ7x
1nWpyhHEIxRiveMDFJv1buQ12mD81N3hC0kLMQxtUnlFH3ppGZ9F55/Fho1cuZ4CbDiSNkcox3Hky2RtFGrjrw4u36dq9EblzyLpEc2P5OLASvYE0RudHOXV
hgo17LhCr3oM00OkiS/eGDoryUYOTNxsnwqnLUjjMnTxDbFG34XqfhAz6MQibdxKP20MDBh3fWj77wi1Q5WxVrV3TYWUuoHV0naGnfDtGmltYWXTnnPd5ntm
sJ/B/MjqEucFj+XnL/F4PF3h3nCWf5HN8ifRFLej+fBFNMVFND9p3/67wI4cVTYal0Pwq0dIB5prBL+ekKS49yb0nlbV3pB+A7+5AAsABQAA
How do I use this? Was a whole lot time wondering if I can transfer blueprint data made in one save into another.

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 950
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Combinators 101

Post by ratchetfreak »

Bizz Keryear wrote:Hi I was reading this and it helped me a lot (since RS latches will never go into my head ... not here not in minecraft ... not in RL), but I stumbled over the
GopherAtl wrote:[...]
a blueprint string[...]
H4sIAAAAAAAA/9WS0WrDMAxFf6X42SmNuz4V7UfKCJ7tDIEjB8cZDSb/PscJo+3WtRuDsUcn0tXV0dVuZZ2SdlVBNBQwoOkgRpKNAaYcdUFSKJRrnpFkcJ7x
1nWpyhHEIxRiveMDFJv1buQ12mD81N3hC0kLMQxtUnlFH3ppGZ9F55/Fho1cuZ4CbDiSNkcox3Hky2RtFGrjrw4u36dq9EblzyLpEc2P5OLASvYE0RudHOXV
hgo17LhCr3oM00OkiS/eGDoryUYOTNxsnwqnLUjjMnTxDbFG34XqfhAz6MQibdxKP20MDBh3fWj77wi1Q5WxVrV3TYWUuoHV0naGnfDtGmltYWXTnnPd5ntm
sJ/B/MjqEucFj+XnL/F4PF3h3nCWf5HN8ifRFLej+fBFNMVFND9p3/67wI4cVTYal0Pwq0dIB5prBL+ekKS49yb0nlbV3pB+A7+5AAsABQAA
How do I use this? Was a whole lot time wondering if I can transfer blueprint data made in one save into another.
blueprint string mod:

https://forums.factorio.com/forum/vie ... 92&t=13651

goku90504
Inserter
Inserter
Posts: 24
Joined: Mon Nov 16, 2015 9:16 am
Contact:

Re: Combinators 101

Post by goku90504 »

I only recently bought the game (had it about a week or two now) and I've gotten a free play map to all research complete but I can't find combinators in my production list ?

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Combinators 101

Post by Bisa »

goku90504 wrote:I only recently bought the game (had it about a week or two now) and I've gotten a free play map to all research complete but I can't find combinators in my production list ?
What version of the game are you playing? If you are on the "stable" branch you will not have access to them, try this link to download the experimental (but currently pretty stable) builds https://www.factorio.com/download/experimental

and welcome to the world of Factorio :geek:
Hosting a factorio server? Take a look at this || init script ||.

Brambor
Fast Inserter
Fast Inserter
Posts: 125
Joined: Thu May 07, 2015 1:52 pm
Contact:

Re: Combinators 101

Post by Brambor »

If you have 1 copper and 10 iron, the "everything>10" test will fail, but if you take away that 1 copper, the test will pass.
You have a mistake there. The test will not pass cause 10=10, you ment 11

EDIT: Oh sorry, it is in the 5th spoiler, right under Everything

PadaV4
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Mar 08, 2016 11:29 pm
Contact:

Re: Combinators 101

Post by PadaV4 »

Big thanks to the OP for making this guide, very useful, i just made my first network(an alarm system to warn when coal runs low in the boilers). A few hours ago i thought i would never understand what those combinators do :lol:

Commander Keen
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Apr 01, 2016 8:28 pm
Contact:

Re: Combinators 101

Post by Commander Keen »

The guide is great! Thank you!
How about we do some sketches like the attached one. I think that makes it easier to understand.
How you think?
I used this Programm (free) for it: https://www.yworks.com/products/yed
Attachments
Factorio.jpg
Factorio.jpg (31.06 KiB) Viewed 18056 times

Post Reply

Return to “Combinator Creations”