
Reduce bouncing of items
BlayTheNinth opened this issue · 3 comments
"When using pipes to fill a (in this case) generator, after enough space for 1 charcoal opens up, the system sends multiple charcoal into the pipes. The remainder will bounce, going back to their origin."
I haven't had a look at the relocator grid code yet, but this is worth thinking of a solution for.
FWIW, Thermal Dynamics' Itemducts don't do this. It seems simple enough; check the capacity of the receiving inventory, then do MIN(stacksize, free space); where it gets tricky is with accounting for in-transit itemstacks. You'll want some caching, otherwise performance will be poor in larger networks.
Yea, I've tried to do this a while ago (maybe half a year), but I stumbled upon too many issues. Thermal Dynamics seems to have fairly good working system, although it's not perfect. AFAIK Thermal Dynamics isn't open source, so we can't just copy their way of doing this (would be preferable as it's a big mod and modders with inventory blocks will adjust to that).
In working with the crafting modules, I saw that items were being stuffed at both their source module and at the crafting module itself. This would often cause the whole system to lock up. I'm not sure why a crafting module would ever be the source for its ingredients re-entering the network, but that seemed to cause the bulk of the bouncing—and circling—I saw. I expected excess ingredients to only bounce back to their original extractor modules.
If they would always go back to where they first entered the network, then the existing controls already on the extractor modules are probably the best solution to control bouncing. They let the end user choose to prioritize speed (large stacks with small delays) or low bounce rates (small stacks with large delays). The only improvement I can think of would be config options to limit the ranges for thos settings. That way a server owner could set the minimum pause to, say, 40 ticks and the max stack size to 4. That would effectively eliminate bouncing—albeit in a rather draconian way. :)