Opus Magnum

Opus Magnum

View Stats:
andrewb Mar 15, 2018 @ 4:32am
Need help understanding the repeat and reset instructions
So I just finished the Purified Gold level, here is my solution.
https://steamusercontent-a.akamaihd.net/ugc/936059466824854105/8B5F6201B835E16A603E480009A53867AC631FCB/
I found out that apparently, I don't understand how the repeat and reset instructions work.

When I first built the solution, it didn't work. I was looking around the internet and found someone using the repeat instruction in this level. So I thought...OK, I guess the lowermost "level" of arms basically need to run twice for the whole machine to finish, so I added the repeat instruction to those and the machine then worked.

What I don't understand at all is: Why do I even need the repeat instruction? The arms are going exactly at the same pace all the time, no matter how many times the whole machine repeats so why can't I just have them reset?

Another thing is this. When I was adding the two uppermost arms that grab the silver and gold, I thought: The rest of the machine needs to run twice because I need 2 silver so I can just add 2 extra repeat instructions to the lowermost arms and one repeat instruction to the rest of the machine. Doing this broke the machine. I don't understand why.

I ended up setting up the arms in such a way that they behave the same way every cycle but only output gold when there is one which I think is simpler but I still don't understand why my former solution didn't work.
< >
Showing 1-5 of 5 comments
ShadowCluster Mar 15, 2018 @ 10:29am 
Repeat and Reset Instructions are placeholders or 'instruction generators'. These produce instructions when you start a simulation based on previous code. How many additional instructions they generate are represented by a white arrow.

Resets are the most common. These will generate a series of instructions such that the arm will return to its original position. The best way to describe how it does this is pretty easy:
[If it is grabbing an atom, drop it]
[If it is a piston and it has a different length to its original position, extend/retract to that length]
[If its rotational position is different from its original position, rotate back to that]
[If it is on a track and not in its original position, slide until it is]

Repeats are a bit more tricky, but pretty easy to understand. It'll copy and paste every instruction before it. The start point is dictated by the first non-repeat instruction after a repeat (if it exists), and the end point by the last non-repeat instruction before it. Most of the time, it means the start of the instruction tape and every instruction before any repeats.
Just think of this as a shortcut instruction. If you need a particular part of the machine to do the exact same process twice in one machine period, then feel free to use it. Just think of it as 'If I programmed this manually, everything I write will be the exact same as something I've already put down'.
GMC Mar 15, 2018 @ 3:02pm 
I suspect that the heart of the issue is this: the cycles for all arms are padded to the same length. An arm won't repeat its cycle as soon as it finishes the last instruction. This avoids the need to manually pad the instruction sequence to keep the arms synchronised. The entire cycle is shown with a lighter background in the timeline, so you can see where each arm's cycle actually ends.

The first time that an arm performs a particular instruction, whatever instructions the other arms were executing at that point, they'll be executing exactly the same instructions when that instruction is repeated on subsequent cycles.

Note that this doesn't guarantee that cycles are identical; if an arm ends its cycle in a different position to that at the start of a cycle, then the following cycle will have different results even though the same instructions are executed. But it makes it much easier to construct solutions which loop.
andrewb Mar 15, 2018 @ 3:17pm 
Thanks for the answers. The "padding" GMC describes is what I have trouble grasping. It didn't cause me any trouble in previous puzzles but here it really showed I was (and still am) misunderstanding an important part of the game.

What also was happening was when one of the arms was grabbing stuff too early, I just shifted the instructions one step forward and nothing changed at all, the exact same thing kept happening. It must have something to do with the padding but like I said... I don't get it.
chris.australia Mar 17, 2018 @ 5:40am 
@andrewb FYI I have managed to get far without needing either of those functions,
while also achieving the lowest Cycles score.
I wonder if there is a challenge that actually requires it, or if they are what I think they are - just shortcuts.
andrewb Mar 17, 2018 @ 6:42am 
They are just shortcuts...my issue was that different parts of the machine had different periods and I just didn't realize it. It had nothing to do with the instructions.
< >
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: Mar 15, 2018 @ 4:32am
Posts: 5