Everything Machines

*This article is about Everything Machines in general. For a selection of designs, see Efficient Designs § Everything Machines.*

With the wires update (1.2.0) came the ability to building "Everything Machines" or "Make Anything Machines". As the name suggests this is a machine that is capable of producing any kind of shape. Because the machine will have to deliver large quantities of shapes you ought to position your machines in one of the four cardinal directions from the Hub. In order to keep the machine producing you should keep any work-in-progress everything machines at a location separate to your working one.

Planning the scale is of major importance. A machine that delivers one 4-layer shape at 1/4 the belt capacity will usually be vastly smaller and simpler than a machine that has to deliver one 4-layer shape at full belt capacity. Since you can simply combine the output from four quarter scale machines to meet the throughput of one belt, there's rarely any point in building a machine that is bigger than that, unless you're able to make do with a single belt of each resource and also keep the size relatively small.

There are two broad categories of EMs that will result in very different designs: machines that cut shapes and then paint them and then there are machines that paint shapes before they cut them. EMs that cut shapes before they paint will usually be smaller in size but less resource efficient when it comes to paint and vice versa. You can also categorize machines based on whether they are constant rate or variable rate output.

Split up the job into manageable pieces. Contrary to how you probably have been constructing shapes up until this point (by chaining individual efficient factories), now you might want to opt for a strategy where one mega-factory makes one complete layer, but at a slower pace. Take your time and perfect your mega-factory and you're pretty much 90% done, the rest is just a bunch of wire and belt routing and lots of copy and paste.

Give yourself some wiggle-room when you design. It is much harder to constantly move stuff around than it is to shrink your design once you're done.

A design pattern that is very useful when constructing mega factories is to have inputs meeting at a 90 degree angle, often this will allow you to make nice-looking arrays that perform one specific task.

Having mechanisms to purge the system of old shapes once a new shape is requested is important for keeping the latency of the machine down. Smaller machines have less lengths of belts that will need to be purged of old shapes once a new shape is requested, so they generally have less latency.

The length of the input lanes does not matter for the latency of the machine, the length of your output lanes does however so try to build your factory somewhat close to the Hub. Move other stuff away from the Hub if you need to make space.

## Disclaimer

**\*\*\*SPOILER ALERT\*\*\***

If you do not want to **spoil** the *fun* of getting to figure out your own design, DO NOT PROCEED.

Otherwise, if you're having troubles figuring out how to make your own design or want to compare your own to the ones below, then feel free to proceed.

## Example design of a 1/4 pace Everything Machine

This is an example design of a machine capable of delivering at a constant rate of 1/4 the belt capacity. It was chosen as an example because it is both small, simple and has a constant predictable flow rate. This design does handle missing quadrants but it doesn't handle shapes that are prone to collapsing.

The major parts are:

1. Main signal bus
2. Main input bus
3. 4 × Mega-factories (Layer makers)
4. Final selective layer-stacker

### Main signal bus

Takes the requested shape signal from the Hub and runs it through an array of 3 virtual unstackers to form the main signal bus consisting of 4 wires each transmitting the layer shapes. One of each wire connects to a mega-factory and all 4 wires connect to the final selective layer-stacker. Run an extra wire transmitting the full 4-layer shape to the final selective layer-stacker.

### Main input bus

The main input bus delivers 4 basic shapes and 7 colors to each of the mega-factories. It consumes basic shapes at the requested rate up to a maximum of the full belt capacity. The colors are consumed at the requested rate. In the original design it was dimensioned for a worst-case where all the 16 quadrants would need to be painted a single color. To keep the quarter pace this would have required two full input belts of each color. However statistically you are unlikely [1] to see more than 8/16 quadrants being painted in a **single**  color, and even if that would were to rarely happen, you can add Storages to each mega-factory's color inputs to prevent resource starvation. This way you can keep the pace up at all times with just one set of colors at full belt capacity.

### Mega-factories (Layer makers)

The mega-factories (layer makers) take 4 basic shape inputs, 7 color inputs and 1 layer signal input each.

#### Signal analyzer

Analyze the layer signal by putting it through an array consisting of some rotators and 4 shape analyzers. This will output 4 shape signals and 4 color signals. Also pass the layer signal to the selective stacker.

#### Shape selector

Start by using quad cutters on the 4 basic shapes, then rotate the quadrants so that they are all 1st quadrants, collect all of them in one Storage, then send the regular output through rotators again to form 4×4 lanes with all the unique quadrants that you originally got from the quad cutter. This contraption should prevent backlog on any one of the lanes to clog up the quad cutter and thus stop producing the other 3 quadrants. Then each lane goes through a 4×4 array of filters, connected to components: a comparator and a constant signal. Collects all quadrant one lanes on one lane, all quadrant two lanes on another lane etc. These gets sent to the selective painter.

#### Selective painter

The paint input lines are hooked up to Storages in case the demand for a single color rarely surpasses half the worst-case (8/16). The painter receives the resulting 4 quadrants from the shape selector and puts them through a 4×7 painter array. For each quadrant lane the filters checks the color signal and either taps of one of the color lanes, or in the case of gray or nonexistent quadrant, activates a bypass lane bypassing the painter. A double painter is used to improve throughput and save paint. The color filters are connected to components: a comparator and a constant signal. The bypass filter is connected to components: an XOR gate (connected on one end to the raw wire), a comparator and a constant signal. It then sends the colored quadrants to a selective stacker.

#### Selective stacker

