Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Sorters in vanilla

Discussion in 'Gameplay Help' started by Feddas, Sep 9, 2019.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Feddas Trainee Engineer

    Messages:
    6
    I'm trying to set up an official server friendly station that automatically pulls inventory from any other inventory block. After reading https://forum.keenswh.com/threads/c...ity-should-be-higher-than-assemblers.7399241/ I found that a sorter blocks pull and push into inventories that are the fewest conveyor blocks away. This was awesome to find as it meant I might be able to do sorting without scripting (something close-ish to [TIM] ).

    I could set it up so that the destination inventory is as close as possible on the output side and that same destination inventory is father than any other inventory on the input side, the sorter should pull from every other block on the grid first before getting into an infinite loop pulling from its destination inventory.

    This seemed to work well from the testing I did. However, when I added a connector things didn't work as expected. In this screen shot ( ) the lower left cargo container is meant to only hold components. So the sorter to its right has whitelist components and drain all. The ship connected on the right should have components drained from its cargo container that is only 2 blocks away from it's connector. Instead, the sorter is in an infinite loop pulling from its destination container. Any idea why?

    How are conveyor blocks counted? I was thinking a block like a refinery was counted for every square it had to go through, so a refinery could count for 1, 2, 4, or 5 conveyor blocks.
     
  2. mojomann71 Senior Engineer

    Messages:
    1,703
    Because you have it in a closed-loop. The large cargo container in the top left if you go down two conveyer blocks the same line your assembler is on the line continues on and drops down to the bottom sorter. (Hard to explain hopefully it makes sense.) I am surprised it worked the way you wanted before adding the connector.
     
  3. Feddas Trainee Engineer

    Messages:
    6
    Sorry mojomann, I don't quite understand. I appreciate the response tho! This system is supposed to be in a closed loop. Infinite pulls through the sorter are okay. The goal here is to be able to tell which inventories the sorter will pull from first.

    I removed the refinery and assembler to try to isolate the issue. Here is a picture with the expected pull priority of the sorter on the bottom.


    The numbers with an "i" to their right are inventory blocks. There should two extra numbers between 7 and 9 instead of one, opps. Otherwise no errors in the numbers. Some numbers aren't visible, such as 11i, which would be the connector on the station the ship is connected to. 11i is also the first block to get a pull from the sorter since it's the smallest number with an inventory. if it's doesn't have any items that match the sorter it's expected the next pull would be from 12i. All the way up to 18i. 18i is also the inventory blocks are put into, so items will infinitely be pulling out of and be put back into 18i.

    17i and 18i work great, clearing 17i out of all matching items first, then getting stuck in the infinite loop on 18i.

    13i and 14i are only pulled from if everything on the station grid doesn't satisfy the sorter. The numbering priority should still apply, but there must be something special with it being on a separate grid. 12i, which is the connector on the ship, does seem to have the correct priority some of the time. For example if the stations connector is moved up one block to connect to the other conveyor junction (making it become 11i), it seems to pull ore correctly.
     
  4. Malware Master Engineer

    Messages:
    9,549
    @Feddas I'm sorry, infinite pulls through the sorter is never ok and has a significant performance impact. If you use this kind of method on a server its admin will be... less than happy :p

    Besides, you'll never get the sorter to work well if it is capable of pulling in a circle.
     
    • Agree Agree x 1
  5. mojomann71 Senior Engineer

    Messages:
    1,703
    @Feddas there is a better way to pipe in what you want not using a closed loop. If I have time I will see what I can do and share a picture. No promise it will be soon, real-life is kind of chaos driven as of late.
     
  6. Feddas Trainee Engineer

    Messages:
    6
    Thanks guys for the insights!

    @mojomann71 I am curious what you come up with. I what something similar in functionality to TIM without scripting. This closed loop method is so close to working.

    @Malware Good point, maybe being able to infinite loop closed loop sorters should be reported as a bug instead. If a sorters destination inventory is the same as the inventory it's pulling from, cancel the pull and turn the sorter off until the grids inventory is dirty. Other than that probable bug, this sorter works awesome, I can put ore in any inventory on that grid that is less than 18i away from the sorter and it'll be put into the correct cargo container. I couldn't think of another way a sorter can sort the entire grid (hopefully @mojomann71 knows something I don't). If you use linear sorters you have to make sure everyone in your faction puts things into the correct inventory tier, AKA, there is still some manual sorting.
     
Thread Status:
This last post in this thread was made more than 31 days old.