The Signal State

The Signal State

View Stats:
MPFB Jan 23, 2022 @ 3:15pm
What is an infinite loop
This should work lol.
Clock 3 => Sample& Hold Gate
S&H Out => NOT In
NOT Out => S&H IN
S&H Out => Clock 6
< >
Showing 1-7 of 7 comments
MPFB Jan 23, 2022 @ 3:20pm 
It seems like somehow this is doing sequential calculations when it should really be treated as discrete time steps. Ie. you have a currentState, and the next state is calculated from the current state. No need to infinetely feed back a S&H module. That isn't how real electrons work.
Karaidon  [developer] Jan 23, 2022 @ 8:09pm 
Signals are only recorded to the outputs when they stabilize, i.e they stop changing. This abstraction is so that the expected behavior is consistent and deterministic even for more complex circuits, so in this case the constant flip flopping of the sample and hold's input caused by the NOT prevents the signals from stabilizing.
gotan Feb 11, 2022 @ 12:40pm 
It's a bit confusing with Sample & Hold. Aparently during one timestep it will either sample or hold in that whole step. There are circuits that would settle in a state, e.g. use the difference between in and out of S&H as trigger. It should settle in the state when out is identical to in, after a brief trigger pulse (that could e.g. trigger another S&H too).
The problem from a design view is, that the game would have to implement fine grained timing of signals, how they pass through gates, how they are synchronized. That would be very intransparent for players too. As it is the game can resolve all modules in any order and the result should be the same.
There are other circuits with feedback loops that would settle in a stable state but don't work too well either AFAIR. Basically any circular dependencies don't seem to work, or at least not well. At least the player is alerted to the problem and the game doesn't simply hang in an infinite loop.
It's a limitation of the game, but eliminating it would make the game logic much more complex.
Karaidon  [developer] Feb 11, 2022 @ 4:55pm 
Yeah its an abstraction that we ultimately had to make otherwise the game would be very inscrutable i think!
gotan Feb 13, 2022 @ 6:26am 
Hmm, fiddled around a bit more with loops. Aparently one *can* make them work, but what it does seems to be dependent on the order of modules on the rack. Switching two modules places without altering connections yields different results.
Also i can't get my head around why sometimes a module seems to take an "internal clocktick" to propagate a solution, and sometimes it doesn't.
Looping solitions seem to be a bit brittle.
Karaidon  [developer] Feb 13, 2022 @ 6:37am 
There is a known bug right now with some very specific looping circuits where the order of the modules affects the result. thats probably what youre experiencing. this isnt intended behaviour, module order shouldnt matter.
mtgmarshall Apr 4, 2022 @ 7:00pm 
Im coming across this same issue in the 'Tractor Gear System' level where it would be really convenient to create a clock divider similar to the one you mentioned.

For future viewers of the post the S&H component functions as a D-Latch as apposed to a D-FlipFlop, which wasnt immediately obvious to me given its description, but seems like the issue. Still suffers from legitimate steady-state solutions mentioned by gotan above.
< >
Showing 1-7 of 7 comments
Per page: 1530 50