Page 3 of 6

Re: Combinator Contraptions

Posted: Mon Apr 25, 2016 8:12 pm
by piriform
Here's a scheme for a cheap memory capable of storing all the signals (albeit with a reduced range)
Caveats:
- incoming signals must be 1 tick wide
signals must be conditioned:
-if negative values are desired and interval is 10M then 5M must be added to the incoming and 5M subtracted from the output
-for positive only values 1 could be added to the input and 1 subtracted from the output.
- signals cannot be erased from the storage (but that's not a problem as 5M = 0 in case of negatives, and 1=0 :lol: in case of positives only)
cmemroy.jpg
cmemroy.jpg (36.59 KiB) Viewed 8898 times

Re: Combinator Contraptions

Posted: Tue Apr 26, 2016 4:05 pm
by terror_gnom
Sorry XKnight, it wasn´t my intention to offend you. Somehow I just cant get my brain right for those combinators... Probably its the same reason why I hate electrical engeneering :P

And the question for the tool was somehow stupid... I thought its some kind of electrical/logical CAD software, where you can simulate it in one go :lol:


Here is my first contraption:
I used it to check how many ticks my train station requieres to empty a train.

It finds the max and min period length (rising edge to rising edge) of a Signal A and outputs it as max = red wire B, min = - green wire B
I´m sure, there are way smarter and easier ways for doing so, but it works :P

To reset just add a negative signal B thats definitly longer than the min you´re expecting to find in the constant combinator and remove it again.
test.png
test.png (751.77 KiB) Viewed 8867 times
Blueprint

Re: Combinator Contraptions

Posted: Wed May 25, 2016 6:26 pm
by Neotix
Can somebody explain how The Exponent Calculator works?
I can't use blueprint because when I import it and place in game it's messed up.
I want to use it to calculate 2^X.

Re: Combinator Contraptions

Posted: Thu May 26, 2016 10:27 am
by ratchetfreak
Neotix wrote:Can somebody explain how The Exponent Calculator works?
I can't use blueprint because when I import it and place in game it's messed up.
I want to use it to calculate 2^X.
here is a hint if you want to build your own

2^X = (2^(X/2)) * (2^(X/2)) * [1 if X is even, 2 if X is odd]

Re: Combinator Contraptions

Posted: Thu May 26, 2016 7:50 pm
by Neotix
This hint explain nothing for me.

Re: Combinator Contraptions

Posted: Thu May 26, 2016 11:16 pm
by Frightning
Neotix wrote:This hint explain nothing for me.
Here's a hint to the hint: Combinator division always truncates answers to integer part (so 13/2=6.5=6), with that in mind, look at the previous hint (and use exponent laws to see why it works).

Re: Combinator Contraptions

Posted: Wed Jun 01, 2016 1:10 am
by ssilk
Also one of currently interesting threads. So made it sticky.

Re: Combinator Contraptions

Posted: Thu Jun 02, 2016 5:23 am
by Dr. Walrus
Neotix wrote:Can somebody explain how The Exponent Calculator works?
I can't use blueprint because when I import it and place in game it's messed up.
I want to use it to calculate 2^X.
I can explain it to you. Those other replies may have been correct, but they were describing a totally different method than I used. The way this contraption calculated exponents is by taking an input of signal 0, and multiplying it by 1 blue. That result is then changed to signal blue and looped back around and multiplied against the original number of signal 0 again. This gives the square of the number of signal 0. This loop is performed X times where X is the number of signal 1 you set. The consequence of calculating it this way is that your result takes more ticks to calculate the larger your exponent is.

That's the theory of how it works, and most of the combinators are there just for timing and getting a readout that doesn't blink. Here are build instructions for you to build the exact thing in the picture while I fix all of these blueprints.
HOW TO BUILD IT YOURSELF
Also try downloading the latest version of the blueprint string mod. It claims to be able to fix old blueprints. I haven't tried it yet though.

ssilk wrote:Also one of currently interesting threads. So made it sticky.
Thank you ssilk!! :D :D :D
I am glad this topic has generated such good discussions. I'm looking forward to the great things I will see everyone build when 0.13 comes out! And I will try my best to keep building cool contraptions myself. The next one I have in mind is a contraption that can calculate X/Y and give the answer to 10 decimal points.

Re: Combinator Contraptions

Posted: Wed Jun 08, 2016 9:06 am
by Dr. Walrus
I was bored waiting for 0.13 to come out so I went ahead and built the ultra precise division machine. The blueprint string for it was made in 12.30 so it won't work for most people who have updated to 12.31 and above.

I've been wanting to post diagrams that have a written description of combinator settings and where the wires go like these diagrams I've seen piriform and XKnight post. That way you don't need to have a blueprint string to build it yourself.
Image
I don't really have any idea of what software or whatever is used to make these so any help or recommendations on what to use would be great.
terror_gnom wrote:Is Dr. Walrus still with us, so he can probably add all those nice little helpers to to first post? Probably someone is looking for it and doesnt like to check every page in this topic ;)
Added links to nice little helpers.

