infinite loop with conveyor sorter
Summary
I've been playing space engineers for some time to better keep track of how many components I have, so I can more easily know when I need more. I've been using in-game scripts but these tend to be a bit of a performance hog. I finally got around to trying the conveyor sorter you added some time ago as a replacement for the in-game script method of putting all my components in specific storage and ran into an issue where the game creates in infinite loop. At this point, my only options are to either put up with the infinite loop and hope it doesn't cause issues or go back to using in-game scripts to handle sorting and put up with its impact on performance.
Issue History
To understand this issue, it's important that you understand where I'm coming from. When I first started playing space engineers there were several things I liked about the game but one feature which I consider critical and relevant to this issue is that no matter which storage you are at you can store and grab an item from anywhere within your base or connected ships. This allows for easier building and getting ready to go on a voyage so it's very important that I not lose this functionality.
The Sorter Block Issue
I've set up a conveyor system using conveyor sorter blocks and every time I run into an issue where some of one item in my storage leaves to be transferred and then comes back to the same storage because I intentionally gave the conveyor sorter only one place to go. This appears to be because of the way the conveyor sorter was designed to function and that the conveyor sorter has no knowledge of which storage block a given item came from or simply fails to use this to prevent this type of loop.
It looks to me as if the conveyor sorter block was designed with a primary focus on its ability to restrict the direction of traffic and give users greater control over where things can flow than its ability to ensure filtered items make it to any particular storage. In the current design, they seem to use as a source anything connected to the side the arrow on the conveyor sorter is not pointing to and as a destination anything on the opposite side of the conveyor sorter. That's what I would expect for a system with the goal of giving users control over the flow of traffic but working as intended here restricts the ability to both sort items to containers and take/deposit from anywhere from any cargo.
The Problem
The problem comes when you try and design a system with the following goals:
- The ability to access the contents of any storage from anywhere to both take and deposit items its critical and must not be lost.
- The primary goal of my use of the conveyor sorter is to ensure all components end up in specific storage.
For the second goal, there is no issue, the conveyor sorter handles this splendidly and I didn't notice any impact on performance when this was running.
The first goal however is a problem. In order to ensure that you can take items from the storage the components should go to, that target storage must be connected to the same storage you are pulling the items from. Effectively making the target storage also a source for pulling items from. This is what results in the infinite loop. I could of course remove the conveyor that allows the target storage to be a source to the conveyor sorter but not without preventing myself from taking any components from that storage. When getting ready to go on a voyage loading my ship with extra components and ore is certainly required so that's not an option with the above goals.
In this configuration with the target storage also a source for the conveyor sorter, the conveyor sorter does what its supposed to and all my filtered items end up in only my desired target storage however since the target storage is also a source some item in that storage is constantly leaving the target storage, passing through the conveyor sorter, and finally coming back to the storage it started from because I intentionally didn't give it any other place to go. In programming, infinite loops like this are typically bad and although in my small setup I didn't notice any impact from this, on much larger servers with more users I expect it would be an issue.
To help illustrate the setup i've used to generate this inifite loop see the attached SE-Sortmap2.png. Also allow me to describe a few things about this image to help you understand my setup:
- I've color coded each box to help make it easier to see which direction items can flow within the system, there is a key at the bottom.
- I've also included arrows on the lines connecting each type of block to show which direction if one-way and both directions where the conveyor sorter doesn't restrict me from passing two-way traffic.
- The color code for storage actually includes my refinery and assembler, I'm referring to anything with storage here, not specifically a storage block.
- The storage block I want my sorter block to place all items in is in the bottom row and named "component storage".
- There are six blocks with storage I want to be able to access items between, including the component storage, assembler, and refinery.
If you need anything else let me know, i'm happy to help.
Looks the same as https://support.keenswh.com/spaceengineers/pc/topic/turn-sorters-off-if-in-infinite-loop
Looks the same as https://support.keenswh.com/spaceengineers/pc/topic/turn-sorters-off-if-in-infinite-loop
and the same as this one https://support.keenswh.com/spaceengineers/pc/topic/1-189-041conveyor-sorters-pulling-against-their-flow
and the same as this one https://support.keenswh.com/spaceengineers/pc/topic/1-189-041conveyor-sorters-pulling-against-their-flow
Great detail of why this is an important feature! And I'm so very happy someone else actually thinks this is important enough to thumbs up my report (https://support.keenswh.com/spaceengineers/pc/topic/turn-sorters-off-if-in-infinite-loop)!
The SE-Sortmap2.png diagram does looks a little over complicated for what's needed to show the issue. It seems to show the use case of the bug being fixed. To reproduce the bug, I think just a sorter pushing into a cargo and also on a shared conveyer network shouldn't cause infinite loop. In other words, this diagram should result in the sorter doing nothing instead of an infinite loop. https://excalidraw.com/#json=5076470946856960,ns6rc2_pH5kWXgdv0mi-kw
Great detail of why this is an important feature! And I'm so very happy someone else actually thinks this is important enough to thumbs up my report (https://support.keenswh.com/spaceengineers/pc/topic/turn-sorters-off-if-in-infinite-loop)!
The SE-Sortmap2.png diagram does looks a little over complicated for what's needed to show the issue. It seems to show the use case of the bug being fixed. To reproduce the bug, I think just a sorter pushing into a cargo and also on a shared conveyer network shouldn't cause infinite loop. In other words, this diagram should result in the sorter doing nothing instead of an infinite loop. https://excalidraw.com/#json=5076470946856960,ns6rc2_pH5kWXgdv0mi-kw
After finding the issue I did realize that a much simpler setup could likely produce the problem but I went with this diagram because it uses a pretty standard setup to show why it's so important that the issue be fixed.
On Tue, Feb 9, 2021, 22:17 <support@keenswh.com> wrote:
After finding the issue I did realize that a much simpler setup could likely produce the problem but I went with this diagram because it uses a pretty standard setup to show why it's so important that the issue be fixed.
On Tue, Feb 9, 2021, 22:17 <support@keenswh.com> wrote:
With how old those posts were I wasn't sure how useful it would be to link them but I'm glad it ended up helping out.
On Wed, Mar 17, 2021, 09:27 <support@keenswh.com> wrote:
With how old those posts were I wasn't sure how useful it would be to link them but I'm glad it ended up helping out.
On Wed, Mar 17, 2021, 09:27 <support@keenswh.com> wrote:
Hello, everyone!
Thank you again for your report. I'm sorry to inform you, that according to our programmers this issue is too complicated and unfortunately cannot be fixed.
Kind regards,
Keen Software House
Hello, everyone!
Thank you again for your report. I'm sorry to inform you, that according to our programmers this issue is too complicated and unfortunately cannot be fixed.
Kind regards,
Keen Software House
Replies have been locked on this page!