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.

Modify Conveyor Sorter Logic

Discussion in 'Suggestions and Feedback' started by Steelhelix, Nov 25, 2016.

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

    Messages:
    22
    Over-all Edit to better explain what I'm looking for. Also, I do not need suggestions on how to fix this with current in-game tools.

    TL;DR Sorters with the 'Drain All' option turned on should check to ensure that their source and destination are not the same container.

    The Problem and Example: Currently, I have been trying to setup a mostly automated sorting system that doesn't require a script, or a lot of timers, and a few buttons to control them. As things stand I have not been able to find a solution that doesn't involve the need for a simple loop detection/avoidance scheme in the Pull portion of the Sorters decision process.

    Here is a world that shows why a simple loop detection scheme is needed:
    http://steamcommunity.com/sharedfiles/filedetails/?id=806133451
    A picture can also be found at the end of this post.

    The issue can be found in the bottom connector of the green ship. It has 10k units of Steelplates that aren't being moved by the yellow connector facing the yellow container. It is a valid move and if you click/dragged the plates they would go. They are not moving because the yellow container is the closest source of components and it is also the closest destination.

    Possible Solution: When the sorter block gets ready to pull have it query for the two nearest valid sources of items and also the nearest valid destination. If the first valid source is the same as the destination then have it pull from the second source. I know for a fact that there would have to be more thought put into it, but that is the basis to hopefully fix the loop issue.

    [​IMG]
     
    Last edited: Nov 27, 2016
  2. Malware Master Engineer

    Messages:
    9,625
    That is easier said than done, since the tree can be quite extensive so searching it for a loop could take too much time. But if it can be done without causing a performance hit, then yes that would be nice.
     
  3. Steelhelix Trainee Engineer

    Messages:
    22
    I'm not really looking for the ability to look for and avoid a loop in the conveyors. I'm looking to have the sorter check that it isn't pulling from the same place it's about to put the item.

    Watching the sorter work I'm guessing that it works in two steps that don't talk with each other (Pulls a valid item to inventory and then pushes said item to the nearest valid container). What I'm asking is that before it generates the pull request, it tests what its push request would be and if they're the same then it moves to the next valid container.

    Edit to add: If I wanted to have the ability to avoid loops I would ask for either a check box that tells the sorter to not pull from/through other sorters, or a box that I can add/remove sorters from that the sorter would not pull from/through.
     
    Last edited: Nov 26, 2016
  4. Malware Master Engineer

    Messages:
    9,625
    But then you're adding an extra push request. And what should it do if the first target is the same? Then it has to go on. So yes, you're adding more scanning logic. More logic takes more time. :)

    Seeing if the target box is the same is checking for a loop...
     
  5. Steelhelix Trainee Engineer

    Messages:
    22
    Assuming the logic of the game allows it, I would write the code so that it queries for the two nearest valid sources and then if the first source is the same as the destination I would then pull from the second source.

    Ok fine I am asking for loop avoidance, but I feel like I'm asking for the simplest form of it.... I say to-may-to you say to-mah-to.... :D
     
  6. TheCursedJester Trainee Engineer

    Messages:
    68
    I would agree to this. After all there have been occasions where I want items pulled out a storage container but still loop back and be available to it again.
    ( i.e Assembling/Dissembling items )
    But! You can avoid this scenario with some clever tinkering, such as this loop:

    ...Start > [Cargo] > :Sorter:Ore+Ingots: > [Refinery] > :Sorter:Ingots: > [Assemblers] > :Sorter:Items: > Start...

    This way only items are kept in the cargo crate, ore stays in the Refineries and ingots in your assemblers.
    If you want to dissemble anything you add an assembler set to dissemble to your cargo, so when they're converted to Ingots they'll loop back around. You can also add crates inbetween these sorters to hold that specific item.

    That, or if you just want to move the same items between crates, have sorters hooked up to timer blocks in which activate/switch between themselves on a button press.

    [​IMG]
     
    Last edited: Nov 26, 2016
  7. Steelhelix Trainee Engineer

    Messages:
    22
    That isn't too bad, but I like to have access to everything from my landing pads. Here is a picture of the world I linked to help explain my issue. Currently I have Drain all turned on for the yellow sorter pointed at the yellow cargo container and due to the amount of ingots in the yellow cargo container the ingots in the green ship on the left isn't having its ingots moved to the yellow storage container.

    I'm trying to avoid having to use buttons and timers as I like to play with my friends online and I shouldn't have to setup a system that I have to leave an LCD around somewhere to explain how everything works. Also in that same vane I'm trying to avoid the use of PB's. Yes I am well aware of TIM and I'm always singing it's praises, but I shouldn't have to use it to keep my ores separated from ingots which are in turn separated from my components.

    [​IMG]
     
    Last edited: Nov 26, 2016
  8. TheCursedJester Trainee Engineer

    Messages:
    68
    Oh, so if I am understanding this correctly you just have a storage issue:
    I.e You can't pull into the yellow cargo because yellow cargo is full, so you create two cargos and try to loop between them to fill them up.

    In that case you would just have two cargo containers each with its own sorter. Then, to allow the ship access, just have a third which connects to everything you need (refineries, assemblers, etc), make sure its not set to 'DrainAll' and everything is whitelisted then lead it back to the ship's pipeline.

    Unfortunately you're not going to get away from buttons.
    I would just have a single panel with two buttons that turn off the sorters pulling from your ship and turns on the sorter allowing your ship access.

    [Group: Sorters pulling from ship] - :On/Off: - Button 1
    [Group: The sorter going to ship] - :On/Off: - Button 2


    Or hell! A simple timer block can make it switch over in one! - and you can put the panel on your ship's landing pad for quick access - can't get much more user friendly than that.

    TimerBlock commands:
    1. [Group: Sorters pulling from ship] - :On/Off:
    2. [Group: The sorter going to ship] - :On/Off:

    [TimerBlock] - :Activate: - Button 1


    I have a similar setup for my 'Grinder Bin' which pulls all the components from grinded ships into two stroages.
    All the ingots and ore goes through the system, to be refined and then stored for assembler use, while the items stay, either to be dissembled or sent off to a ship's inventory.

    [​IMG]
     
    Last edited: Nov 26, 2016
  9. Malware Master Engineer

    Messages:
    9,625
    Don't get me wrong. I'm not against the idea itself, on the contrary. You're not the first to ask for it.

    I'm simply pulling up possible reasons why it might not be easily solvable. :)
     
  10. Steelhelix Trainee Engineer

    Messages:
    22
    @TheCursedJester Thank you for your suggestions, but I don't need a solution that works inside of the current game logic. Again TIM is a wonderful script and I love it to pieces and use it every chance I get.

    @Malware Didn't think it would be easy. Just the simplest solution that allows for a mostly automated sorting system that didn't require a PB and still gave you access to everything with out timer blocks and buttons.

    Edit to Add: That isn't to say that buttons, timers, and sensors won't be needed, because they will be needed.
    --- Automerge ---
    So much for my idea being the simplest. I was thinking through the logic of what I described and I figured out that a loop would be caused if there were two or more valid containers and the first became full with valid items.

    I would love to have some form of loop discovery/avoidance built into how a sorter works but I'm thinking that it would either take a change to the available options in the sorters menu, or somehow making all sorters fully aware of the entire system and able to find and avoid loops.

    So I guess my next suggestion would be a check box that tells a sorter to not reach to or through other sorters. Another option would have two boxes similar to the black/white list, but instead the bottom box would list all of the sorters on grid and that any sorters put in the top box would be bypassed.
     
    Last edited: Nov 26, 2016
  11. kittle Senior Engineer

    Messages:
    1,086
    After reading this suggestion and comments, it seems a simple change to the overall request logic would solve a multitude of problems:

    When an engineer wants to move something into his OWN inventory, then the sorter logic should be ignored.

    If your trying to manually move items between containers, then all existing rules apply.
    Only when the destination is the engineer's personal inventory are the sorters bypassed.

    All the other issues with loops and how to move stuff from one place to another are "engineering problems" which is the core of this game.
     
  12. Steelhelix Trainee Engineer

    Messages:
    22
    I can see where you're coming from, but what is the limit? Are only sorters owned by yourself ignored? How about faction? Finally, neutral and red owned sorters?

    At the end of the day all of this post is about an Engineering issue.

    What I'm trying to work towards is semi-automated conveyor system that keeps stuff mostly put in the correct areas, but doesn't depend on Programing Blocks. Can I do that with current in game systems? I think so, but it's going to be complicated and I'm not sure how well I would be able talk my faction through its use. Which means it's basically useless.

    I feel a non-PB based system would be useful as the current scripts depend on the modification of the names of the container and a container that is set to 'use by all' can have its name changed and potentially mess the system up or allow theft of stuff in bases used for trading between factions .

    Let me get back from work and I'll see about putting together more of what I envision my change allowing.
     
Thread Status:
This last post in this thread was made more than 31 days old.