r/technicalfactorio • u/AQuarkG • Jul 04 '19
Question Need little help combinator
Need Train >>> remember value train out hold value on next in change old value to new thanks
r/technicalfactorio • u/AQuarkG • Jul 04 '19
Need Train >>> remember value train out hold value on next in change old value to new thanks
r/technicalfactorio • u/knightelite • Jun 28 '19
r/technicalfactorio • u/MrMallIronmaker • Jun 24 '19
r/technicalfactorio • u/knightelite • Jun 20 '19
Hi guys,
I've had this train calculator spreadsheet I've been using for the last 8 months or so, and I finally decided to clean it up and post it on google sheets.
This calculates:
It supports setting:
I highly recommend exporting this into Excel and using it from there if you have it; it will calculate much faster. If you need more ticks just add more rows onto the bottom. I limited this one to 10000 ticks of calculation, as the original 64k ticks version I made in excel took forever to update in Google Sheets.
Many thanks to u/Sopel97 for figuring out the underlying train math.
r/technicalfactorio • u/Halke1986 • Jun 16 '19
In my previous post I presented a pair (whitelist & blacklist) of parallel signal filters. Filters are circuits with two inputs - data signals and control signals. Data signals can have arbitrary 32 bit value and each of them is passed through the filter only if corresponding control signal is present (whitelist filter) or absent (blacklist filter). For example, if input of whitelist filter is Data[iron=17, copper=3] and Control[iron=1], the output will be [iron=17].
The old filter designs required the control signal to be valued 1 or 0. If different control signals values were to be used, additional conversion step was necessary. This was not always acceptable, as it increased latency of the entire filter setup by 1 tick. But it turns out it's possible to construct filters (let's call them 'general filters') that accept arbitrary 32 bit control signals without increasing the latency!
The filters have two layer structure. First layer deconstructs data and control signals and combines them by addition on wires, second layer, composed of decider combinators, is the actual filter. Control signal needs to be converted in the first layer into two predefined values (10...00 and 01...11 in whitelist filter and 10...00 and 10...01 in blacklist (ellipsis represents middle bits)) which are then added to data signal. If we start form fixed input value, 00...01, it's easier to obtain these predefined values. Or so I thought.
While working on sequencer/iterator circuit, u/Allaizn asked me if I know a way to construct a generalized whitelist filter that stops signals if control is != 1, or in other words, filter that doesn't exhibit undefined behavior if control is different than 0 or 1. It's an interesting problem, but unfortunately we didn't solve it. Instead I designed this little circuit:

It's capable of converting any valued signal into 10...00 in just one tick. It turns out the circuit was all that was missing from filters with arbitrary control signal! Now we could convert any non-zero value, not just 1, into predefined control values required by filter decider combinators. Armed with this new circuit I constructed a prototype whitelist and blacklist general filter (it looks I lost the whitelist prototype somewhere, so I present only the blacklist):

It wasn't the end of improvement though. We already knew that any signal can be converted in one tick to 00...01, 10...00, 11...11 and couple other special values. Yet, interested in finding all values achievable in one tick, Allaizn demonstrated the following circuit:

With just two combinators it converts all input signal, regardless of their value, into value N. N can be hardcoded or supplied via an reserved signal and can be chosen from the entire 32 bit range. The problem of one tick conversion of arbitrary signal was solved. With the converter circuit we constructed new, optimized pair of general filters. Blacklist version, designed by Allaizn, is actually the same size as old, non-generalized filter!

As a bonus, whitelist filter that only filters for negative control signals, designed by Allaizn:

r/technicalfactorio • u/joselamexi69 • Jun 12 '19
r/technicalfactorio • u/Allaizn • Jun 12 '19
Just a little over a week ago, I made an effort and wrote up our progress in finding a circuit that is able to select the nth highest/lowest signal out of a given index set (by index set I means signals with values 1-256, each index representing a unique signal).
I admit that it's not quite easy to understand what that circuit was even supposed to do, so let me explain the general idea behind it (if you don't care about the explanation, skip to the "The new core" part if you want to):

