shapez 2

shapez 2

35 ratings
Building an Expandable MAM (Make Anything Machine)
By JAW
A step by step guide with blueprints to building an expandable MAM (Make Anything Machine) that can produce any random operator shape.
2
3
2
   
Award
Favorite
Favorited
Unfavorite
Introduction
In this guide I will go through the design of each module of the MAM and explain their function. A blueprint for each module can be found in its section as well as at the end of the guide.

When speaking of shapes, I will use the same notation and order as the game. A shape is composed of layers, each layer is composed of four parts, parts have a type and a color. The first part “Cu------” is on the top right, the second part “--Cu----” on the bottom right and so on in clockwise direction.

This MAM was build in version 0.0.9-rc7 of the game.

If you want to look at the finished product and figure out its function yourself or just want to copy the MAM, there are several blueprints for full MAMs of different sizes at the bottom of this guide.
Design Considerations
  • The MAM will only take primary shapes (1 layer, all four parts uncolored and of the same type) and primary colors (red, green and blue) as input and produce everything else on-site.
  • The MAM will be organized into production lines. Each line takes one full belt of each primary shape and outputs one full belt of a single layer of the desired shape. Multi-layered shapes require one production line per layer.
  • The MAM takes its input from one end and outputs the desired shape on the other end. It is extendable indefinitely to the side.
Limitations
While this MAM can produce all random operator shapes, it is not a universal MAM.
  • It cannot produce gaps or pins below crystal layers.
  • It cannot produce crystals of different colors within the same layer.
The MAM
The image above shows the layout of the MAM and its construction blocks. Shapes are fed through the MAM from top to bottom. The main building block is the production line, the platforms at the bottom are the control infrastructure and also deal with the export of the finished shapes. The rest of the marked platforms is support infrastructure to supply the production lines with resources. The MAM can be expanded indefinitely to the right.
1. The Production Line
The base building block of the MAM. Each production line creates one layer of the requested shape. Adjacent production lines work together to assemble multi-layer shapes.
1.1. The Cutter
The first step is to take the primary shapes and cut them into parts as needed.

The cutter module takes one belt of each primary shape as input and outputs four belts of single parts of the correct type and rotation. A wire signal provides a one layer shape template that determines which type is produced for each part. Gaps, pins or crystals in the template result in a gap for that part.

Blueprint
Cutter Module[community-vortex.shapez2.com]

How It Works
The Shape Analyzer
First the module needs to determine which type (if any) is required for each part. The shape analyzer takes a shape as input signal and it has two output signals. The one on its right outputs the type of the first part on the lowest layer of the input and the output on the bottom is the color of the same part.

Filtering the Belts
In this case only the type signal is needed. It gets compared to the static signal set by a signal producer. The comparison gives out a boolean true “1” if it matches and a false “0” if it doesn’t. On a “1” signal, the belt filter allows the shapes to pass, on a “0” signal it reroutes them to the side. Since the side leads nowhere, the belt gets stuck until the signal changes.

It is assumed that the input belts are sorted correctly, the circuit in no way checks what is actually on the belt. Going by the setting of the signal producers in the image, in order from top to bottom the belts should carry circles, then squares, stars and finally diamonds.

Cutting It Into Parts
So now that the desired shape has been selected, it needs to be cut into parts and the parts need to be rotated into the correct position. By using cutters instead of half destroyers, 1 input shape is turned into 4 parts, thus only ¼ of the input belt is used up to fully fill the first output belt.

Getting All Four Quarters
Now the whole process has to be duplicated for the remaining three parts of the layer. By using simulated rotators on the input signal, the analyzer can output the type and color of the other three parts.

If the rotation of the output signal is important, the output of the analyzer needs to be fed through additional simulated rotators to finish one full 360° rotation, as seen in the image on the side.

Note that there is only a simulated rotator to rotate 90° clockwise. So if the analyzer starts with the first part “Cu------”, after one rotation it will output the fourth part “------Cu”. To get the second part “--Cu----” the input signal has to be rotated three times.

Since only ¼ of an input belt is used to fill 1 output belt, 1 input belt is just enough to fill all 4 output belts in case a template with four identical parts is used.
1.2. The Painters
The next step is to paint the parts. Due to its size, the painter module is split up into two 1x2 platforms. Each of the platforms paints two of the four parts in any of the seven available colors.

Primary colors (red, green and blue) are input from the side. Each painter platform requires 2 inputs per primary color (4 if it is supplying the adjacent production line with primary colors). Colors are mixed as required. Each part can be painted in a different color.

