Beltmatic

Beltmatic

View Stats:
Lord Balder Jul 12, 2024 @ 7:12am
Compact MAM Designs
Hi everyone,

as many of you, I also became addicted to this simple game and played a lot in the last few weeks. I played the normal way until I got all the achievements and then started creating my 24 bit binary number generators to make it to level 100. And since I enjoyed seeing how others did it, I also wanted to share my designs with you. :-)

Version 1.1 Binary Adder

The first design already shows the basic ideas that I had. I use belt priorities to switch number, so that there is no need to build / delete stuff after everything was finished. And I use a big line setup and feed it from both sides to create 24 numbers for every input of my hub. Using a symmetrical design on all 4 sides of the hub turned out to be too difficult to supply with numbers for me...

Version 1.2 Integrated Powers of 2

Supplying my number generator was the most annoying part since there were so many input lines on a relatively small area. Moving the exponentiators closer to the adders helped a little, but now I had to feed 48 supply lines into my main line for each single number, and that turned out to be also very chaotic...

Version 2 Shift Register

The next big step was reducing the required numbers and turning my pure adder into a shift register! Instead of adding different powers of 2, I simply multiply by 2 and add 1 if the bit is used. This design is very compact and the necessary numbers are all pretty close to the main line which I liked a lot!

Here are some more screenshots of the whole thing:
Overview Hub Infeed Zeros

Version 3.1 Fast Binary Adder

One thing I noticed on my way to level 100 was, that the shift register was pretty slow when changing from one number to another. It took 2min for the first new numbers to be calculated and a total of 8min until the belt was 100% saturated... So my last effort was increasing the speed. I moved back to pure adders, but arranged them in pairs to get kind of a binary tree, resulting in a logarithmic time complexity.

Compared to my previous design, I could skip the multiplyers because the powers of 2 were calculated outside my line, and then compress 32 additions into 5 additions for a single number which resulted in a much lower calculation time of only 30s for the first number and about 75s until a full belt!

I also switched from using belt priorities for setting up my numbers to simply adding / deleting bridges and then use bypass lines within the calculation in case there is only one summand for an addition. That makes it much easier to switch between numbers!

Version 3.2 Close Calculations of Powers of 2

That design was once again so compact that it was hard to add the necessary calculations for the needed powers of 2. So I managed to half the height and double the width to create just enough space to place the dividers directly next to my line.

I put in the effort and connected all the necessary numbers to that line which looks pretty chaotic but is just compact enough to fit into one screenshot!

Version 3.3 Fixed Belt Priorities

One thing I noticed after building that last monstrosity was that there were occasions where inconvenient bit combinations resulted in traffic jams within the calculation which were actually rather annoying to fix and continued to happen as the game started to run slower on my weak laptop... Looking for the cause revealed that numbers that exit a bridge always have low priority over numbers from a belt, and all of my previous designs had weak spots in that regard! So I did one final design where I fixed that issue!

Version 4 Combined Adding and Shifting

Another way to improve the speed of my original shift registers is to shift more than 1 bit at once. It has the advantage of introducing a little bit of parallelism from the fast binary adder to reduce the total calculation steps of a single number. In my example, I added up 2 bits and shifted them by 2 bits, which cut the amount of shifting operations in half and the total calculation time by almost half! It also distributed the required numbers from 24x1 and 23x2 to 12x1, 12x2 and 11x4 which might be easier to find around the hub.

Its also possible to add and shift more bits, but that requires increasingly higher numbers and stretches the line further. Just using 2 bits cut the height in half and kept the width almost the same which in total cut the area in half while also reducing the neccessary supply lines! Overall it looks much slimmer than my first layout. Here is the screenshot of the final machine.

So in total, I really enjoyed creating all those different designs and puzzleing how to do them in as little space as possible and without free spots in between! I hope I can amaze you with them at least a tiny bit. ;-)

