Friday Facts #384 - Combinators 2.0

Regular reports on Factorio development.
ElderAxe
Fast Inserter
Fast Inserter
Posts: 153
Joined: Thu May 18, 2017 8:04 am
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by ElderAxe »

Justderpingalong wrote: Fri Nov 10, 2023 12:26 pm This is nice and all... but does this FINALLY give us a way to 'sanitize' our inputs? Specific case: I was working on making a station using LTN that would allow me to load multiple types of cargo. The problem is that LTN's station, alongside expected cargo, also dump out a whole bunch of other data. And as I was using filter inserters with set filter, this could lead to them trying to set their filter to a signal instead of an item. If I were able to 'sanitize' my input, this would be a lot less cumbersome. Because right now the only way I could would be to add an arithmatic combinator which multiplies the values of all the data I didn´t want by -1. I think a nice feature for the 'selector combinator' would be to specifically filter out either groups of signals (so u can filter out any 'non-entity' signals like letters) or specific values, though a group would be most useful in my specific case.
This suggestion would be very beneficial.
I usually have a constant combinator that has predefined 1M for the signals I want to keep and with a decider combinator I filter values that are bigger than 1M. After that, I subtract 1M from the remaining signals with an arithmetic combinator to find the actual useful signals.
User avatar
Gergely
Filter Inserter
Filter Inserter
Posts: 616
Joined: Sun Apr 10, 2016 8:31 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by Gergely »

I find it weird you chose to use the selector combinator to "select" the stack size or rocket capacity of item signals. It does not seem like the kind of procedure that needs a dedicated operation inside a combinator. You could have added these options as a new radio button next to the "1" and "input count" in the output side for decider combinators, which would pick the right stack size (or rocket capacity) for each signal it outputs.
User avatar
DanGio
Filter Inserter
Filter Inserter
Posts: 398
Joined: Sat May 10, 2014 6:22 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by DanGio »

ElderAxe wrote: Sat Nov 11, 2023 11:46 am
Justderpingalong wrote: Fri Nov 10, 2023 12:26 pm This is nice and all... but does this FINALLY give us a way to 'sanitize' our inputs? Specific case: I was working on making a station using LTN that would allow me to load multiple types of cargo. The problem is that LTN's station, alongside expected cargo, also dump out a whole bunch of other data. And as I was using filter inserters with set filter, this could lead to them trying to set their filter to a signal instead of an item. If I were able to 'sanitize' my input, this would be a lot less cumbersome. Because right now the only way I could would be to add an arithmatic combinator which multiplies the values of all the data I didn´t want by -1. I think a nice feature for the 'selector combinator' would be to specifically filter out either groups of signals (so u can filter out any 'non-entity' signals like letters) or specific values, though a group would be most useful in my specific case.
This suggestion would be very beneficial.
I usually have a constant combinator that has predefined 1M for the signals I want to keep and with a decider combinator I filter values that are bigger than 1M. After that, I subtract 1M from the remaining signals with an arithmetic combinator to find the actual useful signals.
Yeah, using a constant combinator is more efficient as it can output several "filters" at once. In fact, I don't see how the suggestion adds anything new compared to the existing solution. How would it work, UI-wise ?
ElderAxe
Fast Inserter
Fast Inserter
Posts: 153
Joined: Thu May 18, 2017 8:04 am
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by ElderAxe »

crj wrote: Fri Nov 10, 2023 1:53 pm
if you have some ideas (for the Selector combinator) we would welcome them
How about some kind of unique-ID mechanism? That would be really handy in multiplexing signals from different parts of a mega-base, and is currently tricky to do. (The best way I know of is to leave a locomotive permanently parked at a train stop!)
Maybe it can return the network ID for the selected wire color. ,
Screenshot 2023-11-11 152357.png
Screenshot 2023-11-11 152357.png (3.55 KiB) Viewed 2957 times
BTW Reading train id as uid is a nice trick. Thanks.
User avatar
DanGio
Filter Inserter
Filter Inserter
Posts: 398
Joined: Sat May 10, 2014 6:22 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by DanGio »

