Refactoring the Code - Shapez 2 MAM Build EP04

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ก.ย. 2024
  • Before we continue to expand our MAM's capabilities, it's a good idea to clean it up. In this episode we centralise our MAM's signal reader, clean up the quarter cutter to shape selection section, tidy up the painter and rework the recombinator
    FULL PLAYLIST: • Shapez 2 - MaM Build
    BLUEPRINTS: drive.google.c...

ความคิดเห็น • 56

  • @DataEngineerPlays
    @DataEngineerPlays  20 วันที่ผ่านมา +9

    FYI I recorded this video like 4 hours before the 0.8 update. Next episode will be have to be a redesign of the adaptive painters with the new pipe gates. Was really hoping to get into pinning and crystalising... but alas...

    • @thearrogantone4756
      @thearrogantone4756 20 วันที่ผ่านมา

      I was curious how far in advance you record your videos lol

    • @DataEngineerPlays
      @DataEngineerPlays  20 วันที่ผ่านมา

      @@thearrogantone4756 Depends on my schedule, if I know I'll be busy, I might record 2-3 episodes ahead on the weekend. But I try get at least 1 ep out a day so I'm always at least 1 episode ahead

    • @aronmcsorley8833
      @aronmcsorley8833 7 วันที่ผ่านมา

      Alright videos great , very helpful, I have to keep changing some of my mam everything I change from single layer to multiple layers , tried following your vids but I think I'm doing something wrong lol , you said we can get your blueprints for free , how do I download them and how do I get them into my game please

  • @Vinxian1
    @Vinxian1 18 วันที่ผ่านมา +1

    Trains have the benefit of having a smaller footprint. They are fast enough that you can do your 4x4 of corner belts on a single rail with multiple trains instead of having 16 belts you need to route past

  • @yuriferes
    @yuriferes 20 วันที่ผ่านมา +1

    Great episode and even me, with 0 coding experience, I am learning a lot. I have played around with trains and you can definetly reduce a lot your belts with it as someone commented below. You just need to be aware that you need a buffer to receive the shapes/collors from the asteroids and a different train line for it to be distribuited. That way you will have saturated unloaders with much less belts.

    • @DataEngineerPlays
      @DataEngineerPlays  20 วันที่ผ่านมา

      Thanks! definitely plan to use trains soon, not gonna belt 4x what I'm belting now for my 4 layers...

  • @kensfer
    @kensfer 20 วันที่ผ่านมา +1

    The timelapses were a lot better with the music playing over them :)

  • @Obaker30
    @Obaker30 20 วันที่ผ่านมา

    for the stacker with the bypass a really simple way to do it is a 1 tile gap between 2 parallel belts with a reader on both belts facing the gap with an and gate between then into the belt filter w/ or w/o the not gate (at 47:30 don’t kill me if you did this after the timestamp)

    • @Obaker30
      @Obaker30 20 วันที่ผ่านมา

      i have now realised why you decided not to use the reader… 😅

  • @tuxino
    @tuxino 20 วันที่ผ่านมา +2

    You expressed a bit of regret because you had to make the combinator platforms be different. There's a simple way to get around it.
    Next to the combinator platforms, make small (they can probably be 1x1) platforms containing the actual logic, and have them communicate with signal hoppers over the gap using a common interface.
    Or to put it in coding language: instead of polymorphism and inheritance, think components. Use "has a" instead of "is a".

    • @DataEngineerPlays
      @DataEngineerPlays  20 วันที่ผ่านมา +1

      I love it, how you turned it back into OOP concepts. Very good idea.

    • @Pete107
      @Pete107 20 วันที่ผ่านมา

      That's the exact approach I took.
      Platform that provides the signals for each corner (and their color).
      Platform for flushing the system, after each stage which isn't essential.
      Platform for deciding if A and B should be stacked or continue on to the next stage.
      I've not done colors quite yet but it's the same principle as the stacking logic, although this will come much earlier in the system to reduce the painting that would be required for individual corner pieces alone, much better to paint the whole shape and then cut it down.

    • @oliver_twistor
      @oliver_twistor 19 วันที่ผ่านมา

      Neat idea!
      The last line is good advice in general. Use composition over inheritance. :)

  • @tuxino
    @tuxino 20 วันที่ผ่านมา +1

    Oh wow, I just got to the end of the video. The simulated stacker is hilariously accurate. Just like the "real" one, it will deadlock, when one of the inputs is empty.

  • @jamesjw0071
    @jamesjw0071 20 วันที่ผ่านมา +2

    Use trains, they transport quicker than belts or pipes. At the beginning of each machine have a check, is this the current shape I'm working on, if not discard it, this way you don't spend time making a shape once the shape has switched.
    The game needs to track how many wasted shaped or wrong shapes have been turned in, then the statistics will really get interesting.

    • @DataEngineerPlays
      @DataEngineerPlays  19 วันที่ผ่านมา

      A few people have suggested this "sanity check" feature to speed up the process when the milestone shape changes. I'll look into it!

  • @dreesedatalink
    @dreesedatalink 20 วันที่ผ่านมา

    to speed up what I have done so far I inserted in spots a "sanity check" that trashes anything that isn't the current shape throughout the MAM. seems to make the new shape quicker but may just be in my head i haven't timed it or anything. keep the episodes coming. and stop saying CABLE! 🙂

    • @Suckynewb
      @Suckynewb 20 วันที่ผ่านมา

      If you're delivering by train it does go quicker if you junk the wrong shapes, recently learned that they train loader can only load 1 shape type at a time so if you're delivering mismatched shapes the loader will flip-flop between the 2 and never actually fill.

  • @blockshift758
    @blockshift758 8 วันที่ผ่านมา

    1:06:30 a very strong blueprint

  • @SeanChitwood
    @SeanChitwood 20 วันที่ผ่านมา

    You keep using multiple rotators when you only need 1. A 180 rotator is 2x the counter-clockwise and the clockwise is 3x. Also, you can use a shape (complete with color) as part of your filter, so no comparison needed and you're unit-testing or asserting as you go.

    • @SeanChitwood
      @SeanChitwood 20 วันที่ผ่านมา

      Never mind, I just remembered there is only 1 signal rotator.

  • @ryan_neufeld
    @ryan_neufeld 16 วันที่ผ่านมา

    Rather than put in 4 separate shapes. Why not send in 4 belts of shapes that have one of each type in each corner. Then the splitter and selector modules can be combined into a single unit.
    So feed in SuCuRuWu and then each lane just needs to pick the correct corner.

  • @yuriferes
    @yuriferes 20 วันที่ผ่านมา

    Also, you could use pass through platforms for shapes and paint instead of hopping your belts. You could even cross over shapes and pain through the same 1x1 platform to make routing easier. I just don't know if the throughput would be the same.

  • @theinnocenttomato9836
    @theinnocenttomato9836 20 วันที่ผ่านมา

    You could setup trash cans on each platform that takes the current shape and reads the belt. Checks if the shape currently outputting is the right one if not drop it into a trash. Would clear out the whole system really quickly. Especially after completing a shape.

    • @DataEngineerPlays
      @DataEngineerPlays  20 วันที่ผ่านมา

      Yeah that's a cool concept. But does that actually speed things up? Because whether the belts flow into a bin or the vortex, either way its flowing at 100% speed every all the time anyway right?
      There's only 1 edge case where this is untrue which is when the shape changes from something that requires a bypass in the stacker, which is when the old shape would have 2 max capacity belts trying to merge into a single max capacity belt in the combinator

    • @jason221145
      @jason221145 20 วันที่ผ่านมา

      @@DataEngineerPlays with your swappers it was trying to squish 2 belts into one belt after it changed shapes and that did slow the whole thing down by a ton

    • @DataEngineerPlays
      @DataEngineerPlays  20 วันที่ผ่านมา

      @@jason221145 Yes that's the scenario I was talking about in my reply

    • @MisuVir
      @MisuVir 20 วันที่ผ่านมา

      Yep, that's basically what I've done with mine. After each big step, I have a platform that takes in the shape signal and does a sanity check. If the piece isn't what's expected, it gets voided. I've got these after the shape painting, after the shape cutting, after joining each half, after joining both halves, after stacking two layers, and finally after building the final shape. It does clear out the MAM quite quickly when changing shape now.

  • @oliver_twistor
    @oliver_twistor 19 วันที่ผ่านมา

    Great episode! The big question is, will your computer hold for the full final MAM while simultaneously recording? I guess we just have to wait and see how many frames per second/minute we get when everything is done. =D It's insane how many components that go into this thing. I noticed when you selected just a piece of the version of the MAM you have now, it read a couple of thousand space components.

    • @DataEngineerPlays
      @DataEngineerPlays  19 วันที่ผ่านมา +1

      yes and it takes like 5 seconds of lagging for my PC to figure out what I've copied/cut/deleted

  • @cuneytvural72
    @cuneytvural72 20 วันที่ผ่านมา

    An efficent MaM should not use space belts inside the MaM. Think about like you have inputs to MaM via space belts and output it with space belts to the loader. That means every platform has to be placed side by side and should have checkpoint for output so any wrong shape goes to the next side platform. Painting whole shape before cutting significantly increase MaM efficency . In order to do that you should create a logic at the start of the Mam to filter which shape that random milestone needs. So you only need to input 4 belts to MaM and only paint 4 belts per layer.
    In simple words, filter the whole shape at the start, next paint the shape before cutting and finally stack it. And make sure only needed pieces of shapes use the belts inside the MaM. I am getting full belt output for four layer shapes after switching to next milestone in 4-5 minutes.

    • @DataEngineerPlays
      @DataEngineerPlays  19 วันที่ผ่านมา

      great tip thank you, at the moment I'm still trying to figure out how to even build a working one, but will definitely optimize everything at the very end.

  • @txpstar
    @txpstar 20 วันที่ผ่านมา +1

    didn't start the game already but as a coder I can see a different approch of this. Wouln't it be easier to manage cabling/belting by using space belts to transfer all 4 shape at once? It would divide throuput by 4, but fixing it would just be a matter of stacking them and merging them. I think space belts ar 12 slots so that would be managable. This is just me thinking out loud but when i see the cable mess I immediatly think to switch to a more "bussy" paradigm

    • @kurama3563
      @kurama3563 20 วันที่ผ่านมา +1

      I tried doing my own MAM and i tried something similar to your idea. It's doable for sure, I'm using a single belt where on each lane is used for a corner a the final shape. The throuput can also be increased later if we use full shapes instead of quarter shapes, and only afterwards coloring and cutting them to match the right corner.

    • @txpstar
      @txpstar 20 วันที่ผ่านมา

      @@kurama3563 again I didn't play the game yet, not much time for that sadly. But i have the feeling that the whole process of the mam could be simplified (and become more "scale-ready") by designing some sort of multiplexer and demux tiles, I may be wrong and it may be not easier IRL than in my messed up brain

  • @Corvus007
    @Corvus007 20 วันที่ผ่านมา

    I believe we can play Doom on Shapez 2 this year

    • @DataEngineerPlays
      @DataEngineerPlays  19 วันที่ผ่านมา

      I'm waiting for someone to make shapez 1 in shapez 2

  • @blockshift758
    @blockshift758 8 วันที่ผ่านมา

    I didn't know if you have done it yet but i know people have been telling you do it. Paint before quarter. I saw you comment somewhere that it will need more intake of something but no. I don't think its more expensive.
    You will only need to paint 3 lanes of full shape. so you can make 4 smaller painters that only needs to paint 3 lanes worth of shapes for each quarter.
    Let me try explaining it this way:
    ➡️⬛⬛⬛⬛each of this box will give 3 lanes of whole shapes to brown
    ➡️🟫🟫🟫🟫Brown will choose shape
    ➡️🟥🟥🟥🟥Each of this will ask "is this does this need to be painted red?"if not bypass
    ➡️🟨🟨🟨🟨 "is this painted yellow?"if not bypass... Repeat fo all colors
    ....🟩🟩🟩🟩quarter(since youre only getting 3 lanes here it should output exactly 12 lanes)
    ....⬜⬜⬜⬜stackers
    ....⬜⬜⬜⬜Stackers
    This is the best i can explain
    ➡️Is input

    • @DataEngineerPlays
      @DataEngineerPlays  8 วันที่ผ่านมา

      @@blockshift758 great explanation. Yes we do figure this out a few eps into the series

    • @blockshift758
      @blockshift758 8 วันที่ผ่านมา

      @@DataEngineerPlays I just saw you realizing that in episode 5 🤣

  • @Dthehunter1
    @Dthehunter1 19 วันที่ผ่านมา

    The one thing im worried about in your idea atm is that if ya got to add multiple layers on the same figures with crystals. Since they break if ya cut them or let them drop from the top of a stacker. Im curious on how you'll handle that :)

    • @DataEngineerPlays
      @DataEngineerPlays  19 วันที่ผ่านมา

      we'll find out =P I've got some ideas in my head!

  • @theinnocenttomato9836
    @theinnocenttomato9836 20 วันที่ผ่านมา

    Trains for sure would help cause you could just use 1 track for each of the painter arrays. Or even just one track in general wih 4 trains running on it.

    • @DataEngineerPlays
      @DataEngineerPlays  20 วันที่ผ่านมา

      I will definitely need to incorporate trains at some point. I didn't like trains because for some reason my trains in my let's play always had gaps. I think I'll need to play with trains for a while to ensure a constant continuous stream of shapes

    • @theinnocenttomato9836
      @theinnocenttomato9836 20 วันที่ผ่านมา

      @@DataEngineerPlays the gaps are mostly cause by the belt lengths not being exactly same when you start filling the shape loader. With a mam you will be able to get 3 train containers backed up on the station. Especially useful for when you need more than one space belt worth of something. Or in the case of the fluids 7 of them which can just be a wagon each. Just would have to use the filler wagons to ensure the colors go to the right spots

    • @DataEngineerPlays
      @DataEngineerPlays  20 วันที่ผ่านมา

      @@theinnocenttomato9836 excellent, super great points, will use these tips in upcoming episodes!

  • @Ridgef
    @Ridgef 20 วันที่ผ่านมา

    This is just so d*** cool.

  • @DenHvideHund
    @DenHvideHund 20 วันที่ผ่านมา

    Let me just throw this one out, as I think you are looking at this entire MAM the wrong way.
    Your take on it is focused on reducing the belt length after picking the shape and most likely also after you have colored it. And your right, this is a priority, because your belts are getting "out of hand long".
    But what if you flipped it around. As you already said, which is right, the feeding belt-lenght doesn't matter, as they are always full anyway. So imagine that everything was already split and colored, before it's actually makes it into the start of the MAM. I know it would be a lot of belts, but this is where your would have trains, to reduce the belt spaghetti. So every quadrant in any possible color and uncoloured is made outside the MAM and fed into the MAM by trains. This could also be scaled up to work with pins and crystals.
    The MAM is then just a "pick my shape" and put it together.
    You could start easy with just all the shape possibilities, which would be 4 shapes in 8 different colors. But I hope it would make you think differently about the MAM and use it's potential where it makes sense and do "stupid" work outside, where it would only slow down the MAM.

    • @DataEngineerPlays
      @DataEngineerPlays  20 วันที่ผ่านมา

      I think that's how they did it in Shapez 1 right? They had 28 input belts every shape precolored in each color 4 shapes by 7 colors.

    • @DenHvideHund
      @DenHvideHund 20 วันที่ผ่านมา

      @@DataEngineerPlays correct. You could then have "selectors" to narrow the belting down a bit. So you feed in the precolored shapes in a select which goes through to the next phase, which for now would be the last phase.

    • @DataEngineerPlays
      @DataEngineerPlays  20 วันที่ผ่านมา

      @@DenHvideHund I've considered the approach, but I'm not sure its that easy for shapez 2 because the thought of finding 7 belts of each shape seems a bit daunting at this stage. And that's per layer. You'll end up need 28 belts of each shape for 4 layers!

    • @DenHvideHund
      @DenHvideHund 20 วันที่ผ่านมา

      @@DataEngineerPlays You don't need 7 belts of each shape. Your end product is still only one shape, so the need in the other end doesn't change.

  • @texnoti
    @texnoti 20 วันที่ผ่านมา

    Na, least favorite task is documentation...