A wire signal provides a one layer shape template that determines which colors the parts are painted. The same wire signal is relayed to the cutter module.

Blueprint
Painter Module[community-vortex.shapez2.com]

How It Works
Color Mixers
Since only the three primary colors are supplied, secondary and tertiary colors have to be mixed on-site. Each color mixer has two inputs and one output. It uses ½ unit of each of its inputs to produce 1 unit of its output. One color mixer can supply two painters. Four painters are required per belt, so that makes two mixers.

Pipe Gates
The easiest setup is to put down two mixers per color per belt (three for white), which would make 9 mixers per belt in total. However, thanks to pipe gates, the inputs of the mixers can be switched to different colors. This way it is possible to mix all available colors in just three color mixers per belt.

To produce all secondary colors, these are the input combinations the setup needs to be able to provide:

Input 1
Input 2
Output
red
green
yellow
red
blue
magenta
green
blue
cyan
yellow
blue
white

For white any secondary color can be combined with whatever matching primary color, yellow and blue was picked at random. The only difference the choice of input colors makes is how much of each primary color is used up: To produce 1 unit of white color, the yellow-and-blue setup uses up ½ unit of blue but only ¼ unit each of red and green.

The image on the left shows the pipe setup used in the painter modules. It takes five pipe gates to control the input of the mixers, plus three more gates to allow primary colors to go to the painters as well.

Color mixers that are supplied with the same color in both inputs output that same color as well, so alternative setups that supply the painters with primary colors through the mixers are also possible.

Note that if all internal tanks of color mixers are full when the inputs are changed, the mixer will fail to drain its tanks and block the pipe. Since there is no way to drain pipes into space as there is for belts, the only reliable way I have found to prevent clogged pipes is to use up the remaining color with the painters. Any resulting wrong-color parts are then sorted out and trashed.

This can easily be done by supplying a shape signal to a belt filter. Any shape that passes the filter is compared to the signal, any that match it are let through, any that are different are rerouted to the side. This checks for both type and color.

The Control Circuit
The image on the left shows the control circuit for the pipe gates. The buttons and signal producers in the bottom are just there to provide a test signal to the circuit. Currently, a “color-y”-signal for yellow is given.

The three primary colors on the right are easiest. If a pipe gate is given a color signal, it will only let that color through. So the unaltered color signal is delivered to the pipe gates and if the color in the pipe matches the signal, the gate allows the fluid through. The current signal is for yellow, so all three pipe gates are closed.

The circuit to supply the mixers and make the secondary and tertiary colors is on the left. It delivers a true “1” or false “0” signal to the pipe gates. The pipe gates open on true and are closed on false.

First four comparisons check if the input signal is equal to any of the secondary or tertiary colors. If it is, the comparison outputs a “1”-signal, if it isn’t the output is “0”. This output signal is now delivered to the pipe gates for the corresponding primary colors. In the image, yellow is requested, so for input 1 red and for input 2 green are switched on.

The game treats a “0” signal different from no signal. Even though the wire does not light up, as far as the game is concerned, “0” is an actual signal. So if both a “1” and a “0” signal are sent into the same wire, the “1” does not overwrite the “0” but instead the wire produces an error due to conflicting signals. Therefore, if more than one wire leads to the same pipe gate, they can’t just be merged but have to be combined with OR-gates.

One final caveat: Pipe gates have the same throughput as fluid launchers/catchers, which is to say very little. One pipe gate is just enough to supply four painters with color, so in this setup one gate is sufficient. If a higher throughput is required, multiple pipe gates have to be used.

Rerouting Unpainted Parts
The last thing that is required is a way to route parts that should not be painted around the painters. Another comparison, this time against a “color-u”-signal for unpainted, that controls a belt filter does the trick.
1.3. The Layer Assembly
In the next step, pins are added in place of either pins or crystals in the template shape. Then the four parts are put together to form the full layer.

Crystals are replaced by pins to allows the production of layers consisting entirely of crystal. Crystal makers do not add a new layer on top of the provided shape, but they will fill pins, so a top layer of pins will be turned into crystal while a top layer of only gaps would be ignored.

The layer assembly takes 1-layer all pins shapes “P-P-P-P-” as input from the side. It uses up 1 belt itself but accepts 4. The remaining 3 belts are provided to the adjacent production line.

A wire signal provides a one layer shape template. The same wire signal is relayed to the painter module.

Blueprint
Layer Assembly[community-vortex.shapez2.com]