Gergely wrote: Sat Nov 11, 2023 12:06 pm I find it weird you chose to use the selector combinator to "select" the stack size or rocket capacity of item signals. It does not seem like the kind of procedure that needs a dedicated operation inside a combinator. You could have added these options as a new radio button next to the "1" and "input count" in the output side for decider combinators, which would pick the right stack size (or rocket capacity) for each signal it outputs.
ElderAxe wrote: Sat Nov 11, 2023 12:24 pm
crj wrote: Fri Nov 10, 2023 1:53 pm
if you have some ideas (for the Selector combinator) we would welcome them
How about some kind of unique-ID mechanism? That would be really handy in multiplexing signals from different parts of a mega-base, and is currently tricky to do. (The best way I know of is to leave a locomotive permanently parked at a train stop!)
Maybe it can return the network ID for the selected wire color. ,
Screenshot 2023-11-11 152357.png

BTW Reading train id as uid is a nice trick. Thanks.
I like both of these suggestions.
ElderAxe
Fast Inserter
Fast Inserter
Posts: 153
Joined: Thu May 18, 2017 8:04 am
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by ElderAxe »

DanGio wrote: Sat Nov 11, 2023 12:21 pm
ElderAxe wrote: Sat Nov 11, 2023 11:46 am
Justderpingalong wrote: Fri Nov 10, 2023 12:26 pm This is nice and all... but does this FINALLY give us a way to 'sanitize' our inputs? Specific case: I was working on making a station using LTN that would allow me to load multiple types of cargo. The problem is that LTN's station, alongside expected cargo, also dump out a whole bunch of other data. And as I was using filter inserters with set filter, this could lead to them trying to set their filter to a signal instead of an item. If I were able to 'sanitize' my input, this would be a lot less cumbersome. Because right now the only way I could would be to add an arithmatic combinator which multiplies the values of all the data I didn´t want by -1. I think a nice feature for the 'selector combinator' would be to specifically filter out either groups of signals (so u can filter out any 'non-entity' signals like letters) or specific values, though a group would be most useful in my specific case.
This suggestion would be very beneficial.
I usually have a constant combinator that has predefined 1M for the signals I want to keep and with a decider combinator I filter values that are bigger than 1M. After that, I subtract 1M from the remaining signals with an arithmetic combinator to find the actual useful signals.
Yeah, using a constant combinator is more efficient as it can output several "filters" at once. In fact, I don't see how the suggestion adds anything new compared to the existing solution. How would it work, UI-wise ?
Maybe only allow signals if that signal exists on both wires. And output of those signals would be the same as the decider output: 1, R, G or R+G

@kovarex Is this possible with the decider combinator via checking "Each" signal on red wire AND "Each" signal on green wire to filter out signats that exist on both wires?

Something like this?
decider filter mode.jpg
decider filter mode.jpg (17.92 KiB) Viewed 2923 times
Last edited by ElderAxe on Sat Nov 11, 2023 5:56 pm, edited 1 time in total.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3634
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by mmmPI »

Svip wrote: Sat Nov 11, 2023 9:20 am I wonder if the developers experienced in their playtesting to use any index but 0 for the selector combinator's first function. I have a hard time imagining a scenario where you wish to select any other index but 0 after the list has been sorted. I'd suggest simplifying it into a min/max function instead, if there is never a true need for the other index positions. (Of course, if someone else can imagine such a scenario, I'd welcome it.)
If you multiply all signal by -1, i suppose index 0 now becomes the previously last index, so it can be used for MIN/MAX functions, with the addition of one combinator.
I'm surprised the first index is 0, i know it's common in programmation, but in factorio combinator a signal with 0 or no signal is the same, so it will be difficult to call a signal with the ID of 0. Maybe it help if you can use dummy signals to manipulate the ID of signals you wish to call so that you call ID 1 instead ?

That's a scenario where you wish to select another index than 0 but that is in order to use it as a MIN MAX function. That's not a very good one i admit regarding your interogation x)

Maybe to control train limits, so that the first signal gets 10 trains, the second 5 trains , the third 4 trains and so on, so that if one ressources becomes more desired or less desired, its signal change position, and the number of trains delivering that particular ressources gets reduced or increased to match that change in position. No sure it's a good one but i have a hard time imagining a better scenario. that's not quite convoluted /niche.
fusionfan
Inserter
Inserter
Posts: 25
Joined: Sat Jul 27, 2019 2:40 am
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by fusionfan »

These are all very nice. In particular the decider change will make some things much simpler, significantly fewer entities. I like compact circuit builds. Also much faster the debug, instead of trying to disentangle the wire spaghetti. Can't wait to use these!

The stack size combinator is also fantastic. I would have loved to use stack combinators so many times.

