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.

Re: Combinators 101

Postby XKnight » Mon Aug 17, 2015 8:26 pm

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

Re: Combinators 101

Postby nobodx » Mon Aug 17, 2015 8:34 pm

=O didn't even thought about negative values
nobodx
Fast Inserter
Fast Inserter
 
Posts: 156
Joined: Mon Jul 06, 2015 3:22 pm

Re: Combinators 101

Postby ratchetfreak » Mon Aug 17, 2015 8:56 pm

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
ratchetfreak
Filter Inserter
Filter Inserter
 
Posts: 819
Joined: Sat May 23, 2015 12:10 pm

Re: Combinators 101

Postby nobodx » Tue Aug 18, 2015 2:22 pm

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
nobodx
Fast Inserter
Fast Inserter
 
Posts: 156
Joined: Mon Jul 06, 2015 3:22 pm

Re: Combinators 101

Postby ratchetfreak » Tue Aug 18, 2015 3:28 pm

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
ratchetfreak
Filter Inserter
Filter Inserter
 
Posts: 819
Joined: Sat May 23, 2015 12:10 pm

Re: Combinators 101

Postby theit8514 » Tue Aug 18, 2015 8:51 pm

Thanks for this post. I was finally able to get my terminus station logic worked out. Fun, but exhausting.
Images
This logic accounts for:
  • Multiple stations with the same name (trains go to other stations when another is deactivated).
  • Stations should be deactivated when full.
  • Trains should not be trapped in stations.
  • Should reset when falls below specified limits.

This uses the RailLogicSystem mod to detect the signal status and to toggle the track on/off. Blueprint: https://www.dropbox.com/s/u2u2mtivejgvszx/Train%20Station%20Logic%20v2.blueprint?dl=0
Image
The center of the logic system left of the two lights forms a RS-Latch, which toggles the track switch. The image shows the system in "set" mode, where the station is full and no trains are allowed in.
The "reset" comes when the bottom AND gate reports true. The AND gate inputs from the combinator (red line going to large pole) and a timer which pulses every second. When the amount of storage in the system drops below a certain value, the latch resets and trains can come in.
Image
The only way the station can shut down is if the top AND gate is true. Those inputs are: the amount goes above a certain value (combinator to right of lights) and the train leaves the station (signal detector to pulse generator).
theit8514
Long Handed Inserter
Long Handed Inserter
 
Posts: 51
Joined: Sun Apr 20, 2014 2:11 am

Re: Combinators 101

Postby nobodx » Wed Aug 19, 2015 7:08 am

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 ;)
nobodx
Fast Inserter
Fast Inserter
 
Posts: 156
Joined: Mon Jul 06, 2015 3:22 pm

Re: Combinators 101

Postby GopherAtl » Wed Aug 19, 2015 9:15 am

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
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: Combinators 101

Postby zKruki » Sun Sep 06, 2015 5:34 pm

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!
zKruki
Manual Inserter
Manual Inserter
 
Posts: 1
Joined: Sun Sep 06, 2015 5:05 pm

Re: Combinators 101

Postby Astrella » Sat Sep 26, 2015 8:14 am

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.
Astrella
Burner Inserter
Burner Inserter
 
Posts: 5
Joined: Wed Sep 16, 2015 11:33 am

Re: Combinators 101

Postby BlaatMekker » Sat Oct 03, 2015 11:19 am

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 5323 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: 24
Joined: Sun Dec 28, 2014 10:01 am

Re: Combinators 101

Postby BlaatMekker » Sat Oct 03, 2015 11:45 am

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 5323 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.
BlaatMekker
Inserter
Inserter
 
Posts: 24
Joined: Sun Dec 28, 2014 10:01 am

Re: Combinators 101

Postby Malkasphia » Tue Oct 27, 2015 8:51 am

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
Malkasphia
Inserter
Inserter
 
Posts: 22
Joined: Wed Dec 18, 2013 4:18 am

Re: Combinators 101

Postby Bizz Keryear » Thu Oct 29, 2015 7:25 pm

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.
Bizz Keryear
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Thu Oct 22, 2015 5:08 am

Re: Combinators 101

Postby ratchetfreak » Thu Oct 29, 2015 7:42 pm

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:

viewtopic.php?f=92&t=13651
ratchetfreak
Filter Inserter
Filter Inserter
 
Posts: 819
Joined: Sat May 23, 2015 12:10 pm

Re: Combinators 101

Postby goku90504 » Mon Nov 23, 2015 2:13 am

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 ?
goku90504
Inserter
Inserter
 
Posts: 24
Joined: Mon Nov 16, 2015 9:16 am

Re: Combinators 101

Postby Bisa » Mon Nov 23, 2015 10:12 pm

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 ||.
Bisa
Filter Inserter
Filter Inserter
 
Posts: 445
Joined: Fri Jul 17, 2015 3:22 pm

Re: Combinators 101

Postby Brambor » Fri Jan 29, 2016 9:43 pm

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
Brambor
Long Handed Inserter
Long Handed Inserter
 
Posts: 57
Joined: Thu May 07, 2015 1:52 pm

Re: Combinators 101

Postby PadaV4 » Tue Mar 08, 2016 11:36 pm

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:
PadaV4
Manual Inserter
Manual Inserter
 
Posts: 1
Joined: Tue Mar 08, 2016 11:29 pm

Re: Combinators 101

Postby Commander Keen » Mon Apr 11, 2016 10:43 am

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 2969 times
Commander Keen
Manual Inserter
Manual Inserter
 
Posts: 3
Joined: Fri Apr 01, 2016 8:28 pm

PreviousNext

Return to Combinator Creations

Who is online

Users browsing this forum: No registered users and 2 guests