How It Works
The Circuit
Like in the previous modules, each of the four parts of the shape template is checked by shape analyzers. The circuit has two outputs. The first output is a boolean that is true “1” if the part is a pin or crystal and false “0” if it isn’t. This output is used to control pin delivery for this part.

For the second output the circuit returns the part in the correct rotation and color, but crystals are replaced by pins.

The image on the side shows the circuit. In the upper half, the analyzed part of the template is a red square. It is neither a pin nor a crystal, so the first output is false “0”. The second output is the unaltered red square “Rr------”. The shape analyzer outputs the uncolored type and the color separately, so to get back the unaltered part, both have to be re-combined with a simulated painter.

In the lower half of the image, the red square has been changed to a red crystal. Now the first output is true “1” and the second output has been changed to a pin “P-------”.

Note that pins have no color, so if the shape analyzer detects a pin, it won’t output a color signal. The simulated painter won’t output any signal if it doesn’t get both a type and a color input. So a pin signal either has to be routed around the painter as is done here or a color signal has to be provided to the painter.

This circuit is duplicated for each of the four parts.

Adding Pins
For each of the four parts, the boolean signal from the control circuit determines if a pin should be substituted. A similar layout of cutters is used as in the cutter module above to cut up the 1-layer all pins shapes and the pins are inserted onto the belts.

Putting All Four Parts Together
First the parts are checked against the second output of the circuit and any that don’t match the template are discarded. This is done before they are put together because in case of a production change, discarding the individual parts instead of the full layer allows the belts to clear faster in some cases.

Then three sets of stackers put the parts together. First part 1 + 2 and part 3 + 4 are combined, then the resulting half layers are combined yet again into a full layer. If the template has a gap for a part, that belt will be empty. Stackers that are only supplied on one of their inputs block the belt, so the other belt has to be routed around the stackers in this case.

Conveniently, output 2 of the control circuits will have no signal if that part is a gap. So sending output 2 for the two parts that are combined through an AND-gate does the trick. For the last set of stackers it needs to check if (part 1 OR part 2) AND (part 3 OR part 4) have a signal, so it takes two OR-gates in addition.

Swappers can be used instead of stackers to combine the parts. While stackers are more compact, they take up two floors. Swappers are only one floor high and can be placed atop each other.
1.4. The Crystal Generators
Until now, each module has only dealt with a single layer as its template shape. The final step is to stack the current layer onto the lower layers (if any) of the full template shape. Then crystals are created before the shape exits the production line and is sent to the line controller.

Colors are input from the side. The crystals module requires 2 inputs per primary color (4 if it is supplying the adjacent production line with primary colors). Colors are mixed as required.

A wire signal provides a shape template of the current layer this line is working on and all layers below (if any). Only the current layer is relayed as template to the previous module in the production line.

Limitations
  • Only one color of crystal can be generated per layer.
  • If crystals are generated, any pins or gaps on this and all lower layers are filled with crystals.
If an unsupported shape is requested, the crystals module will fail to produce the correct shape and the product will be discarded as defective.


Blueprint
Crystal Module[community-vortex.shapez2.com]

How It Works
Stacking Layers
Before the layer is sent to the crystal generators, it is stacked on top of the lower layers of the template shape. This has to be done before any crystals are generated for the current layer since crystals break if dropped by a stacker. Things can be dropped onto crystals, so any crystals already present in the lower layers are safe.

In case there are no lower layers or the current one is the lowest, it is routed around the stackers in a similar fashion as in the layer assembly above.

Picking a Color
First the control circuit will check if any part is supposed to be crystal. If any are, the circuit will also select a color for the crystal. The way it is set up, it will check the parts in order and pick the color of the first crystal it finds. Crystals of different colors won’t cause an fault in the circuit, but any additional colors will be ignored and the wrong shape will be generated.

Making Crystals
Colors are mixed on-site in the same way as on the painter module above. Note that crystal generators use up more paint than painters, so four instead of two mixers are required for one belt. Additionally, one fluid catcher can only supply three crystal generators. Since six generators are required per belt, two fluid catchers per primary color are needed. Pipe gates have the same throughput as fluid catchers, so for primary colors the gates have to be duplicated as well to avoid a bottleneck. Since color mixers use only ½ unit of each input to produce 1 unit of output, the mixer setup is fine with just one pipe gate per color.

If no crystal should be generated, the shapes are routed past the crystal generators. Otherwise, they go through the generators and any gaps or pins are filled with crystal.