One note though
For example if you want to enable a lamp when your chest has 100 steel, 200 copper, 10 coal, you would need quite a few decider combinators.
I mean... this you can do with a constant combinator storing negatives of desired values, plus a decider. Good for as many conditions as the constant can hold signals. For more, add one more constant combinator. No need to check for each condition separately. I see this too many times when people overcomplicate circuits.
Hopscotch1337
Inserter
Inserter
Posts: 20
Joined: Fri Sep 15, 2023 12:42 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by Hopscotch1337 »

Lovin it, now it gets more like real programming.

Can´t wait, lets just release V2.0 next week?
ElderAxe
Fast Inserter
Fast Inserter
Posts: 153
Joined: Thu May 18, 2017 8:04 am
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by ElderAxe »

mmmPI wrote: Sat Nov 11, 2023 1:31 pm
Svip wrote: Sat Nov 11, 2023 9:20 am I wonder if the developers experienced in their playtesting to use any index but 0 for the selector combinator's first function. I have a hard time imagining a scenario where you wish to select any other index but 0 after the list has been sorted. I'd suggest simplifying it into a min/max function instead, if there is never a true need for the other index positions. (Of course, if someone else can imagine such a scenario, I'd welcome it.)
If you multiply all signal by -1, i suppose index 0 now becomes the previously last index, so it can be used for MIN/MAX functions, with the addition of one combinator.
I'm surprised the first index is 0, i know it's common in programmation, but in factorio combinator a signal with 0 or no signal is the same, so it will be difficult to call a signal with the ID of 0. Maybe it help if you can use dummy signals to manipulate the ID of signals you wish to call so that you call ID 1 instead ?

That's a scenario where you wish to select another index than 0 but that is in order to use it as a MIN MAX function. That's not a very good one i admit regarding your interogation x)

Maybe to control train limits, so that the first signal gets 10 trains, the second 5 trains , the third 4 trains and so on, so that if one ressources becomes more desired or less desired, its signal change position, and the number of trains delivering that particular ressources gets reduced or increased to match that change in position. No sure it's a good one but i have a hard time imagining a better scenario. that's not quite convoluted /niche.
I think index 0 is not the actual signal ID. Instead first element of the incoming signals array when sorted by signal id.
Batadon
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Nov 11, 2023 5:54 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by Batadon »

The sorting feature looks really useful! It would be even better if you can not only say "sort from biggest to smallest, then give me the signal at index n" but also "sort from biggest to smallest, then give me the first n signals". I suppose I can also just do that myself, but that still would be a really nice thing to have.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3634
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by mmmPI »

ElderAxe wrote: Sat Nov 11, 2023 5:44 pm I think index 0 is not the actual signal ID. Instead first element of the incoming signals array when sorted by signal id.
I'm not sure we are understanding each other, on the following picture i see the "0" as a hardcoded number, and imagine that one could use something like "A" with a value of 1, to call "index 1", in which case if the combinator is in the "ascending position" it will show the 2nd smallest signal and its value as output, because if one try to call index 0, it is not possible to send "A" with a value of "0".

I imagine one could change the value of A to iterate through the list, and i also assumed one cannot change "ascending" or "descending" order with signals so that one need to use a *-1 multiplication for the same combinator to switch from telling the MIN to telling the MAX if you don't know the lengh of the list and from there those speculations with dummy signals set to say -1G and +1G so that other signal representing quantity of material are never the index 0.

there.png
there.png (585.4 KiB) Viewed 2765 times
Last edited by mmmPI on Sun Nov 12, 2023 12:52 am, edited 1 time in total.
gGeorg
Filter Inserter
Filter Inserter
Posts: 436
Joined: Wed Jun 19, 2019 8:06 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by gGeorg »

I was thinking about
"Circuit GUIs rework" topic over night, it doesnt look ass great as yeastrday.
When you show all the details all the time, it actually is bigger than old supposedly-bigger version.
On top, you probably didnt think about new players. The new menu looks intimidating right at begining. When new player connect first wire and see massive menu with all the buttons, natural reaction is - run away.

Would you cosider combinatioin of old (minimalistic on start) method AND the new linked_method ?
Start with old small mennu, when one option is checked, then apropriate section popups next to it. You are right that value slot should be closer to option check element. So make it so, that check UI element is next to slot, but slot still disapear when not needed.

