Filter Combinator

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
FunMaker
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 08, 2016 8:43 pm
Contact:

Filter Combinator

Post by FunMaker »

Hi,

i have not found this suggestion by searching for "filter" in the "Factorio direction" sub-forum.

i think there should be a combinator that filters in-signals to out-signals. The UI should be that of the constant combinator. Just set the signals that you want to filter and these are the only signals that will be send to the output. Currently i have to build n arithmethic combinators with no sense (X*1 = X) to filter n signals. Current setup does not increase play value.

Other suggestion would be to allow EACH(red-wire) * EACH(green-wire) = EACH in arithmethic combinator. Just put the input on red wire and a constant combinator(set signal: 1 for each filtered signals) on green wire would achieve the same but that is neither possible because each is only allowed on left side of the combinator.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Filter Combinator

Post by ssilk »

i think there should be a combinator that filters in-signals to out-signals.
Ah, a router combinator.
I thought a bit and I don't understand exactly in what situations you need this. What do you want to built?



For the second I think we had a similar suggestion, splitting comparison between red and green. Ah here it is: viewtopic.php?f=6&t=26944 Expand Circuit Network's "Each"
You should read it, but I think yours is a bit different. I think this runs into performance problems, cause (as EACH currently would work with the current combinator) it will multiply N red signals with M green. Each tick. Not what was wanted. :)

I think the handling of EACH is currently in general not well designed. And not intuitive, cause EACH is not a signal (like the others), but an operator!
So I think all of that "special" operators need to be rethought, cause I think it's not clear, what should come out, when you need to do more than "*".
And I would split this completely up into a separate combinator, cause it is experimental stuff. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

FunMaker
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 08, 2016 8:43 pm
Contact:

Re: Filter Combinator

Post by FunMaker »

ssilk wrote:
i think there should be a combinator that filters in-signals to out-signals.
Ah, a router combinator.
I thought a bit and I don't understand exactly in what situations you need this. What do you want to built?



For the second I think we had a similar suggestion, splitting comparison between red and green. Ah here it is: viewtopic.php?f=6&t=26944 Expand Circuit Network's "Each"
You should read it, but I think yours is a bit different. I think this runs into performance problems, cause (as EACH currently would work with the current combinator) it will multiply N red signals with M green. Each tick. Not what was wanted. :)

I think the handling of EACH is currently in general not well designed. And not intuitive, cause EACH is not a signal (like the others), but an operator!
So I think all of that "special" operators need to be rethought, cause I think it's not clear, what should come out, when you need to do more than "*".
And I would split this completely up into a separate combinator, cause it is experimental stuff. :)
Well in my situation i have a train system that is filled by request. i have only 2 stations at this time(oil dependend factory and main factory) and all requests are send over one wire. so main factory and oil factory requests are on the wire. So i have to filter what items have to be put into the train. Okay it would be possible to overcome this limitation by using 2 wires (one for each direction) but i like the filtering idea overall.

I second your thought that devloping the virtual signals EACH, ANYTHING or EVERYTHING further.

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Filter Combinator

Post by siggboy »

FunMaker wrote:Currently i have to build n arithmethic combinators with no sense (X*1 = X) to filter n signals.
You don't need one combinator per signal (only in the very general case where you need to be able to filter the full range of values); for most purposes it's possible to filter arbitrarily many signals with 2 arithmetic combinators and 1 decider combinator.

A "filter combinator" is too specialized, so it's very unlikely that an entity will be added to the game (we don't even have a memory/register combinator, and that's arguably a lot more useful than a dedicated filter combinator).

Twinsen (the combinator guy in the Factorio team) has already stated that he's very cautious with adding new entities to the game. I really don't think he'll be considering a Filter Combinator.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Filter Combinator

Post by siggboy »

ssilk wrote:I thought a bit and I don't understand exactly in what situations you need this. What do you want to built?
There are many applications for a "filter" circuit.

I give you an example from the circuit I'm currently building:

If you have a set of outposts that you are asking for their ID and resources, then you can set your filter to the resource(s) that you are currently interested in. That way you can easily pick an outpost from the stream of responses.