After a final check to make sure the correct shape has been assembled, the shape exits the production line and is sent to the line controller.
2. The Control Infrastructure
These modules control production and determine which line gets sent which production template to assemble multi-layered shapes and make optimal use of all lines at all times. Additional sub-controllers allow parts of the MAM to be switched to different products in case smaller batches of multiple shapes are needed.

Since one production line is used per layer of the template shape, four (five for harder difficulties) lines are the required minimum. A MAM with 8 production lines can produce 1 belt of 5-layer shapes, 2 belts of 4- or 3-layer shapes, 4 belts of 2-layer shapes and 8 belts of 1-layer shapes. If the number of production lines is a multiple of the number of layers in the template shape, all lines are used, otherwise some are wasted. Therefore, 12, 20, 48 and 60 line MAMs are most efficient. The layout of the MAM itself lends itself to multiples of 8.

All control modules also route the finished shapes to export. They have a capacity of 8 belts, so unless 1-layer shapes are never produced, an export train station is required after every eight production lines.
2.1. The Main Controller
The main controller has two modes of operation. Its wiring is actually rather simple. It either takes its shape template from a global wire receiver or it allows manual input of a template via a signal producer. A button switches it between the two modes.

A second button switches the entire MAM on or off.

Blueprint
Main Controller[community-vortex.shapez2.com]

The Control Signals
Two wire signals are sent to subsequent line controllers. In case of the main controller, both signals are identical and contain the shape template set by either of the two methods described above.
Export
The controller platform doubles as an export train station. Shapes are checked and defective shapes are discarded before they are fed into the train loader. It can handle up to eight belts of shapes.
2.2. The Line Controller
Each line controller manages two production lines. It receives two wire signals from the previous controller. The first is the full shape template, the second template has its uppermost layer removed and assigned to the production line each time it passes a production line. Once there are no more layers left in the second template, it is replaced by the full shape template from the first wire and the process repeats.

The line controller receives one belt of shapes from each of its two production lines. It routes unfinished shapes to the next production line in the production chain and puts finished products on an export belt. It can deal with 8 belts of finished shapes.

Blueprint
Line Controller[community-vortex.shapez2.com]
2.3. The Sub-controller (optional)
The sub-controller is an addition to make large MAMs more flexible. It has pretty much the same function as the main controller. It has a global wire receiver and a signal producer to input a shape template. A button turns the sub-controller on and off and allows it to take over control of all subsequent production lines.

Blueprint
Sub-controller[community-vortex.shapez2.com]
3. Support Infrastructure
3.1. The Pin Production
The only support module of notice. It fits on a 1x3 platform. It has 12 input belts on which it accepts any kind of one-layer shape as long as the shape has four parts. It will produces 8 belts full of 1 layer all pins shapes “P-P-P-P-”, four of which it exports to each side.

It produces these pin shapes by adding pins to a shape until the layer limit is exceeded and the uppermost part of the shape is removed. The result is a 4 layer shape consisting of only pins “P-P-P-P-:P-P-P-P-:P-P-P-P-:P-P-P-P-”. This shape is cut in its four parts “P-------:P-------:P-------:P-------”.

A different shape is funneled through only one pin pusher resulting in some random shape atop a layer of pins, then it is stacked atop one of the pin towers from the previous step. The resulting shape again exceeds the layer limit, the original shape is deleted and the three remaining pins fall down to the lowest layer, resulting in a shape with one pin tower and three single pins “P-P-P-P-:P-------:P-------:P-------”.

This shape is run through a set of swappers to produce three “P-P-P-P-”-shapes and one “P-P-P-P-:P-P-P-P-:P-P-P-P-:P-P-P-P-”-shape. The former is exported to the production lines and the latter is recycled for the next production batch.

This kind of pin producer converts an input of 4-part shapes into 4 pin shapes at a ratio of 4:3. It can be made to work with input shapes with less parts at worse ratios.

Blueprint
Pin Production[community-vortex.shapez2.com]
3.2. The Distributor
Receives primary shapes from train unloaders and distributes one belt of each of the four shapes to each production line. Serves four train unloaders and four production lines. Has some rudimentary belt balancing. Does not sort shapes, depends on the train to deliver the primary shapes to the correct unloader. It consists of two 1x2 platforms.

Blueprint
Distributor[community-vortex.shapez2.com]
3.3. The Export Train Station
It can handle up to eight belts. Shapes are checked and defective ones are discarded before they are fed into the train loader.