Re: Combinator Contraptions

Posted: Thu Jun 09, 2016 8:32 pm
by siggboy
Dr. Walrus wrote:I've been wanting to post diagrams that have a written description of combinator settings and where the wires go like these diagrams I've seen piriform and XKnight post. That way you don't need to have a blueprint string to build it yourself.
I don't really have any idea of what software or whatever is used to make these so any help or recommendations on what to use would be great.
The diagrams are made with yEd, it's Freeware.

I've used it too, it's really good (actually amazing considering it's free). Make sure you use the automatic layout features.

Re: Combinator Contraptions

Posted: Fri Jun 17, 2016 4:27 pm
by Guu
circuit that can filter out a predetermined signal or signals from the total flux

Re: Combinator Contraptions

Posted: Fri Jun 17, 2016 7:20 pm
by siggboy
Here's a special purpose register that will accept any signal (or set of signal during the same tick), and then block any further writes until the "erase" signal is applied.

The erase signal is "Red" in the diagram, but could of course be changed if you actually need to store "Red" signals in your application.

The only other caveat is that you cannot store the value "-2^31", it's possible to change this if necessary; left as an exercise for the reader.

This register can handle 1-tick inputs, but it will also accept "hold" signals. It does not matter since all writes are blocked after the first tick of input. Just throw a signal at it and it will store it (forever/until reset).

I'm using this setup in my train scheduler, where I poll the outposts and need to accept one value (the first one that appears on the wire) and then process it -- so I want to block further writes to the register until the processing is finished. Other applications are surely possible.

You can put a 2-combinator circuit in front of it that generates an "erase" signal, and then you have a normal general purpose register that will accept any input, much like what piriform posted on the previous page on this thread, but without the caveats...
factorio-write-once-register.png
factorio-write-once-register.png (8.7 KiB) Viewed 15909 times

Re: Combinator Contraptions

Posted: Fri Jun 24, 2016 12:13 pm
by kann_
Guu wrote:circuit that can filter out a predetermined signal or signals from the total flux
I use this version: it is almost identical, but I wanted to try this yED software. ;)

One should add that it can only works on positive signals.
image of circuit

Re: Combinator Contraptions

Posted: Fri Jun 24, 2016 5:30 pm
by piriform
much like what piriform posted on the previous page on this thread, but without the caveats...
I like write once register design and can see uses for it, but I think that the two are different in use and operation.
I believe that the write once register performs destructive (sic?) update, i.e. the old values are erased and the new signal values are then stored. The "cheap" register does not erase the old values, instead it updates them. Thus writes of say: S1 then S2 S3 then S4 etc.. are possible.
ps. Good to see activity in this thread. Kudos to Dr. Walrus for getting it started

Re: Combinator Contraptions

Posted: Fri Jun 24, 2016 5:39 pm
by siggboy
piriform wrote:Good to see activity in this thread. Kudos to Dr. Walrus for getting it started
There could be even more. There should be a library of these things so it would be easier to learn how to make complicated designs.

The wizards like DaveMcW and XKnight and so on mostly post complete and complicated circuits but don't talk about the little tricks they employed to make it work (the digit display is a good example).

BTW you're right about the register designs, in your register it's possible to hold several signals and update them. I never had a general purpose register in mind when I made my write-once register, it's specifically to accept polling responses without troubles.

Re: Combinator Contraptions

Posted: Fri Jun 24, 2016 8:53 pm
by DemiPixel
Are there any designs for arrays in Factorio? i.e. I have a memory cell with:

- 3 transport belt
- 44 fast transport belt
- 89 express transport belt

If I have 1 blue, I get 3 green
If I have 2 blue, I get 44 green
If I have 3 blue, I get 89 green

Also perhaps the ability to set based off a num as oppose to an item?

It's easy to convert blue to an index (with a decider `blue=each out each` with a constant: 1 tp, 2 fast tp, 3 express tp`)
DaveMcW had a design for READING from the item type to the value (like two pages ago), but his has a limit on 999. Is there anyway to allow all 32 bits without any limitations? I think it might be possible to do this with only-positive but I don't really wanna go that route.

Re: Combinator Contraptions

Posted: Fri Jun 24, 2016 10:39 pm
by AccidentalChef
DemiPixel wrote:Are there any designs for arrays in Factorio? i.e. I have a memory cell with:

- 3 transport belt
- 44 fast transport belt
- 89 express transport belt

If I have 1 blue, I get 3 green
If I have 2 blue, I get 44 green
If I have 3 blue, I get 89 green

Also perhaps the ability to set based off a num as oppose to an item?