Also complex combinator like The new Selector looks pretty intimidating while showing all the options at once to new player.
Go easy is my advice.
ElderAxe
Fast Inserter
Fast Inserter
Posts: 153
Joined: Thu May 18, 2017 8:04 am
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by ElderAxe »

mmmPI wrote: Sat Nov 11, 2023 6:09 pm
ElderAxe wrote: Sat Nov 11, 2023 5:44 pm I think index 0 is not the actual signal ID. Instead first element of the incoming signals array when sorted by signal id.
I'm not sure we are understanding each other, on the following picture i see the "0" as a hardcoded number, and imagine that one could use something like "A" with a value of 1, to call "index 1", in which case if the combinator is in the "ascending position" it will show the 2nd smallest signal and its value as output, because if one try to call index 0, it is not possible to send "A" with a value of "0".

I imagine one could change the value of A to iterate through the list, and i also assumed one cannot change "ascending" or "descending" order with signals so that one need to use a *-1 multiplication for the same combinator to switch from telling the MIN to telling the MAX if you don't know the lengh of the list and from there those speculations with dummy signals set to say -1G and +1G so that other signal representing quantity of material are never the index 0.


there.png
You're right I didn't understand what you meant previously. Sorry about that.

When we are setting the "A" signal to make this dynamic, I think the combinator would consider it as zero if there is no "A" signal present at any moment. This would also solve lots of edge cases which would happen when the signal is missing.
GTexperience
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Oct 09, 2023 11:56 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by GTexperience »

Will it be compatible with old saves? At least the last version?
Agamemnon
Inserter
Inserter
Posts: 37
Joined: Fri Jun 29, 2018 9:48 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by Agamemnon »

Oh... yes! I almost forgot about memory circuits...