Blueprint
Export[community-vortex.shapez2.com]
Blueprints
1. Complete MAM setups
Due to the size of the blueprints, I can't use community-vortex.shapez2.com to share the complete MAM setups. Here are google doc links instead. Just copy the contents of the text documents and paste them in-game:

MAM 4 Production Lines[docs.google.com]
The budget option, just big enough to produce shapes with four layers.

If you want to expand this version, note that those modules that import and export resources from the sides may need their side imports and exports switched depending on their new position within the MAM.

MAM 8 Production Lines[docs.google.com]
The standard size. Any bigger MAM will basically be multiple copies of this structure. If this 8 line setup is used as the base blueprint to expand the MAM, all side imports and exports will already be correctly aligned.

MAM 16 Production Lines[docs.google.com]
Needs a second export train station. The game starts to lag noticeably when copying or pasting that structure.

The following freeze my game for a few seconds just copying them. Use at your own peril.

MAM 32 Production Lines[docs.google.com]
A sub-controller allows it to function as one 32 line MAM producing the same shape or two 16 line MAMs producing two different shapes.

MAM 48 Production Lines[docs.google.com]
Like the 32 line version it has a sub-controller every 16 production lines, allowing this version to assemble up to three different shapes at the same time.
2. Individual Modules
These are the same blueprints as in the individual chapters above, all in one place.
Cutter[community-vortex.shapez2.com]
Painter[community-vortex.shapez2.com]
Layer Assembly[community-vortex.shapez2.com]
Crystal Module[community-vortex.shapez2.com]
Main Controller[community-vortex.shapez2.com]
Line Controller[community-vortex.shapez2.com]
Sub-controller[community-vortex.shapez2.com]
Pin Production[community-vortex.shapez2.com]
Distributor[community-vortex.shapez2.com]
Export[community-vortex.shapez2.com]
10 Comments
JAW  [author] 12 Jul @ 2:53am 
@Chalupas Batman
No, at the very least you need the third floor and wires.
Once you have those, you could probably get it working without the painter, crystal or pin modules, but it’d be a lot of bugfixing and retooling for a MAM with very limited use.
Chalupas Batman 11 Jul @ 4:35am 
can this be used early game?
JAW  [author] 24 Jun @ 4:54am 
@Dela
I haven’t had time for more thorough tests yet, but I’ve loaded an old save from before the dimension update as well as pasted the MAM blueprint down.

It needs some minor fixes but seems to mostly still work.

The old space pipe tunnels don’t exist any more and will have to be replaced. (Where the space pipes tunnel under the pin production.)

I’ve also found the painters in my old save to be stuck. After I deleted them and pasted the blueprint over them they began working again.
Dela 23 Jun @ 9:37am 
Does this MAM still works for the new Dimension update? Or it has to be updated too?
JAW  [author] 9 Jun @ 8:36am 
@Chunkboi
I never got around to adding multiple crystal colors in the same layer since it wasn’t required for the random operator shapes.

The easiest way to build such shapes with the existing design probably is to build each corner of the shape separately and then put them together with swappers like you suggest. However, this would at least double the number of lanes required to build a shape, so it’s not very efficient.
Chunkboi 8 Jun @ 11:31am 
What's the issue keeping the MAM from making multiple crystal colors on the same layer? Can the machine use swappers rather than cutters? Maybe with the latest update the machine could cast and swap in crystals and shapes for individual corners and use a swapper to assemble the final product?
JAW  [author] 24 Mar @ 10:55am 
@Eeveon
Does your shape have two lavers? Then it is working as intended. Each lane can only produce one layer, so two or more lanes work together to produce multi-layered shapes.

If your shape has just one layer, something is indeed wrong. Can't say what without more information what is happening. Most likely some inputs are missing or going in the wrong place.
Eeveon 24 Mar @ 6:51am 
The 8 production line mam is only producing 4 belts of shapes for me. Did i do something wrong?
JAW  [author] 26 Feb @ 11:56pm 
@dlbarron28
Yes, I supply all shapes and colors with the same train line. For shapes it is a wagon with all three layers filled with the same shape, for colors it is all three colors in one wagon, red on the top layer, green in the middle and blue at the bottom. The platforms all have labels by their inputs listing what inputs they expect. As long as they get those inputs, they should work, no matter how you deliver them.
dlbarron28 26 Feb @ 2:05pm 
This looks very nice. I do have questions though, your description does not explain how I supply the shapes and colors. There are 13 unloaders, 8 shape unloaders and 5 color unloaders. Do I feed in one train with 15 wagons in the right order? There's only one stop on the input line so I assume that's how it works.