It's easy to convert blue to an index (with a decider `blue=each out each` with a constant: 1 tp, 2 fast tp, 3 express tp`)
DaveMcW had a design for READING from the item type to the value (like two pages ago), but his has a limit on 999. Is there anyway to allow all 32 bits without any limitations? I think it might be possible to do this with only-positive but I don't really wanna go that route.
I don't have a way to use the full 32 bits but it seems like you could get 31 bits and still have positive and negative values with a little extra work. The array I've actually implemented could store 30 bits but only positive numbers. To read from an index in the array, send 1G (2^30) on that index's signal, do an each > 1G on that signal combined with the array's contents, then each - 1G to restore the value. For the array to handle from -1G + 1 to 1G - 1 (basically 31 bits) you could subtract 1G from the input and store that value in the range from -2G to -1. Add -2G on the index's signal, each > 0, subtract 1G and you have your initial value.

If you really, truly have to have all 32 bits, the only way I can think of right now would be to use 2 combinators, one to store positive values and one to store negative values. then, to read, send -2G down the index's signal, each > 0 for the negative combinator and each < 0 for the positive one, add -2G, and you have the value. I haven't built this in game, but I think it should work except for storing the value -2G itself.

Re: Combinator Contraptions

Posted: Sat Jun 25, 2016 6:14 pm
by DemiPixel
What's the best way to do an int OR? Here's what I've got so far:

Code: Select all

H4sIAAAAAAAA/92X4W6bOhiGb6Xi5xkcYWPAUcek7TamKXLASayBjYzpGqHc+zEJEHoSHExaTduftqnt1/5e3u/BycRTLlKSP62ThnLFFKNV0jScFDRxMpqy
jEovFcWGcaKEdNxSVHqS4EnzmnjQPegf/4ZHNxWc07Qd0Mu/O8D5kTSSZlrqpHpYsywJ3ZTJtGaq/QCPx6P73YG3JsL/TzzpZ6yT746VNFsmK7Wu2I6TPGnU
odRnfmFS1SR33HMJ50GPknTvnFQqRbhKfP1nURLZ1pQ4nx1X1KqsLbXKwzoVNVfrrRTFmnEtkDhbklfUaY8810RgZSKaayJ4O9EdDQXjIfCX++sP9mZMnt1t
TZxh9VUMp6yO391Pwg9qz/hu2tMvdp6+UDlSnOcskUztC6pYeie8/iICgDeZXM3lwbW/l3MuiGxFW6lZK77p6aKk+gG01Tv/LEi1pbvQyl007S7w55Li99n7
9V3tvYcFu+DG0zAFwGAt/oNJq2RtiwN/MNWWtcFc1kYfGNbBVA8CFCMcRAiPI/npwzveruEj8z3pvb2Ix154E14wRYtecUMqXauShFelkMrb0Fy9caTfxPx+
gYvw126zZbmisr3QGg5ZS645wXhFpZ58Kl23QgIC4MfQZTyjryea3qvzSgFG2jrUKUCjQi74ztsTPTO71gkhghh3OoFRZ0sqdaMUH+EwjjoFZFSoCiJvSEB/
FYOwtyM0SuyIosNCBFYo8HsXIvPeSnDq/SJ5PizHAcaR3xcf31kuCdvtlad/XRRAFMcxBH312CiR1vJFP4I3AkEQhggFfe0r84PUz9ArGL8YEMXA1zX0Dug3
sWl9WwL3tBHlKIgIAl1CbwIwh7E9u3ceHiURoyBEYW8CuJNGsrmEL4hw7K/A0AnmAEqR/qRK75+LUfziIEYAw8EDcwTTPS2Y/k7qldpNdSniwuROJrRCCZyP
knA+SqbvMl3xaBIh07fMLngDOizK9OdXeeNV+hAwowBPFzuDlxis4OO0RP4qeoCV0B/ytQiUwB9ibkHJcOgva0LCoasX0XHAij0YB6bZInFg6QIYRsspiO3p
h5ZTDz4EOzBm3NFl6amRm+6frulCqbfrmsid/CqkNZ8lVbqTn9bPlGf/AatE/uEHFAAA
4 combinators to convert binary in separate items (2 for each int)
1 cominator to OR
3 combinators to map each item back to their number and add together

Ideally if you know a better way to do this, I'd like a hint instead of an answer ;) (unless it's really not intuitive).

Re: Combinator Contraptions

Posted: Sat Jun 25, 2016 11:06 pm
by DaveMcW
That looks about right. The only optmization I can think of would be to use 32 deciders to perform it in 2 ticks.

Re: Combinator Contraptions

Posted: Sun Jun 26, 2016 1:34 pm
by Jupiter
I've made a 24-h clock. I suppose it's one of the simpler contraptions posted in this thread but there weren't any clocks so I made one. It uses the smart display mod to show the values.

Screenshot
The constant comb. and decider comb. to the left form the basis of the clock. They increase the A signal by 1 every tick.
The rest of the arithmetic combinators just compute the number of seconds or minutes or w/e and calculate the remainder (1000800 ticks = 278 minutes = 4 hours and 38 minutes).