I built a thing around memory cell I called memorizer. Maybe there was something similar before me, but couldn't find. The idea is when a certain signal disappears (became 0) it value persists in a memory cell. When it appears again it resets.
Turn on and off sending "X" signal and you will see it in action. Value is stored in top right combinator in "Y" signal.
The funniest part is that's actually what I wanted, but I couldn't understand how and why this works. Just some idea came up to me and when I finished I forgotten that idea. And now I'm looking at this thing and couldn't understand what kind of magic it is. There also was more dirty setup with additional wires and combinators which I then realized was useless, but if "Y" value passes additional decider before going to memory cell it doubles (so if "X" was 10 then "Y" will be 20). And I still couldn't understand it. Looks like it tied to an order in which game engine computes circuit network values.
So I will appreciate if someone could explain to me what I've made.
Re: Made a memorizer... accidentally
Posted: Sat Aug 01, 2026 6:37 pm
by Nidan
Ikor wrote: Sat Aug 01, 2026 5:29 pm
Looks like it tied to an order in which game engine computes circuit network values.
The key part is hidden in there: The game works in "updates" or '"ticks" during which everything gets updated once. For circuits this means all combinators update simultaneously and other combinators will only see the resulting changes in the next tick.
The arithmetic renaming X to Y (X * 1, output Y) introduces a one tick delay on that path, so that the following arithmetic can see the last value of X at the same time as Z=1 indicating that X is now 0. Since we now know that we only need that once tick delay, we can condense this down to 2 combinators:
The bp contains 2 equivalent versions, the only function of the changed combinator is to introduce the delay and output nothing when there's no input for X.
Re: Made a memorizer... accidentally
Posted: Mon Aug 03, 2026 10:05 am
by Ikor
Thanks, it took some time but now I understand how it works.
I also made another version of memorizer which saves latest first value after 0, e.g. if "n" is a value at certain tick, then when condition "n != 0 and n-1 = 0" is met then "n" is saved.
It consists of delay combinator, a "value saver" and a memory cell. So value saver outputs "n" exactly when "n != 0 and n-1 = 0", while memory cell saves it only when opposite condition is met. It works because saver introduces 1 tick delay by itself, so memory cell clears previous value at the same time, but receives a new value 1 tick later.