[0.12.24] [Twinsen] Circuit network problem (feedback loops and biestables)
Posted: Thu Mar 03, 2016 2:37 pm
I know a thing or two about circuit networks in factorio. I also know a little about digital electronic, so i thounght that i would be able to do some crazy automations. As it turns out, i found a problem in the circuit network that has an easy solution.
THE PROBLEM
The problem is how the circuit network works. It doesnt allow you to do some things properly. A lot of circuits with feedback don't act as you would expect them to do. For example, i wanted to have a memory bit. For that, I made a RS biestable (if you don´t know what that is, it's an electronic concept, google it). It is a bit of memor. Output 1 or 0.
http://imgur.com/NKVkveH
Both deciders are exactly equal. The green wires on the left are the Set and Reset of the biestable. The green wire on the right is the output. The red wires are the feedback wires. When a signal arrives to the Set input, the output is 1, and keeps beeing 1 until a signal arrives to the Reset. When this happens, the output is 0, until the Set signal changes it. In other words, it is a bit of memory.
It works fine in most cases, but there is a problem: when the Set and Reset signals are one tick long (every second is divided in 60 ticks, wich means that the circuit network is updated 60 times a second). When that happens, it goes crazy. It's not stable at all. Every tick, the output changes. At tick "n", both feedback wires (the red ones) are 0, wich means no signal. At tick "n + 1" both feedback wires are equal to 1. At tick "n + 2" both are 0 again, etc. It keeps in that loop until its cancelled by an input signal.
I wouldn't call that a bug, because it does exactly what it is suposed to do because of how the circuit network works (comparing tick "n" with tick "n - 1", if im not mistaken).
IMPORTANCE OF THAT PROBLEM
That problem is minor. A lot of people won't even notice it, and the game is perfectly playable even if it's not fixed. But, if it get's fixed, it will allow really complex automations. I would like to make the biggest and most badass completely automated factory. Without a propper way of having memory in the circuit network, it´s almost imposible (a smart chest with a smart inserter is too slow, too expensive and requires a lot of space. And it is awful).
It would give us a better tool to design and have fun in factorio. (offtopic: Or you could just add a programmable logic controller
)
POSIBLE SOLUTIONS
The ideal solution would be to redesing how the circuit network works. Of course, that's a lot of work, a lot of bugs will pop out of nowhere and I understand that that's not a viable solution (yet, with the game being in alpha).
Fast solution number 1: make a new combinator. It would be just a bit of memory. If x input, output 1, and keep outputing 1 until y input comes. If y input, output 0, and keep outputing 0 until x signal comes.
Fast solution number 2: add a "double tick wire". That wire would send the signal for one more tick than a normal wire would.
First post, and english isn´t my native language, so you´ll have to be forgiving with me.
If you made it this far, you'r a champion! have a good day
!
THE PROBLEM
The problem is how the circuit network works. It doesnt allow you to do some things properly. A lot of circuits with feedback don't act as you would expect them to do. For example, i wanted to have a memory bit. For that, I made a RS biestable (if you don´t know what that is, it's an electronic concept, google it). It is a bit of memor. Output 1 or 0.
http://imgur.com/NKVkveH
Both deciders are exactly equal. The green wires on the left are the Set and Reset of the biestable. The green wire on the right is the output. The red wires are the feedback wires. When a signal arrives to the Set input, the output is 1, and keeps beeing 1 until a signal arrives to the Reset. When this happens, the output is 0, until the Set signal changes it. In other words, it is a bit of memory.
It works fine in most cases, but there is a problem: when the Set and Reset signals are one tick long (every second is divided in 60 ticks, wich means that the circuit network is updated 60 times a second). When that happens, it goes crazy. It's not stable at all. Every tick, the output changes. At tick "n", both feedback wires (the red ones) are 0, wich means no signal. At tick "n + 1" both feedback wires are equal to 1. At tick "n + 2" both are 0 again, etc. It keeps in that loop until its cancelled by an input signal.
I wouldn't call that a bug, because it does exactly what it is suposed to do because of how the circuit network works (comparing tick "n" with tick "n - 1", if im not mistaken).
IMPORTANCE OF THAT PROBLEM
That problem is minor. A lot of people won't even notice it, and the game is perfectly playable even if it's not fixed. But, if it get's fixed, it will allow really complex automations. I would like to make the biggest and most badass completely automated factory. Without a propper way of having memory in the circuit network, it´s almost imposible (a smart chest with a smart inserter is too slow, too expensive and requires a lot of space. And it is awful).
It would give us a better tool to design and have fun in factorio. (offtopic: Or you could just add a programmable logic controller

POSIBLE SOLUTIONS
The ideal solution would be to redesing how the circuit network works. Of course, that's a lot of work, a lot of bugs will pop out of nowhere and I understand that that's not a viable solution (yet, with the game being in alpha).
Fast solution number 1: make a new combinator. It would be just a bit of memory. If x input, output 1, and keep outputing 1 until y input comes. If y input, output 0, and keep outputing 0 until x signal comes.
Fast solution number 2: add a "double tick wire". That wire would send the signal for one more tick than a normal wire would.
First post, and english isn´t my native language, so you´ll have to be forgiving with me.
If you made it this far, you'r a champion! have a good day