In other cases you might have a whole bunch of signals during the same tick, but you only want to store a subset in a register. So you have to filter the interesting signals first before you write to the register.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

Lilly
Inserter
Inserter
Posts: 49
Joined: Mon Apr 11, 2016 6:42 pm
Contact:

Re: Filter Combinator

Post by Lilly »

I found myself in need of something like this, though managed to come up with a work-around. If the signals are all positive then:
  1. Create a constant combinator with all the signals you want to keep set to 1. If you need more than 18 signals, use multiple combinators and connect those.
  2. Then attach these to an arithmetic combinator set to: each * -2147483648 -> each. This is the filter mask.
  3. Feed the filter mask (red wire) and your signals (using a green wire) into a decider combinator set to: each < 0 output each (input value).
  4. Attach the filter mask (green wire) to the output of the decider combinator. This green wire now contains the filtered set of signals.
If the signals can be negative, the procedure is slightly different. First feed your signals through an arithmetic combinator set to: each + 536870912 -> each. Then follow the steps above, but instead of step 4, feed the output of the decider combinator to another arithmetic combinator set to: each + 536870912 -> each. This method works for signals with a value between -536870912 and +536870911.
Example blueprint for filtering all science packs from the logistics network

DerGraue
Fast Inserter
Fast Inserter
Posts: 151
Joined: Mon May 30, 2016 12:12 pm
Contact:

Re: Filter Combinator

Post by DerGraue »

@Lilly

you don't actually need that arithmetic combinator, just set the constant combinator to -2147483648 of the filtered items.

The integer overflow isn't really required as well, I use a setup with 2 constant combinators and a decider, 1 constant adds a high number(like 1000,000,000) of the filter items to the input, the other one substracts the same amount after the decider. The decider is set to each > 500,000,000 -> each

this works for both positive and negative numbers in this range.
But I really like your setup with the 2* -2147483648 = 0, maybe I will steal that for my builds if I want to save a constant combinator.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Filter Combinator

Post by Optera »

Making a filter with programmable whitelist was something I had to come up with for LTN at one point.
This filter will only let green wire signals > 0 pass that have a red wire signal > 0.

To also work with negative signals you'd have to double up the filtering part and change the red wire decider to != 0.
2018-01-06-19-10-02-9926415.jpg
2018-01-06-19-10-02-9926415.jpg (37.65 KiB) Viewed 4765 times

Code: Select all

0eNrNVu1uozAQfJf9eYJTIEDuUHQvcqqQA5tmJbCRbaJGEe/eNZzaXPkKUVX1TxSz9nh2Z3fgCoeywVqTtJBegXIlDaR/r2DoWYrSPbOXGiEFsliBB1JUbiU02VOFlnI/V9WBpLBKQ+sByQJfIA1abxGjwJwK1OMAYfvkAUpLlrBn1C0umWyqA2q+YYGLB7UyfFpJR4AR/fBn7MHF/eFrCtKY99HEA07balVmBzyJM/FpPvIOm3G46KCMCxxJG5sNkjuTtg0/eePV7/BR5CeXmEEH47CMFa7cW05B1ahFTwP2ez6rGls3q9HbtstB9il1LAP386wR5W31qODS8l7SeUO2XzqpbsLx/+GgfWLw0KFpLBaxWLXRS+PBRkd6oGo41x0DSTfrFP0H+Tlyvuu4cYuqFrojmcKfh2V0QPWF+TXSZketqowkw0B6FKXBKZFHZIlmRQvmGyAZNMCEpsGwU8Y03b4lW2FBTeVjySloHtdalTgyqFEn6mZNT9/ZXtFKKttZJsvzMF275L7axQ+7XPA9TM7/YHI/vsbjgkkTu2f7x4nYzk/IVLclD5lZ8J28bP/5XmZ1s8bK7n7DRAsaj1oEg3UfJenNd5AHZ9SmL/6vXbiJ4t+7XdK2r6PZJ0Q=

Post Reply

Return to “Ideas and Suggestions”