Allow connected tanks
codetaylor opened this issue ยท 3 comments
This is a continuation of the tank enhancements being discussed here: #95 (comment)
Maybe allow the tanks to combine their inventories when touching each other? That way you could have barrels have a similar inventory size, but the main draw of the tanks is that you can turn them into a multiblock style big tank, which could help with automation (especially if you add something like a faucet to allow automated fluid removal).
From a design perspective, I like this. It would increase the usefulness of the tanks further into the game, probably more so in an environment with other mods. In a stand-alone context, the large tank could still be useful, but not as much as the player would have to bucket fluids in to fill it.
The existing Stone Drain and Refractory Drain could be extended to also drain fluids from tanks. You could then place the drain down in front of the bottom of the mega tank.
One way to implement this would be to just have the existing tanks move their fluids down and horizontally. This would work, but it might look bad or perform poorly.
Another way might be to implement it as a multiblock. You'd form the tank structure, then use a hammer or empty hand or something on it to turn it into a multiblock tank with connected textures and a single rendered fluid.
I did a quick and dirty test of the first implementation idea: https://streamable.com/udr5n
My initial thoughts are it works ok, but has some quirks. Fluid dynamics aren't a thing.
And irregular shapes cause some tanks to come just 1 or 2 mb shy of full. This is most likely due to the quick and dirty test code. Tanks that were within 1mb of their neighbor were not allowed to move their fluid in order to prevent tanks from just pushing 1mb around forever.
Another thing to note about this implementation is that, without special handling, you can't add any fluid to a tank that is already full and have it go into other, less full tanks.
Also, fluids wont mix in the "greater tank", so it could be a pain if you accidentally get some of the wrong fluid in the "greater tank".
The cleaner option, the multiblock, might be a better choice.
"Another way might be to implement it as a multiblock."
You had me at "multiblock". My love for multiblocks is matched only by my hatred for GUIs.
I think the multiblock is the way forward here.
This is something that can be implemented sometime before #95, but it'll require some research because I've have yet to implement a real multiblock.
Some considerations for future work on this:
- investigate how to handle cases where the multiblock is on a chunk border?
- allow only rectangular multiblock shapes for best results with minimal connected texture pieces
- designate one tank as the multiblock master tank on creation