[0.16.51] [Modded] No valid tiles to place "dropped items" causes lockup
Posted: Mon Jan 07, 2019 12:26 am
Modded game disclosure - example used is with the Factorissimo and warehouse mods for convenience, though it can be accomplished with nothing but Factorissimo or some other mod that creates a worldspace with a limited valid tile area.
What I did - entered a Factorissimo factory, and then replaced a full logistics warehouse with a provider warehouse (providers can be replaced but have lower capacity (similar to in-place replacement of chest types, where replacement drops extra items))
What actually happened - the game locked up before the frame the chest would be replaced on.
What I expected to happen - when in a Factorissimo factory (or any other limited-area worldspace) the attempted dropping of items does not lock up the game if there is not room for them to drop - instead the attempted action that would lock up the game fails, perhaps after a timeout.
Why I think the issue is occurring (without source access) - I suspect this is due to the game iterating over all possible tiles in the game in an attempt to find somewhere to drop the items, which is impossible since a Factorissimo factory is surrounded by void tiles.
I acknowledge that trying to prevent the impossible placement of items might be architecturally impossible due to lacking a way to bail out of a quick replacement, or armor removal, etc., as well as not having a perfect oracle that can predict whether there will ever be space to drop items if it is iterated enough. I just wanted to put this up here in case someone has a brilliant idea that can solve the problem. Modded issue only, so likely not a high priority. If anyone at Wube is interested in fixing this PM me or leave a comment here and I'll try to produce a test case that requires as few mods as possible.
What I did - entered a Factorissimo factory, and then replaced a full logistics warehouse with a provider warehouse (providers can be replaced but have lower capacity (similar to in-place replacement of chest types, where replacement drops extra items))
What actually happened - the game locked up before the frame the chest would be replaced on.
What I expected to happen - when in a Factorissimo factory (or any other limited-area worldspace) the attempted dropping of items does not lock up the game if there is not room for them to drop - instead the attempted action that would lock up the game fails, perhaps after a timeout.
Why I think the issue is occurring (without source access) - I suspect this is due to the game iterating over all possible tiles in the game in an attempt to find somewhere to drop the items, which is impossible since a Factorissimo factory is surrounded by void tiles.
I acknowledge that trying to prevent the impossible placement of items might be architecturally impossible due to lacking a way to bail out of a quick replacement, or armor removal, etc., as well as not having a perfect oracle that can predict whether there will ever be space to drop items if it is iterated enough. I just wanted to put this up here in case someone has a brilliant idea that can solve the problem. Modded issue only, so likely not a high priority. If anyone at Wube is interested in fixing this PM me or leave a comment here and I'll try to produce a test case that requires as few mods as possible.