Note that stackers will clog up if one of the inputs are not provided. The selective stacker takes 4 color (or shape) signals from the signal bus and uses logical gates between the signals to determine if two lanes should be stacked. If that is the case a filter sends the quadrants to a stacker, if not the input lanes will bypass the stacker and get combined. Also you will need to double the stacking capacity to meet the quarter pace demand. A total of 3 AND gates, 2 OR gates and 6 stackers are needed for this. The resulting complete layer then gets sent to a filter that checks if the layer shape matches the requested layer shape and if not trashes it, if it does match it gets sent to the final selective layer stacker.

 1
 2

### Final selective layer-stacker

The finished layers from the four mega-factories gets collected and sent to the final selective layer stacker. This works identical to the selective stacker from the mega-factories, except that it takes the layer signals from the signal bus to determine if two layers should be sent through a stacker. Your should filter the shape inputs against the layer shapes and trash any shapes that doesn't match. The final output should be sent through a filter that filters out and trashes any shapes that doesn't match the full shape signal from the Hub. If you did everything well you should have layered shapes coming out of your machine at 1/4 belt pace.

## Alternative design

It is possible to use only a quarter of the paint that the example machine uses by first painting the basic shapes then cutting them. Designs such as these tend to take up more space, but they are also simpler and thus more copy and paste friendly. They also tend to be very uniform and thus visually appealing.

Here's an example implementation, let's call it the "Best Effort Machine" or BEM for short. since it is variable rate. This design makes every quadrant possible (8 colors × 4 shapes × 4 orientations = 128 variants). Since the output depends on how many of the **exact** same of any quadrant is requested for a shape, at best this can deliver at full rate, but half rate is common too, worst case it drops all the way down to quarter rate but this is very rare. [2]

It starts by combining every shape with every color in a 4 × 7 array to produce 4 × 8 colored shapes, it uses regular balancers to distribute the shapes **at even rates** on all the lanes. It uses two double painters and two quad cutters to improve refill throughput. It then cuts each colored shape into quadrants which it rotates to all 1st quadrants, combines the outputs from one of the cutters on a lane, these get fed **evenly** through regular balancers and then get rotated back to their original orientation and is then delivered to four Storages. The balancers will help redistribute flow when one of the lanes back up. Ensure you have the equivalent of 2 full belts worth of flow going into the storages. The four Storages connect into an absolutely massive 128 × 16 filter array. These 16 taps represents all the 4 quadrants and 4 layers of a full shape. These then get selectively stacked through 4 × 3 full scale stackers to produce each layer, then these gets delivered to the last 3 full scale stackers to stack all the layers. There are a total of 16 purging filters before the first 4 single-layer stackers and a 4 after. There is also 4 purging filters before the final layer stacker and one after.

You can sacrifice the compact size if you want to scale this design up to deliver at full belt rate almost all the time. First take out two belts of each basic shape instead of one, then you can use two Storages connected in serial for each of the lanes, instead of one. Widening the big filter array from 2 to 3 tiles will allow for running two lanes from each of the Storages, which will allow you to have layers 1 and 3 tap one of the lanes and layers 2 and 4 tap the other lane. Reserve two tiles worth of height between the layers so that you have space to put in a line of regular balancers between the lanes between layers 2 and 3, also put a row of balancers at the start of the lanes, right after the storages.

## Difficult Shapes

Some shapes such as the Rocket Ship requires more advanced designs to build. These are not needed to build the random freeplay shapes but if you want to build a true everything machine you need to be able to build these more difficult shapes.

Difficult shapes arise when 2 adjacent layers don't have any pieces that touch each other. Sometimes these shapes are impossible but many of them are not.

To build these shapes you have to:

1. split it into 2 halves.
2. Add filler pieces
3. Then you can stack because of the filler pieces.
4. Cut away the filler pieces.
5. Stack the 2 halves

Some shapes require splitting into the 2 halves left and right. Others will require top and bottom halves. Sometimes layers 1 and 2 might have to be split top and bottom and layers 3 and 4 will have to be split left right.

Remember that after cutting the filler pieces any empty layers will be removed.

Halves may be required to be up to 4 layers tall.

**LIDS**

This shape is impossible because if you split it into 2 halves 1 half will not have a piece on the bottom layer.

This shape is possible because of the "lid". Halves have to be either connected to the ground or a lid. The lid attaches to both halves. And one half has to be touching the ground.

The ground could also just be another layer acting as a sort of bottom lid.

Stacking becomes more difficult when halves have empty layers. In the next example the left bottom layer is empty. Here you must stack the left half to the lid before the right half.

If instead if it was the upper left layer that was empty you would have to attach the right half to the lid first.

Shapes are impossible when empty half layers make it so a set of half layers can neither attach to the top or bottom lids.

## Other things

If you have trouble meeting the throughput demand in Freeplay, you can use a trick where you fill Storages and release them once you have enough to meet the throughput demands. For a more rewarding (or punishing?) experience consider not using this trick.

Many people apparently do things like color mixing in their machine. This is not advised as it will just mean you have to lay many base color lanes as opposed to just mixing the color at its source and then just lay a single lane. Less lanes means less clutter. The same advice is true for factories that produce a base shape from a composite shape. It's better to produce the shape at its source and then just lay a single lane, instead of getting an amount equal to less than a full belt of the resulting shape.

## Example Everything Machinez

https://shapezio.fandom.com/wiki/Example\_Everything\_Machines