Prioritizing signals?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
wilk85
Inserter
Inserter
Posts: 31
Joined: Sat Nov 16, 2019 11:20 am
Contact:

Prioritizing signals?

Post by wilk85 »

Hello i have a question

Is there a way to dynamically add priority to a signal?
for example i have a constant combinator with 5 different types of signals example in the image
So signals have different values, but some of them got same signal value
12-31-2025, 10-28-09.png
12-31-2025, 10-28-09.png (65.44 KiB) Viewed 211 times
How can i add priority to a signal which for example will be constant combinator, but after fulffiling that signal ( in this case if that item will be built ) and signal will dissapear how to dynamically pass priority to a next one which will be chosen from priority list?

Is that even possible to do? Without building few dozens of combinators?
Kyralessa
Filter Inserter
Filter Inserter
Posts: 775
Joined: Thu Sep 29, 2016 5:58 pm
Contact:

Re: Prioritizing signals?

Post by Kyralessa »

Could the selector combinator help?

https://wiki.factorio.com/Selector_combinator

You can use it to pick:
  • Highest-numbered signal
  • Lowest-numbered (non-zero) signal
  • Signal at a given index (0, 1, 2, 3...)
  • A random signal from among those present
wilk85
Inserter
Inserter
Posts: 31
Joined: Sat Nov 16, 2019 11:20 am
Contact:

Re: Prioritizing signals?

Post by wilk85 »

issue with selector combinator is, if you have values like 19 20 it will choose the one which is highest, so if

item 1 = 20
item 2 = 19

and priority set by selector is item 1 if it reach 18 it will jump to item 2 and that's not my goal here. Also setting amount of time to a random signal is not the goal here
Kyralessa
Filter Inserter
Filter Inserter
Posts: 775
Joined: Thu Sep 29, 2016 5:58 pm
Contact:

Re: Prioritizing signals?

Post by Kyralessa »

OK, if I'm understanding right, what you're looking for is:
  • You have a set of items to produce: 100 yellow belts, 200 inserters, 50 gears, etc.
  • You want to pick one to produce until demand is satisfied.
  • Even if demand drops below other signals (e.g. 200 inserters falls to 99 inserters), you don't want to change recipes until demand is fully satisfied and the signal drops to 0.
  • When the signal drops to 0, you want to pick a new signal to produce.
Perhaps you also want to always prioritize the highest signal, but it sounds challenging enough if you don't care which signal you start with. I gather you'd need an SR latch of some kind to hold the current item until its signal drops to 0.
wilk85
Inserter
Inserter
Posts: 31
Joined: Sat Nov 16, 2019 11:20 am
Contact:

Re: Prioritizing signals?

Post by wilk85 »

thank you for joining discussion, i'm not suree if i cannot gather all things into one, or it's just not possible to achieve

still with latch i would need to set the priority for signal for disabling constant flickering. Anyway i will move to fCPU i think
Linsanga
Inserter
Inserter
Posts: 43
Joined: Sat Oct 26, 2024 5:47 pm
Contact:

Re: Prioritizing signals?

Post by Linsanga »

You can do this with 3-4 combinators (depending on whether you just need the highest priority signal, or if you also need to keep the correct count with that signal)

I'll assume your input signal is on green.
  • Create a constant combinator with the priority of all items.
  • Replace the numbers on the input signal with the priorities.
    • Connect a decider combinator to both your signal (green) and the constant combinator (red).
    • The decider should do: if each (green) > 0 AND each (red) > 0, output each input count (red).
  • Select the highest priority signal: A selector combinator that selects the largest number does this.
  • You now have selected the highest-priority item. If you need the original count to accompany that signal, one more decider combinator can put the count back (using: if each red > 0, output each green).
Nidan
Filter Inserter
Filter Inserter
Posts: 343
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Prioritizing signals?

Post by Nidan »

wilk85 wrote: Wed Dec 31, 2025 5:13 pm thank you for joining discussion, i'm not suree if i cannot gather all things into one, or it's just not possible to achieve
The circuit network is Turing complete; as long as it can be calculated/programmed somehow, the circuit network can do so as well.

That theoretical view is quite impractical, so here's something more concrete: I'll give some combinator counts to the steps outlined by Kyralessa
Kyralessa wrote: Wed Dec 31, 2025 2:22 pm
  • You have a set of items to produce: 100 yellow belts, 200 inserters, 50 gears, etc.
That's once constant combinator and maybe an arithmetic one to calculate "want = target - have".
  • You want to pick one to produce until demand is satisfied.
As was already mentioned this could be a selector for picking the highest "want" signal. But you could instead use more complex logic if you wish.
  • Even if demand drops below other signals (e.g. 200 inserters falls to 99 inserters), you don't want to change recipes until demand is fully satisfied and the signal drops to 0.
The important part. You must latch either the input or output of the selection from the last step. You can do that with e.g. two deciders. Not latching results in the flickering you mentioned.
  • When the signal drops to 0, you want to pick a new signal to produce.
That's resetting the latch, probably just one decider for detecting you're done and wiring that to the reset input of the latch.
Post Reply

Return to “Gameplay Help”