Best regards, Balder
Last edited by Lord Balder; Nov 5, 2024 @ 2:57pm
< >
Showing 1-2 of 2 comments
Hefsgaard Jul 12, 2024 @ 11:13pm 
Very nice designs. I like the layouts a lot. Especialy the adderTrees.
Lord Balder Nov 5, 2024 @ 4:16pm 
Hi everyone,

its been a while since my last post. Originally, I just came back for a small improvement of one of my designs, but then that level 1000 post caught my attention and kept me busy for the last month. So I edited that design to my first post and will focus on the sequencer design here.

In case you did not see, IridiumMika created a machine that automatically switched between numbers after a given amount to automate not only the number generation but also the level progression! And my goal was to use some of his ideas and combine them with my own to create once again a nice and compact layout.

Sequencer

The first obstacle was finding a good way to switch between numbers. My main idea was using the output of an operator and block it once the amount of numbers has been reached. If the output is blocked it will no longer take inputs which will then continue to the next operator. For evaluation, I used dividers and their behavior of dividing by zero. In that case, I get 2 outputs: one that is counted and eventually blocked, and a second that continues to trigger divisions, whose value conveniently is also zero and thus can be done indefinitely. This allows me to release 30 single bits by one trigger bit.

The second obstacle was finding a good way to count numbers. In the end, I used the internal storage of operators. Each operator has a storage of 4 for each inputs and 2 for the output. And since the output consists of 2 inputs, that gives a total of 12 numbers. If I clear a block, that amount can be refilled and reactivates my trigger operator. For scaling, I chained my operators so that each output feeds 2 inputs, effectively doubling its value. So after 10 chained operators, it will take a total of 2^10 = 1024 inputs to get a single output. Together with the storage of 12 and the 24 lanes of the hub, I only need 12 chained operators to be able to set up numbers in a range up to 1 million!

For the MAM, I used my latest design: a combination of adding and shifting to get a compact size. Adding 4 bits and then shifting them by 4 appeared to be the best middle way between size and speed, and the required numbers were still very small. Only the 16 for shifting had to be calculated seperately.

Finally, for the duplication I used the approach of IridiumMika and set up dividers in a way to output two of the input values. To not exceed the maximum number value I limited myself to 30 bits and used the lower and upper half of my number for duplication. You cant use the original number right away because the calculation requires doubling the input bits and 31 bits are the maximum. To increase performance I did not combine both halfs after doubling but kept them seperated until I had 24 each and only combined them in the last step.

Here are some more detailed screenshots of my machine:
Infeed Collector MAM Duplicator Combiner

Sequencer with Zero Waste

Even though I really liked the design and handling, switching numbers was very messy! The single bits reached my MAM with different delays and the bypass funcionality caused calculations of lots of random numbers. In total I had about 10k numbers waste between two productions. I thought the main problem was the bypass function and replaced empty belts with zeros, but oh boy was I wrong! ^^

I did reduce the waste down to 3k, but the rest came from all the different operators and their internal storages, which got filled because of the different delays and then messed up the following numbers... The whole calculation itself also got streched out a lot so that the end of one number calculation was mixed with the beginning of the next number, even with a very long pause at the switch! So I began my long journey of putting evenly distributed inputs and outputs everywhere as well as extra storages to buffer the different delays.

It does not look so neat anymore but the results were truely impressive! An input stream of 30 values that was originally stretched to 80 is now stretched by only 1 or 2. And while even after 100 numbers the belt still used to have empty spaces in it, a full belt is now reached after like 5 numbers and in best cases even immediately!

The main layout is still the same, but here are the improvements I had to do:
Infeed Zero Generator MAM Duplicator Combiner

Single number MAM

Finally, I realized that I could use the 31st bit to alter the duplication calculation a little bit. I already converted the 2^15 for shifting into 8^5, but 6^6 works too since it uses part of the 31st bit and its numbers can be even closer to my machine! So I restarted a couple of times to find a map with a convenient distribution of numbers and built a single MAM based on duplication.

I think thats it for now and I can finally take a break. ;-)

Best regards, Balder
< >
Showing 1-2 of 2 comments
Per page: 1530 50