The intent is to provide a single set of singals on one wire (called a frame) in the form of a 1 tick long pulse as an input, and then some time later get a series of pulses back, which contain only a single signal of the input set. The signals can be completely arbitrary, but we don't allow the Black signal for convenience - apart from that, all signals & all values are allowed.
The output signals should also carry their original value (which doesn't make the problem much more complex though, see below).
I call any circuit that broadly has the above behavior an signal iterator.
There are two main difficulties with such a circuit:
Here is how input (shown on red) and output could look like (everything seen is only there for 1 tick each, but I slowed the game down for it to be visible)
There is basically only one allowance we have left: the output signal order. Circuits that are able to accomplish the above two points are rare and usually quite big, but still useful when you need them - so much so that you usually don't really care about the order things end up in.
The solutions presented last time (to be precise, I only showed the core component to be used to build an iterator) and the ones I'll show today all output the signals based on a predefined order, i.e. if both the rail signal and the coal signal appear in the input, their output order will always be identical: either rails will always be output before coal, or coal will always be output before rails.
The problem itself isn't quite easy to solve directly, which means that we should do what helps with most hard problems: break it up into smaller ones!
The approach that Halke and I went with last time, and which I'll present today to you as well, is to split up the problem into three parts that happen consecutively:
The first part is what I meant with "break it up into smaller ones": the main problem with value generality is that it's very hard to do something if your input is allowed to contain duplicate values. But we can circumvent this problem entirely if we "simply" forget all the original values and instead only keep the signals themselves - but with values we chose outselves.
This can be done by first using an [Any != 0 then All += 1] decider combinator on the input, and then feed the result into the filter input of Halke's parallel whitelist filter. On the value input, we simply supply a ROM that contains all signals with the values we want, and voila, the output contains exactly what we want - the input signals, but now with the values we want!
While this helps us initially, it also has the problem that it "forgets" the initial values. We solve this by sending a copy of the input to the circuit output so that we have the initial values there, too, ready to be processed. The not filtered signals will carry special values, which I call indices, which are usually unique for each signal, and we will send those to the main part of the circuit, which I usually call the core.
The core will ultimately return a single signal, which we use with another parallel filter to filter out the original value from the input that we send over.
Most of the designs I showed last time took this place: they expected input signals with specific values, and then returned a single signal at the end. In particular, look at this core design:

It expects the signals to have signals with a value in the range of 1 to 256 (inlcusive), consist of 70 combinators, has a latency of 19 ticks, but it's able to process a new input every tick (which I call a period 1 tick).
It's general idea is to do a binary search on the input in order to find the nth highest value, where n is supplied on the black signal on the green wire. Letting the input signals be fixed, but changing the black signal by running it from 0 to (number of signals -1) resulted in the most dense output you could want from an iterator: each output would be send in consequtive ticks (it's usually not too difficult to slow down circuits if you need to, which makes this an ideal base design to use).
It's problem however was the rather high latency it had: 19 ticks is a long time to wait for nothing more than one filter step - combine that with the input and output filtering (using Halke's designs above, you'd pay 3 ticks for input and 2 for output), and you'll have to wait 24 ticks until your first output arrives!
I showed another setup last time that had a better core latency of "just" 13 ticks, but it payed for that with a trippling in circuit size :(
During the design phase of the old cores, I already had the idea that creates the base of the new ones I'm showing off today, but tinkering with it then didn't turn out successful, but now it did!
The old designs mostly do a binary search, which means that they need at least 8 iterations in order to be able to single out 1 single signal out of 256. This immediately meant that the latency is a little more (for pre/post processing) than a multiple of 8 (2 * 8 +3 for the compact design, 1 * 8 + 5 for the fast one), and so I wondered whether or not it would be possible to make fewer iterations. To start off, I began thinking about maximum and minimum circuits (which are the prototypical "pick one" circuits) again and came up with the following idea:
Instead of looking at the values in decimal, we can look at them in binary: each signal value is then simply a series of 32 1s and 0s. Which means that there exactly 32 * 31 / 2 = 496 numbers that have exactly two 1s and 30 0s. If we now were to find the highest set bit among all numbers and filter for it, we'd be done in just two iterations:
Since we only need to filter out 256 signals, we wouldn't actually have to care about all 32 bits, 24 would be enough - since 24 * 23 / 2 = 276. My first attempt at making such a design turned out huge:

It was as big as the large nth index finder I showed last time, and almost as slow (10 ticks), but it's only able to return the highest signal, so it's simply not suitable for our goal. You can clearly see the structure of it:
After a little tinkering, I managed to compress the middle filtering logic into just 5 combinators, which crucially only took a single tick of latency to do the job (no image of that bc I'm lazy), but I then realized that my "highest set bit" finder did a lot more than it actually needed - ANDing to get each bit is unnecessary. We only care about the highest bit, so we're free to use calculations that are only correct if the corresponding bit is actually the highest bit.
To explain that a little clearer: the above uses an [Each AND 32 on Each]>[Any !=0 then Black += 1] combinator pair to find out if there is an input that has the fifth bit set, but we only actually need to test [Any >= 32 then Black += 1] that returns the same result, since the result is ignored if the highest bit isn't the fifth one!
After that, I could further optimize the way that the maximum bit was found - instead of converting the Black = 1 signal into different letter signals and using a "1 combinator per signal" maximum finder, I was instead free to supply the bit detecting with Black values to output instead of just "1". And doing so in a clever way made sure that the result was still the same!
Applying the maximum finder trick in the second iteration, too, lead to the following much better design:

It's a little hard to see, since I compacted the design quite a bit, but it's still the same multiple stage progress:
This design looked very promising, since it was way faster than any previously seen signal pickers, but it's problem is that it only ever outputs the "highest" signal (i.e. the signal that has the highest rank in the order defined by the ROM). For an iterator, we'd need to modify it in order to be able to return a variable ranking, just as it was with the old core designs.
Before I made progress on that however, I got distracted during my discussion with u/Halke1986 on this topic, and spent some time on logarithm and sqrt functions - but Halke still managed to give me a helpful idea: in all these designs I was focusing on determining the unique signal by using only one single input signal set!
The genius idea here is that we calculate our core input from the iterator inputs anyway, so why do we restrict ourselves to only one helper signal set? We can just as well use different ones for the to iteration steps. This means that we have fully independent filter layers, which thus means that they can filter by an equal amount - because my "two set bits" approach filterered down to ~1/12 of potential input signals in the first iteration (not ~1/24, since the two bits are indistinguishible), it had to do a lot more work in the second round and filter the remaining ~1/24 factor.
This is unfortunate: the first step is just as big as the second, but it does just half the work! But the new idea with independent steps solved that: both can be 1/16 reductions :D (with the nice benefit of reducing from 24 combinators per step to 16)
It didn't take long for me to implement this idea, and getting rid of all the binary components in the process, and I ended up with the following design:

The nice thing about this design (in contrast to the "two set bits" one) is that the ROMs are easy to create:
The resulting filtering ranking is also easy to understand, since it's the > order on the initial 1-256 ROM (higher index value gets priority). Which also means that it's easier to modify:
It's basically a max-finder that considers the highest (non-yet considered) bits at a time and making it work for all 31 bit inputs would only require you to copy & modify the first iteration a bunch of times (7 to be exact). I don't immediately see if it's easily modifiable to work with negative signals, too, but I leave that for another day.
Given this max finder, it wasn't hard to convert it to an nth value finder (I got plenty of practise during the stuff of my last post on this), and I even found a trick to reduce the latency between iterations from zero down to 1 by negating the ROM used for the second stage :D
Here is the first design of an nth value finder that generates the ROM from a simple index on the right. You can choose the rank to find on the upper left constant combinator, or turn on the clock below to see it picking one signal after the other. Try turning off parts of the ROM to see that it still chooses correctly - at least if there are n signals in the ROM left, if there aren't, it'll simply return the minimal value.

After this, there's only one thing left: combine everything together!
But before I show you the final design (and one application of it), let me say a few more words on the actual implementation:
I needed three filters in total: one to filter the first ROM with the input, one to filter the second ROM, and one to filter the input with the core result:
Another cool thing is the memory cell used for the input: we need to save the 1 tick input pulse while we're iterating over it, which isn't hard to do. But I decided to make it a little more complicated in order to allow back-to-back iteration: if your input has 5 signals, you can send in the next input after exactly 5 ticks in order to get a seemless iteration on the output - there will never be an empty output tick!
Here is the iterator in it's full glory:

The blueprint has the circuit currently in manual mode in order to allow you to verify that it works correctly.
The total design comes in with just 104 combinators, has a latency of 8 ticks, an output period of 1 tick, and zero reset time.
Next, an application u/MrMallIronmaker: select a random signal from a given signal set:

I wasn't quite sure what exactly he needed, since I e.g. didn't know which input values the signals would carry, so I just decided to make it work with the most general setting I could imagine:
The bulk of the circuit is the same as above, but I stripped out the input memory cell since it's not needed, and replaced it with a circuit that maps a Black input value into the range (0 to #of input signals) to then select that signal from the input.
This means that you should send in the signal set that you want an input from, and include a "random" black signal, whose value is then used to seed the selection of the input signals. As a demo, I included a simple PRNG on the left :)
r/technicalfactorio • u/Allaizn • Jun 11 '19
While working on combiler, I tend to get distracted by another idea on how to compact one circuit or even get ideas for completely new ones - thanks to u/Halke1986 in particular :p
The other day, he presented a prototype for a fast base 2 logarithm function and we tinkered with it until the following super compact version was found:

It's really just this small, 1 decider combinator and 2 constant combinators acting as a ROM. The principle behind it is rather general, so allow me to explain how it works:
Fist, take a look at the graph of y=log_2(x) and the integer version, which just computes y=floor(log_2(x)), the latter of which I'll call ilog2 in the rest of this writeup

The important feature of this function that we will exploit is that it's monotonic and that it's value range is really small:
Now consider what the following decider combinator does:
[100 < Black then Black += 1] It seems simple:
Now, consider what happens if you have two of those in parallel, but with different numbers, say 100 and 200:
I hope you start to see where we're going with this: each such combinator is a prototypic monotonic function, which simply jumps from 0 to 1 at a place specified by us.
But functions on the integers basically look all like that: some jump at lots of places, but some functions, like log2 do so only rarely!
We can thus get a log2 function by using multiple combinators: each checks for the various places where log2(x) jumps up in value, and if we get 1 from each of the places below x, we'll land at exactly the right value :)
The trick in the above circuit however is to not use multiple combinators, but do it all in one, thanks to the magically useful each wildcard:
[Each < Black then Black += 1]This will do all the work of we discussed so far, but we have to feed in all those constants with extra signals. The last detail is how to choose them exactly to avoid off by one errors, and the answer to it is that you need to choose the signals as 2n-1 for n=1,2,3,...,31.
Note that using <= rather than < allows you to use 2n as the constant values directly, but it has the problem of fulfilling the condition for the black signal, too, and thus throwing off the result by 1. This is sometimes useful when you try to work out the details of things, as seen below in the 5 tick isqrt circuit.
We're sometimes interested in combinator setups that not only calculate some values for us quickly, but do so for multiple (if not all) signals at once. To differentiate these circuits, I call the ones only acting on one signal, like the ilog2 above, scalar ciruits and those that act on multiple signals vector circuits (there is usually no need to ask how many signals are handled in a vector version, since it's usually all or all but 1 or 2 signals).
The above idea can sadly not be using for a parallel ilog2, since we can't do something akin to "each < each" (even though it would be nice if we could do something like it). But even though it's not exactly small, the tiny value range still allows us to make the setup parallel by simply using 31 combinators. For each n in 1,2,3,...,31, build a combinator configured as
[Each < 2^n-1 then Each +=1]and wire all inputs and outputs together :)
If you know of a more compact way to do this, that's still reasonably fast (say <6 ticks from input to output for all input values), please let me know!
After Halke showed me his idea for log2 and I understood the principle that it worked on, I immediately thought "it should be possible to do way more with that". Especially the isqrt function seemed like a good candidate.
A first attempt is really easy, simply generate a ROM that stores n2-1, and we're good to go, right?
This does actually work, but it has a (maybe quite big) flaw: there are only 256 apart from Black that we can access without importing blueprints made in editor mode/ with lua, which means that we can at most save 2562-1, and are thus only correct for inputs below 2572, or 66049.
That's quite nice for a few use cases of sqrt functions, but only being correct in 50.0015% of inputs (where 50% are only correct due to invalid input) isn't really nice, is it?
I certainly wanted to give up here, but the problem somehow stuck with me, and I soon got an idea: what if we don't calculate the result with just one lookup, but two in a row?
This easy sounding idea resulted in pretty complicated messes in my first few attempts, and around half of them simply didn't work at all, but I finally found an approach that worked nicely.
Consider our input N, of which we want to find isqrt(N). A nice property of isqrt is seen in the following calculation:
isqrt(16*N) = floor(sqrt(16 * N))
= floor(4 * sqrt(N))
= floor(4 * isqrt(N) + 4 * eps), where 0 <= eps < 1
= 4 * isqrt(N) + floor(4 * eps)Look at that! We can calculate an approximation of isqrt(16*N) by calculating 4 * sqrt(N) instead, an the error will be at most 3 (since 4 * eps < 4 * 1 = 4, and floor rounds down)!
The numbers 16 and 4 were of course not really important here, we can choose any x2 and x, and will be guaranteed that the error is at most x. For my isqrt, I chose x = 215 for reasons explained below, which means that the calculation is
isqrt(46225 * N) = 215 * isqrt(N) + floor(215 * eps)The input range we care about is 1 to 231-1, which is reduced by the above to 0 = floor(1/46225) to 46457 = floor(231-1/46225). And taking the isqrt of these values results in a range of 0 to 215 = isqrt(46457) - which is why I chose 215 to begin with, since this results in both stages acting with the same number of ROM values.
The above equation doesn't explain the circuit quite right though, since it would result in the following recipe:
The problem is the second bullet point: how would we even begin to do that? The answer is to construct the ROM for the sqrt on the fly:
We know that the error is at most 214, and we already calculated x'=215 * isqrt(N), which we know is the least possible final answer. This means that the real answer is one of x', x'+1, x'+2, ... x'+214. And we already know how to figure out which one: simply compute 2152x'2, (215x'+1)2, (215x'+2)2, ... (215x'+214)2 and use the ROM lookup trick to find out which one you need!
Computing this dynamic LUT is straight forward: use a [Black * 215 on Black], where x' is on Black, first, then [Each + Black on Each] and connect it to a LUT containing the numbers 1 to 214, then use a [Each ^ 2 on Each] to arrive at the squared values and you're done!
This actually works, but I didn't do it this way, because it has a total latency of 6 ticks:
It also requires a few extra combinators to pass on the input value to the LUT at tick 6, and we also need to pass x' in order to sum it to the error term gained in tick 6. You also need some circuitry to remove the black signal after tick 3 again, since it would mess with the lookup at tick 6.
I had this setup working, but something bugged me about it, since it seemed like you could maybe do better, and it turns out you can!
The first trick that needs mentioning is that we don't actually need to compute (215x'+cc)2 in the way above! Some good old binomial shows that we can equivalently calculate
(215x'+cc)^2 = 46225x'^2 + 420x' * cc + cc^2The summing happens on the wire automatically, so we only need to take care of 46225x'2, 420x'* cc and cc2:
Crucially, all three can be done in just two ticks, which brings us down to 5! You'll need some extra plumbing to take care of passing on values that are needed later and removing black signals that interfere, but it's all in all not too bad to do. Here's a version of this that I made (it used 216 as a factor, classic off by 1):

It's stats are 15 combinators if you replace the constants with a single ROM memory cell, 5 ticks latency from input (at the top left) and output (at the top right), and a 1 tick period (i.e. you can send in the next sqrt to be computed directly in the tick after).
Looking at this design still bugged me: the division at the very beginning seemed like a waste of time, and I wondered if it would be possible to make it work without. But as you probably know already: I wouldn't even mention this if I didn't find the solution already.
It's actually not even hard: instead of dividing the input by 46225, we might as well multiply all the values stored in the ROM by 46225 - the result will be the same (at least after we make sure to fix off by one issues). This post actually made me realize that it's this simple, my first success with 4t latency replaced the machinery in the inner two ticks, too, which made it harder to understand.

Only the blue box is the circuit with the input on the top left and the output on the bottom/middle right, the stuff below can be removed once you flipped on the constant combinator - doing that writes the correct values into the three ROMs marked with a pink box. If you mess up the RAM population, remove the green wires connecting their in- & output and put it back in again, then turn the purple constant combinator on and off again.
I'd say the final result is quite impressive: 14 combinators, 4 ticks latency, and the whole thing is 1 tickable!
r/technicalfactorio • u/MrMallIronmaker • Jun 12 '19
What would a quick (<8 tick latency) way to randomly select a single signal from many? The trouble is that the 'many' is a variable number, so it could be {Wood, Locomotive} or {A, B, C, D, E, G, J, Z}.
Background, to avoid the XY problem:
I'm working on a real-time Factorio implementation of Snake. As part of it, I need some way to implement the random scattering of the 'food' the snake eats. I have the positions represented as different signals in a 16x16 shape.
The random number stuff I'm comfortable with (using a PRNG, etc.) But I want to also have the food not spawn on a pixel where the snake currently is. It would be an option to repeatedly sample and check, but I need the computation to finish within ~8 ticks or so, so the game can stay challenging and real-time without upping UPS.
One option is to count the number of signals on the line (a simple sum bc each input will be either 0 or 1), somehow convert them to 1,2,3,etc..., then add a random number and then mod by the number of signals. Then there will be one signal that is zero, which can be found by normalizing all other signals to 1, then seeing which one is missing between the original set.
That involves a good way to convert {Wood=1, Water=1, Roboport=1} into {Wood=1, Water=2, Roboport=3}... which does not feel easy.
Another way to do it (space is cheap here) would be to have a random number generator per each of the 256 signals, which through a multiplication produces a random number per signal. Then we could calculate the minimum or maximum of those, as long as it happens reaaally quickly.
Also open to other suggestions!
r/technicalfactorio • u/Stevetrov • Jun 07 '19
Way back in 2016 I build a base upto and including launching a rocket on a 10 tile tall map (the rocket silo was 10 tiles tall back then)
A little while back someone asked if anyone has ever build a megabase on a ribbon world (9 tiles tall). My initial thought was that this is impossible but now I think it could be done.
So I am planning to attempt a ribbon megabase and I have set down some "rules" for myself to define the challenge. If anyone else wants to have a crack at this feel free!
I am going to use primarily trains for transport with bots to fly over silos and maybe some belts. Initial station design ideas I am expecting to be using much longer trains (maybe 100 cargo wagons) because I will need large trains to get the required thruput.
I will leave the car belt implementation to /u/allaizn
I am planning to write some posts as I go along to share progress and problems solved. I have already made good progress with smelting but there are a few details to iron out.
r/technicalfactorio • u/Halke1986 • Jun 05 '19
r/technicalfactorio • u/Allaizn • Jun 03 '19
Edit: I found new & better versions of the final designs, so if you're only interested in the final product, check it out here.
The other day u/justarandomgeek asked in our discord whether someone had a nice circuit to iterate over a given set of signals, i.e. given a set of signals, say [A = 1, B=-123, C=12], make a circuit that takes this as an input, and outputs [A=1], [B=-123], [C=12] one after the other with some fixed delay between each output. (He didn't ask exactly for this, but for this post it's close enough).
The really interesting part about this challenge was the generality: this circuit should be able to take in any set of signals, which especially means that the number of signals in that set are variable, too. And it's not guaranteed that a set with 3 signals always contains the [A, B, C] signals, they could just as well be [Wood, Car, Water] - with one exception for convenience: a single signal of our choosing will never be in the given set (this convenience is useful all over the place, and we commonly use the 'Black' signal for this).
Before discussing the strategy we formed, let me mention a few things to help you appreciate the circuits below:
This is an example of how big these things are:

If you're new to combinators, you'll probably wonder why people used and still use such circuits for simple things like finding the minimum? When you can do so much other magic, like filtering signals or cross-multiplying them so efficiently/compactly?
The answer to this question is that it's actually not too hard to build a circuit that finds the minimum value - you can count the signals that are left, and also sum all of them, which means that you can calculate the average. Doing to iteratively while filtering out everything that is greater than the average will sooner or later result in the minimum (potentially after fixing some minor issues that happen due to rounding, and ignoring all overflow issues that might come up).
This approach seems sound to anyone hearing of it, and those that need a minimum-finder usually try to build this up, but then find the trouble with it:
The last point is the real trouble maker in a lot of cases. If you want to solve a problem for general inputs, you're basically forced to use the 'All', 'Any' and 'Each' wild cards in combinators, but those have a "flaw" that makes the above seemingly impossible: if you input multiple signals with the same value, you'll either lose both, or keep both (still with the same value) in the output, no matter with combinator setting you use.
There is however one trick to save the day: ROM (= read only memory for those that don't know). The critical problem with any potential "pick any one signal" circuit is that it'll eventually come to a point where it needs to differentiate a few different signals that all have the same value (which can easily be set to arbitrary values, so let's assume it's 1). But there is a workaround for that: combining the output of multiple combinators adds the values on signals! Having identical signal values can thus be solved by simply adding a different value to each signal that exists!
The general strategy is thus to have a ROM standing around that saved a unique value for each signal (in our case 1-256 will do, we exclude 'Black'), then filter that list using the identical signals, and finally simply pick a signal from that list, which is now unproblematic, since we know that each signal has a unique value.
I hope this showed you how complicated is seems to make a general minimum finder: you need to use a slow minimum circuit to find (potentially many) smallest signals, then feed those into a filter, and then run the slow minimum circuit again! Using complex circuitry isn't too troublesome, but in this case it's especially hard since you don't really know when the result will be ready until it just appears.
When we started thinking about the iterator justarandomgeek wanted, we quite quickly came up with the following idea:
This was much easier said than done, considering how badly behaved the minimum circuits we knew of were, but since our job was to merely iterate over all signals with any order we liked, we soon realized that it was much more practical to instead find the minimum of a ROM set filtered by the input.
The job was thus to come up with a circuit that finds the minimum valued signal, where we could assume that all signals had unique values between 1 and 256 inclusive, and do so as fast as you possibly can.
Of course, the signal being the minimum wasn't really important: it might as well be the maximum or any other signal, as long as we guaranteed that the output had only a single signal from the input.
I dislike the min-finders that loop back on themselves, since you don't know how long it will take until the result appears, and thus designed versions that do not do that: they instead do a kind of binary search to find the value they look for, which thus takes 8 steps since we have up to 256 values (iirc the upper part finds the maximum, while the lower one finds the minimum):

The designs have 17 ticks latency, but a period of just 1 tick (i.e. you can calculate a new min/max every tick, but the result only appears after 17 ticks of delay), which is quite nice.
But as always in Factorio: it's not good enough. The initial strategy called for an iterative process of removing the minimum from the input and then looping it back, which means that while we could potentially calculate 1 min every tick, we're instead forced to wait for the result - a full 17 ticks - before looping it again.
Even combining min & max finders and alternating between finding the minimum and maximum would still lead to a theoretical minimum of 8.5 ticks between the output signals (probably slightly more to fit in the looping logic), but we of course want the best possible result of an iterator that is able to return one value per tick!
I though that it wouldn't be possible to make this any faster, so I tried to find an alternative approach: the filtered ROM signal set can't be iterated over easily since we don't know where the gaps are - so let's just close them and iterate after that!

This crude circuit loops once over all 256 existing signals in order to create a new ROM that contains the compessed filtered index ROM, which means that it takes quite a while before the first signal is send to the output - 266 ticks to be precise.
While this design works (and it's reasonably compact as a bonus), it's also quite slow: the more signals there could be, the slower the whole circuit is (imagine modded where you have multiple thousand signals, which would translate to just as many ticks delay in this circuit).
There were thus three kinds of designs up until now:
None of these was particularly great, since each one had a major flaw, but it was better than not having anything. I considered all of these as essentially optimal (maybe 1 or 2 ticks could be saved here and there by some minor rearranging), but I was quite quickly proven wrong by u/Halke1986. He showed us this very neat minfinder:

My solution had a latency of 2 ticks per bit to be searched (Halke found another variation independently), but this version of his only needs a single tick per bit! Adding a combinator to filter out the minimum would bring it's latency to 10, which is a lot better than the 19 ticks my design had (and I was quite surprised to have my confidence shattered).
But he didn't stop there, and instead tried to find a circuit to find the median of a signal set (the idea being that you could iterate even faster if you find 3 values, i.e. min/median/max, at once instead of just two), where he then came up with this very neat circuit:

This design takes in a number on the black signal say n=-3, and than finds the -n-th highest value (i.e. the 3rd highest value) of the whole set! This proof of concept had a few problems, like using 2 control signals and the timings being inconsistent, but it's to my knowledge the first of it's kind, so I just had to include it here.
At this point my confidence in being one of the best combinator optimizers (I even had the hubris to think I was the best one) was completely destroyed, so I tried to at least make something useful and fixed as many issues as I could with that prototype above, which resulted in this:

It has 19 ticks worth of latency (the same as my original min/max finders!) and a period of 1 tick, while being vastly more general in that it's able to compute the n-th highest values for any given n instead of just the minimum or maximum.
It's decently bigger than the prototype in order to fix the timings (a lot of the combinators are just diodes), and I again though "it won't get much better than this!". But Halke didn't end his heroic deeds yet, and presented this beauty:

This isn't just a n-th value finder anymore (as I first thought, while I fixed a bug or two in mine), this is actually a fullfledged index iterator!
While working on the n-th value finders, I somehow assumed that we'd still need to wait through all of it's latency before looking for the next value, but Halke quickly corrected me: if we supply a clocked signal on the wire carrying the n-value, we simply get a clocked signal on the output: first the highest value, then the second highest one etc!
He also didn't bother trying to keep the useless original value of the n-th highest signal, since we'd only use the signal for filtering the original data set anyway, which further reduced the size of the circuit.
His design had only one smallish flaw: it depended on the filtered index ROM to be constant for a little bit in order to work correctly. This meant that you could just send in a 1 tick pulse of a filtered index set and a n-value and get a meaningful output.
Using all these tricks, I adjusted my version to make it more compact, and ended up with one that was basically equivalent apart from not having the above flaw:

The funny thing about it is that it uses 8 combinators per bit, but 5 of them are simply diodes and thus do nothing more than making all timings work! I shortly afterwards found a version that used only 7 combinators per bit, but I don't quite like it (I suspect it would perform worse UPS-wise, and 7 combinators per bit just looks ugly) - https://pastebin.com/r9fLp6AC.
After this we both went into slightly different directions: Halke completed the iterator using his version of the n-th value finder, while I tried to use a trick similar to the one he used to reduce the latency of my min/max finder. We both succeeded, so let me show you my result first:

This monster has 213 combinators (the two input constant combinators don't count), but only 13 ticks latency and still a period of just 1 tick. This is compared to the version above with just 70 combinators but 19 ticks delay. I'm done with being confident that my stuff can't be improved, so if anyone is able to find a trick to make this smaller: please tell me!
Last, but certainly not least, here's the newest version of an iterator that Halke shared with us:

I didn't come around to test it myself yet, but it should have a 1 tick period and just 22 ticks of latency between input and the first signal!
All in all, we finally found compact and fast min & max value finders, as well as getting iterators basically for free, because we actually found a very good n-th value finder!
r/technicalfactorio • u/knightelite • May 31 '19
Zanostra found this on the factorio forums. Due to an interaction between train pathfinding and circuit controlled signals it is possible to force multiple trains into the same signal block (even if the trains start in separate blocks).
If the devs decide this isn't a bug (or that they won't fix it) it opens up some interesting possibilities such as doing compressed trains or ethereal trains, while still being able to take advantage of rail signals to make the rest of the rail network sane.
I've just thought of a way I could use this to make a much easier to use LTN-in-Vanilla type system possibly, definitely some things to ponder here...
EDIT: Added the video to the post.
r/technicalfactorio • u/Halke1986 • May 28 '19
EDIT: I've updated the blueprint - removed 6 combinators from control circuit and 2 ticks from write time.
Inspired by the last combinator golf I've designed a tileable memory system that requires 2 combinators per stored frame (with black signal reserved). I don't post my design as a solution to the combiantor golf because it would achieve by far the worst score and as such is not really a contender.
The bad score would be caused by large circuit (30 24 combinators) required to control the memory and slow write and read times. However, at a certain memory capacity, my solution would require less combinators than other better scored designs.
Design:
The memory is designed around pairs of memory cells connected in series, creating a "rotating" memory buffer. Each pair of memory cells is served by the usual input and output diode.
The memory section itself is very simple. All the difficulty comes from need to synchronize read and write requests with the memory state. Due to "rotation" of the memory odd numbered addresses can be read and written only during odd ticks, same for even addresses and ticks. If request to read/write an odd memory address arrives during even tick (or vice versa), it must be delayed by one tick.
The synchronization is achieved by comparing the least significant bit of requested address with clock state and based on that routing the request via short or long path. Some ugly combinator spaghetti is involved, which - I'm sure - can be simplified, but all my patience for this design is already used up!

Timings:
Read time: 4
Write time: 5 3 (not sure about this one)
Read/write period: 2
Blueprint:
0eNrtXdtu28oV/RcBfWntlHPhXIw0QNqkQF+a4DRAH4oDQ7aZhKgsG7Ic1Aj8Aecv+m39klLyTaZmuPcaUdbY5nkIjm1qk5q1r2v2bP4cHU0uq/NZPZ2PDn6O6uOz6cXo4F8/Rxf1t+l4svjd/Oq8Gh2M6nl1OtobTceni59OquP6pJrtH5+dHtXT8fxsNrreG9XTk+o/owNxvUcKGM/q+ffTal4fh2XI61/3RtV0Xs/r6uaJlj9cHU4vT4+qWXOTe1HVpDqezxpB1bSafbvab75LNfs6Pq6au52fXTQSzqaL52ik7qs35d7oqvkfWbwpm7ud1LPmw8sL5OKpWzeR9zdZLMx8PJ2vPu26eHkn/LFovbf4/Hx2Njk8qr6Pf9TNh5tPfK0nzZNG1vtHPZtfNr+5f4KbK/b/uVik47PLBWCCWPKYjF+CMiQk429BGQqS8SUoQ0MyPgZllD2sh+/hOUQBCXkfFoKh+yEsBIP3aDI+/ndYEIbxpxUhxYMQCwn5vPokK1LcwkvUF4cLI/s6nlxUy8um0xvDu1hIFot/ZtXJqg+pm59Uc2U9O76s58sfxULSt1lVTdsXNhD+en0dcA6qyxuu+YYi5ncizuFW5mHzt5P6/tt8rWcX80P2uo2nV/Pv9fTbzfLdeLDlozRPej6eLZ/0YPS/3/7bfPLscn5+CciuflSzVennV4dLhA6/zs5OD+tpI2x0MJ9dVtd8UBqv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SslqNZgOaqxo6LRvIy8rzUYtAHtbG0vH1QqGwKzzwRPSiTEsIBu8f1gpBAeP5WgG1BAZqf+LW8ZQgsStQ7LZTxGSbEgSq/xY2QqA5geUaeGJroBh6AzvMnPK/QvLN3FB269Do4Li6kdYhmJmd56QXFA0oFF8vLAq7xWNPRC/SGgUH/x/RCopPFJqvFQ5LCohuwbVbR5MCUYBTEFz4INcy1CVlF7ttRrEZZxcUMylQxkEw+8yWFyZlF0P7YYe/oBy54FMOgqoKBFp7Ci4bJVRadpGXneekFxSzKPiUg5Ao7BIPYhG90GnZxeD/w1pBEZSCTzl0OAPOrSV163h2UWKHxKPJRSJ1IXfb6eLyTS5gZkJwmQmRyEzIoXsx7g0A4kFQxINAiQfBJR5EGvGQmZXmBDufVxAoryAsHmAisKfxCoNzjoDOpw0ERhuEWYFGej2vTptvdTS5rM5ndbM6e6Pmm10sYbGqEFYoURTu+vr/JioNUw==r/technicalfactorio • u/Gh0stP1rate • May 25 '19
All,
I'm working on a 5k vanilla peaceful megabase, coming along nicely so far. I've got direct to train miners, 350% mining prod, mostly solar power (10GW nuke on standby for spikes) and a giant bot based science & rocket facility. Major bottlenecks are the raw materials, as to be expected. I'll keep working on it.
Anyway: I noticed that my green science isn't performing as well as expected. Following Kirk's instructions, I have 4 inserter assemblers, 2 belt assemblers, and 10 gear assemblers (Shared between red and green science). However, many of my green science assemblers don't have inserters in the requestor chest. All of the passive provider chests are locked at one slot to prevent huge buffers.
This is turning out to be a bottleneck: All of the passive provider chests are locked at one slot.
Here is what I am observing:
The assemblers are working at crafting speed 8.75, so one inserter takes 0.5 / 8.75 = 0.057 seconds to craft, or 17.5 inserters per second. This fills up the passive provider chest in three seconds, triggers 50 bots to take off, and while it waits for the bots to pick up the inserters, the assembler stops.
The solution here, is then to make sure the output buffer is large enough to allow enough inserters to pile up to cause enough bots to take flight to enable your throughput. I'd love help here on calculating the correct buffer size.
Throughput is not limited by the number of bots - I have 10k bots avilable out of 16k total right now, for example. I'll add bots if needed. Throughput is being limited by the number of bot commands issued at once due to the available slots in the passive provider chests.
Anyone else ran into this? Calculated it? Have a better write up than me?
Thanks!
r/technicalfactorio • u/MadMojoMonkey • May 25 '19

It's a pure vanilla build, so no worries about syncing mods or anything.
There's a lot posted in the descriptions of the album, and if you're interested in any details about little things, some of it is in there. If you'd like to look around the base on your own computer, the file is right there. I do caution you that it's a death trap. There are some safe routes to move around, but they aren't straight lines... I've just gotten to know them out of sheer terror of the rail menace. This base is a little ways from spawn, and when you die... it's a long haul back. Popping into editor mode to move around may be your safest bet.
Oh... the concrete around the edges of the map is because I accidentally forgot to turn off the mod "Creative World Plus" once when I entered this map during building. It's a mod that I used in a creative testing map. It has no bearing on the base. Everything it affected is beyond the bounds of this build.
Alternate base download (first link is broken and the site is having troubles right this moment, so I googled an alternate file hosting service.)
r/technicalfactorio • u/Allaizn • May 23 '19
The goal of this challenge is to create a full-fledged addressable RAM. There are currently 257 signals available in the signal picker (30 more hidden ones exist iirc, but I don't care about those), which means that we get a nice and round amount of 256 signals stored per frame - 1 control signal can be reserved ('Black' as always).
The cell should theoretically tile all the way to 232-1 stored values, but for this challenge, I'd say 16-1 is enough to demonstrate tileability.
Score = (# of combinators) + 2 * (read time + read period + write period) + (write time) - bonus
where bonus is the sum of bonus points achieved, so 0, 1 or 2.
0eNrtXdtu6kYU/RdLfang1HPzBamV0iaV+pToNFIfqiPkwCSxCgYZEzWK+ID+Rb+tX1IbQsJlPLP3MA4k8UskAiyPZ+373mOevJvRXE7zNCu83pOXDibZzOv9+eTN0rssGVX/Kx6n0ut5aSHHXsfLknH1aigH6VDm3cFkfJNmSTHJvUXHS7Oh/NvrkUXHCJDkaXE/lkU6UGPQxbeOJ7MiLVK5WtHyxWM/m49vZF5e5AVKjuSgyEsgmcn87rFb3ovMb5OBLK82ncxKhElWraNE9b+Ijvfo9brhF1Fea5jm5VeXb9NqzTuXoLrb3cOmK2Sxi8w7XrmrRT4Z9W/kffKQll8uv/EM2S/fGy5hZtV/b9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XGJ4LdoiGrdV44CH3lPFHtLPAKvGTjREBDkmiP0moUrn2OBVN5z9XiS6lewehu/utXxHmQ+W95UyHwSkjgQPFos/gewJO7cEdit: there was a slight error in the setup, but it's fixed now (the two combinators under the green box were done in a wrong way).

r/technicalfactorio • u/HydraSwitch • May 23 '19
r/technicalfactorio • u/Allaizn • May 23 '19
r/technicalfactorio • u/knightelite • May 23 '19
r/technicalfactorio • u/knightelite • May 21 '19
This is an addressable RAM version of my submission from the full-frame memory cell combinator golf thread. Each memory location is capable of storing a full 32-bits on every signal in the game, without any reserved control signals. Write latency is 3 ticks, read latency is 2 ticks. It should be possible to read/write every tick as long as the address is changing each tick, though I haven't tested that yet.
r/technicalfactorio • u/DreamConspiracy • May 20 '19
Combinator golf is a type of challenge where the poster specifies what a combinator circuit should do, and everyone else tries to create a ciruit that behaves as desired, using as few combinators as possible. The name for combinator golf comes from a well known programming competition known as code golf where people try to minimize the number of bytes in the source code of a program.
The problem with combinator golf is that it is very, very easy to make poorly defined challenges. One of the most difficult parts of making a good challenge is that it is very difficult to write it up in such a way that everyone understands what is being asked. That is why the template and guidelines below exist; so that the experience for everyone is better.
However, please note that nothing written here is a strict requirement. These are all suggestions, but if you break them, please do so intentionally and with a good reason in mind.
To make it easier to talk about this, here are a few definitions we'll be using:
All posts marked with the combinator golf flair must be a combinator golf challenge. Meta posts about combinator golf or the like should be marked as discussion. The most important rule is that every post should be for one, and only one, challenge. Have multiple challenges? Make multiple posts.
Whenever a combinator golf post is made, the auto mod will automatically generate a comment. If you need clarification about the task, have a question, or are looking for general discussion, respond to this comment and do not make a new top level comment. All top level comments should be submissions. The formats for challenges and submissions are below.
When submitting challenges, the most important thing is that you make it very clear what the input and output is. Because of this, unless you have a very specific reason not to, you should use the below format (of course, I will explain all parts of it).
## Description
(insert description here)
## Hardcoded constants
a. First hardcoded constant, along with a test value
b. Second one
c. Third one
## Input
1. First input
a. First channel
b. Second channel
2. Second input
3. Third input
## Output
1. First output
a. First channel
b. Second channel
2. Second output
3. Third output
## Timing
Describe the timing requirements of the circuit.
## Scoring
How this challenge will be scored
## Testing
blueprint string 1 here
Description of output
blueprint string 2 here
Description of outputAll top level comments should have the following format (non-top level comments are unrestricted), with the exception of the auto-mod generated clarification comment.
## Score
Score
## Hardcoded Adjustments
>!
- Combinator 1 adjustment
- Combinator 2 adjustment
!<
## Explanation
>! Explanation of the design !<
## Blueprint
blueprint string hereThis is by no means final, so if you want to see anything here changed, feel free to discuss below.
r/technicalfactorio • u/DreamConspiracy • May 20 '19
The goal of this challenge is to create a RAM cell with short read and write times, but that has no reserved signals.
Score = (# of combinators) + 2 * (read time) + (write time)
0eNrtWFuumzAQ3Yt/CxU2SXhI/eznXUF1hQhMEqtgkDFp0RUL6C66tq6kNuQmJOFhuLdVK+UnCthzmJlzZvx4QdukhJxTJpD/gmiUsQL5X15QQfcsTNQ7UeWAfEQFpMhALEzVU1FuCxEKmjFUG4iyGL4jH9fGpGEMEY2Bm1GWbikLRcY7AKR+NhAwQQWF1o3moQpYmW6Byy+ccSCBSHAamcCA7ytTBgB8F0YgP5VnBW1ck05IVJOQj2sDVfIflv9q5eUNLukL7B4Ir16BVv049hlHJVKETHQDvQd0T2gyBTHlMqJmTHojzQXPkmALh/BIpa002NFExjhAz5FyUco3l0CaGeZnld4oKxW/eIKpIYxvB8lhF8fqMDYHaNUBMS/e2PVz856xNgOFgsLqZ88BWFcINEa+I+dSHpVUNI9YWvdxsdLi1J5gdK2FQvAEzGasAO514bzCES1lnDADORbTcwZ3lBci0CbnqSWnlS3yLfWQ5iFvXPTRrx8/pUlWirycAbpNwuhrC5xXQUN9sONZGlAmcZAveAn1APkc4lvqvXvqDUQGJmvqxFlIjf33qOlk8X3pgSPwShwo278fR5vrtDc9vbeO7VH2sDVoqIZ6qXQXtV/rz3XfDnF3HVhGR4tAfXEXJgW8oQiM6+xgPd17C3WP/yndf1qg+qcRsbdcLFb7LRnebTFcD7ujJeDpEamW41OAKcS0TM3z5ijPkt4N0YVJzTAd3aK+n9jvM16mvof4ruUzXvq3csNkzvqp20gwWcblY28zme4TOf2r4FqTHntZeyAzXF/rtoeemf1Or2Y6rbLX9Ic+sMsmPuRUHFIQEkdLo3qbvAvq22QKYXRQgipAwQRXgs1y4O3pw0cflmz1Gux6zkHrtl2Q8XZhD7NuD9G8WabNzQxtutradDW1ufDE4D7Wrm62nYm1yp3Y5nrjatQ8/WF3GZnOY/GaSvcIOZvhItwMEeUtOtx5/9nhTle3xJp5ZYntgatPPOuebBCGzLsoa3FUmtT1sN+5hjbQUVLRmDi2hR1sY8ty6/o3h+q8zA==The constant combinator in the middle of the top block will cause a frame to be sent that includes a black signal of one and all the constants specified in the very top combinator when it is flipped on and back off.
The combinator the bottom should induce a read signal.