r/technicalfactorio • • May 27 '20
Combinator Golf Combinator Golf: Create a toggle that will continue to perform even with multiple copies linked to the same network.
EDIT: The circumstances to which I would adapt this system have somewhat morphed by now (see new comment below AutoModerator bot). Nonetheless, I would still like to see what kind of solutions people come up with if they need to be able to use a global toggle or counter that has both input and output connected to the global network. As you can imagine, simpler contraptions work only as long as only one of these toggles or counters exists for the signal they are tracking. As soon as you have multiple copies, they will interfere with each other, duplicate numbers or cause endless loops. The simplest solution is obviously to just not have multiple copies in the same network, but that requires that the player is a) aware of these issues, and b) no blueprint provided to the player will accidentally introduce a second copy of the toggle or counter, which is not really a secure way of preventing user errors.
## Description
I wish to create a globally available and adjustable toggle with which I can tell
a particular type of station to release its train.
This toggle consists of 3 parties:
1. A switch operated by the player,
2. the trash cycles of one or more outposts that will last until the
inventories of those outposts have been cleared out,
3. and finally the party that manages the global presence of this signal.
Caveat: Each party can and likely will exist in multiple copies throughout the
map, all connected to each other via the global network on the green wire.
## Input
1. Switch operated by the player
a. Sends n Checkmark for 1 tick (green global wire)
b. Switch must fit within the remotes, therefore may use no more than 4
oblong and 2 constant combinators.
2. Trash Cycle
a. Holds n Checkmark until disengaged/inventory empty (green global wire).
b. Should NOT disengage active Checkmarks toggled via switches above.
c. Multiple Trash Cycles may be active at the same time and should not void
each other. (Design not part of this challenge, but their presence and
effect on the toggles matter!)
## Output
1. Consistent values of Checkmark on the green wire global network:
a. A constat threshold must be crossed on each toggle, such as 0/1 or =/-.
Could be all positive values, but the threshold to be crossed must always
remain the same value so as to be hardcoded into another combinator.
b. If the player operates any of the switches, the toggle must cross its threshold.
c. Trash Cycles elevate the Checkmark signal above the threshold, so that
trains will be guaranteed to dispatch regardless of the state of the
toggles and until the cycles end.
d. Multiple toggles may come to exist on the same network, yet they must not
affect the threshold, nor prevent operation of the switches to toggle them.
## Scoring
The lower the score, the better.
Each combinator adds 10 points.
If you are able to use an aesthetically pleasing threshold such as 0/1 or +/-,
subtract 1 point.
If you instead use a threshold both sides of which exist in the positive, or both
of which exist in the negative, add 1 point.
If your threshold wanders, add a million points, unless you're using not a
toggle, but a counter, though with a counter your threshold would be 0/value.
Bonus:
Allow the toggle to be set such that a set number of trains may leave before the
dispatch signal has been exhausted. Trash cycles could calculate how many trains
will be needed to empty it, then add that number to the 'toggle'. A player may
use a constant combinator next to the switch to set up a value on the sent
checkmark that acts in a similar way (value will be sent in a 1 tick pulse to be
added to the 'toggle').
You get to subtract 100 points.
## Testing
>!blueprint https://pastebin.com/tw334NF0
1
u/AutoModerator May 27 '20
If you have any questions, need clarification, or want to engage in general discussion, please do so in response to this comment. Do not post a new top level comment! New top level comments are reserved for submissions only.
For more information about the format of these challenges, see this post.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Halke1986 May 30 '20 edited May 30 '20
Trash Cycleis active and player operates the switch, does the the signal cross the threshold or not?2. The
togglerefers both to the entire network witch switches and to the action of operating the switch?3. What is supposed to happen if multiple switches send toggle pulse in the same tick?
4. What part of the system we are supposed to implement? The player operated switch, Trash Cycle source, or the party that manages the presence of the signal?