Tidbit about my experience with them: I avoid using them as much as possible - precisely because they are janky as hell. When I was trying to actually learn circuits by experimentation, not by watching tutorials and/or just copying others blueprints, I quickly discovered how unforgiving it is if you make a single wiring mistake. One misclick can cause one go through the process to reset all of it and feed the correct data back in - if you even recall what it was. I mean... I could just reload an autosave, but... :(

But, mistakes happen. And finding and fixing them is (at least for me) an inherently enjoyable thing to do. Less enjoyable it is, if in the process of hooking up a missed wire you are sent on a 2 hour cleanup journey, because you realize too late that this particular wire was missing for a reason...

TLDR: Using circuit memory would be much easier to learn and use if we get a basic building block that allows to manipulate its state in fewer than 3 GUI clicks (like a constant combinator, but ... well, not constant) It doesn't even need to cover every possible behavior. Building a memory cell manually for special use cases is still a neat brainteaser - but for the majority of the time I don't want to go through the same process N times in a row and repeat it all if I slip up at any point in the future. It's a question of convenience... Maybe make them a yellow science tech, if gating this would be considered necessary.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3634
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by mmmPI »

ElderAxe wrote: Sat Nov 11, 2023 7:32 pm You're right I didn't understand what you meant previously. Sorry about that.

When we are setting the "A" signal to make this dynamic, I think the combinator would consider it as zero if there is no "A" signal present at any moment. This would also solve lots of edge cases which would happen when the signal is missing.
Well now that you say it, it seem logical but it didn't occured to me earlier when doing the picture that it wouldn't be that hard to use index 0 if one can set the signal as "A" and the combinator read a value of "0" when there is no "A" signal present. The output of the combinator is then the "MAX" or "MIN" depending on the button.

The previous ramble thenapply only if one was to try to use a wildcard (each/anything/everything) signal instead of a defined "A" channel, there the index 0 is made annoying to use without dummy signal to manipulate the index. But i have no particular build in mind that would require to put a wildcard there, it's just a GUI possibility for me at this point.
Danjen
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Sun Jul 15, 2018 6:26 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by Danjen »

This is nice. I understand logistics and wire networks to be extremely powerful, but I always found it too cumbersome to bother with, which led me to making compact and efficient (basic) factories. Maybe I'll actually mess around with them now
JohnyDL
Filter Inserter
Filter Inserter
Posts: 535
Joined: Fri May 16, 2014 3:44 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by JohnyDL »

Oooh more circuit stuff, this is amazing :D I have so many ideas popping into my head for how it could be used many of which others have mentioned:
  • A cycling output from a memory cell -> with a handful of combinators, take a snapshot of signals, then output them one after another, when last signal is reached take a new snapshot and repeat @Svip
  • A single decider Combinator could be used to track which signals have existed and then gone to 0 (rather than have always been null), if Each Green != 0 or Each Red != 0 then Each = 1, this means that using 0 as a legitimate signal is much easier by having each = 0 for one colour and each (from this combinator) > 0 on the other @glee8e
  • Fliter/Sanitising Inputs -> If I only care about item data I can sanitise inputs by using the selector, get the stack size, and then a decider, if each stack size (green) is >0 then send each item data (red) to the output, as the stack size on signals I'd assume to be 0, this can also be done in reverse to get only signal data, though I'm not sure what fluids would do without having the ability to test. But you can also use inputs from a constant combinator to get specific outputs too. @ElderAxe @Justderpingalong @Arch-kain @pleegwat @Tooster @StansTheMan @Kadet123 @Chard @mmmPI @Agamemnon
  • Min/Max/Latch (of a particular signal over time) -> I think 2 combinators, if red >= green output red, if green > red output green, feed both back into either red or green (on both) and have the other side be data, and have a reset control signal too, I think you need 2 for min max cause you need to output either red or green wire not both, while set reset if A > X OR (Z=1 And A > Y) then Z = 1 (or A) turns on Z if A goes above X and turns off Z if A drops below Y in one combinator @thriem @Kyralessa @Philip017 @vark111 @melind @Roxor128
  • A bunch of ways to shrink many of my current builds
I can see a number of people confused by things that already exist within the game as someone who uses circuits now and then this seemed really intuitive to me but if you don't use them routinely you might not understand some of the basic assumptions that come as 'standard' with the current game, the ones listed below should address all the questions I can easily answer for @Tooster @gGeorg @Master-Guy @Moroquen @JAetherwing @Ext3h @Carnivale :
  • The game separates out signal colour in all the tooltips, this makes it really easy to see R vs G and it organises each by item quantity and then if they're the same value by signal/menu order.
  • When an icon has a red/green background then that's the colour of wire that signal is on, no colour means it comes from both wires (inputs) or is being sent to all connected wires (output).
  • All the new places you see the R/G check boxes refer to the inputs, if Red is selected then it only looks at the inputs on the red wire, if Green is selected it only looks at the signals on the green wire, and if both are selected then it looks at the sum of these two networks (which is the current/legacy behaviour) and I'd assume if neither were selected all signals would be 0.
  • When R/G are selected on the output side it means "copy the signals from the R/G network" (with those same input rules) to all connected outputs this is why it's in line with the 'input count' because it's referring to just the input, not where to put the output.
  • To control what network is outputted you need to connect either a Red or Green wire to the output, you can already select to only output only a Red or a Green, or on Both or on Neither this way.
  • The divide operator is always followed by the floor function, it's not rounded, in factorio 3/4 = 0 if you want to floor for a value greater than 1 first A / X = B then B * X = Floored number, right now you need to build Rounding and Ceiling off this feature, it is possible (for either with 2 combinators) A % X = C if C > 0 then Floored Number + 1 = ceiling number or if C * 2 (can be done by outputting C on Red and green and using both inputs together without another combinator) >= X then Floored number + 1 = Rounded Number
  • % is the Modulo opperator


As for my own suggestions.

With More to come on Circuits can we get more Circuit Colours R/G is a good start but R/G/B/C/M/Y/K/W would be great. Having Colours that are easily identifiable for Colour Blind folx is a bonus Accessibility feature. And maybe a network recolouring feature too? If you're trying to track everything connected to this specific Red wire change it to Cyan (or a colour you reserved for debugging and don't use anywhere) to debug and recolour back to Red after

I did like the idea of adding custom names to networks too though, when joining two different networks with custom names/descriptions maybe alert the player and ask them to confirm? and joining blank networks to named networks maybe give the option to suppress notifications for that one network for 5-60 minutes?

With more wire colours I suggest that combinators (and buildings) can only have 2 colours (like right now) just rename them to Colour 1 and Colour 2 behind the scenes, depending on what colours you wire with and in what order this could update the sprite (to those colours similar to colour switching on the player model/vehicles) and the detail panel inside (with the right labels) giving each networker on a MP server the opportunity to have their own signature style. There's 30 different colour combinations for each building/combinator but there's many more opportunities for style, like it could be I choose to use Red as larger input networks (from one output), Green as larger output networks (from 1 input) and Blue as single comparator hops, with Yellow, Cyan and Magenta bridging any gaps or where conflicts occur while reserving Black and White for debugging. Another player might only use Red and White for all their things with the occasional Black only where absolutely necessary. There are many many more styles that could be picked and it'd let people on MP server know at a glance who made what Circuit thing (or which Content Creator/Redditor/Forum user made it in some cases).

Similarly, Power Poles can still have 3 cables, either 2 signal wires and Copper Power Cables, or 3 signal wires. Players would still need to have 2 or 3 Power Poles for carrying many networks long distances in the same direction, but there's less chance of cross-contamination or mixup.

I've found a few times that having 2 global signal colours hasn't been enough for me and doing some complex multiplexing is outside my skill set, having more colours would be great. If you just do RGB and make it possible to mod in other things of this nature I'm sure I or someone else would write that mod ^_^ I don't think it's possible with the current API.

As for more features, it would be nice if the Arithmetic Combinator could choose Colours for the inputs, Green is the amount of X in the system Red is the stack size of X, Each Green X / Each Red X = number of stacks available. This would mean the calculation could be done with 2 Combinators for all items in a storage silo, while right now (even with the update) it's still a cumbersome task. This could then be used to calculate how many trains or Rockets are needed to move a set of items or how many storage chests are needed so that no logistic chest contains two items.

It'd be nice too if there were a way for an arithmetic Combinator to output multiple signals with related calculations for example it might be useful to take an input like a request for Red Science, and it outputs *1 for gears and *1 for copper plates or *2 for iron plates and *1 for copper plates, it has to use the same first input signal (not every/any/each) and the same operator but it could output several different related signals... A little more tedious than a crafting comparator but a whole lot better than what currently exists (and more configurable than a crafting comparator too with lots of different options)

Selectors could also do with the colour selectors for the inputs.

I think adding a LookUp Combinator would be a great way to split the functions of the Select combinator with "Selecting a Value from the given inputs put in various orders" count, menu order, random, green by red etc... being one set of functions and "Look Up Stats about the given inputs" be that stack size, rocket cargo limit, train wagon limit, play-time, Surface Time/Stats or production/usage stats etc...

Lastly, while we talk about new combinator features, a Diode Combinator a 1x1 that takes in One colour and pushes it to another one tick later without doing any processing, this allows for the easy isolation of things like inserters that might need their filter/handsize/enable set with one wire and to output hand contents with another... Especially where you don't want to contaminate the dynamic setting wire with the hand contents as it may be shared with other inserters... This is mostly just a UPS QOL since you don't need to do any math or ifs with the diode... and it's small enough to fit in many places the existing combinators that could do this function cannot
Last edited by JohnyDL on Sun Nov 12, 2023 11:39 am, edited 2 times in total.
JohnyDL
Filter Inserter
Filter Inserter
Posts: 535
Joined: Fri May 16, 2014 3:44 pm
Contact:

Re: Friday Facts #384 - Combinators 2.0

Post by JohnyDL »

Skorj wrote: Sun Nov 12, 2023 1:22 am
IForgotMyName wrote: Fri Nov 10, 2023 12:14 pm Some time ago I was thinking about how to enumerate all non-zero signals in a circuit. I thought that I didn’t have enough knowledge about combinators, but it turned out that this is now almost impossible. But at least it will be like this until version 2.0
I'm curious what you mean by "enumerate" here? You can count the non-zero input signals with 1 combinator, and perform the same computations for all non-zero input signals easily enough. I guess I'm struggling to understand the usecase for this new combinator, if there even is one in 1.1.
I think what IForgotMyName was going for with Enumerate is that say there are signals of A, B, C, D, E on one wire then some complex of logic assigns A = 1, B = 2, C = 3, D = 4, E = 5 to some other wire (perhaps even sorted), this would be incredibly difficult to do in any reasonable time in the current version, make a memory cell -> identify the maximum(s) and filter them out one by one while populating an enumeration buffer eventually you have a sorted list but it might have problems/conflicts if two signals have the same value, there's no easy way to separate them, you can't pick one at random, you could manually separate them out with a LOT of logic but it'd be tedious to set up and might not work very effectively.... However with the Selector it'd be easy, Sort Each => Output INDEX => Decider Each > 1 then Each = 1 => Arithmetic Each * INDEX = Each.

For uses maybe you want to load the thing with the most number of items onto a train first? not sure
Post Reply

Return to “News”