[enhancement] Fluid pipes should pass through chunkloaded areas like the power pylons
thePalindrome opened this issue ยท 6 comments
I'd set up a fracking setup a little ways some 400m to avoid causing too much damage and making my base look ugly. While it seems to keep powered and loaded by itself (I presume it's chunkloading itself, and that the pylons either all load themselves, or have code to handle moving through unloaded areas based on cached network areas).
However, the oil pipe (not universal set to crude, the red stuff) doesn't make the distance. Basic experiments with lazyloading chunkloaders show that the endpoints are both loaded, but because the entire network isn't loaded all at once, it seems like crude oil won't move. This is just an issue to request that be changed/fixed/whatever.
The fluid net still uses the old code that checks each pipe block and its neighbors constantly, which obviously requires the chunks to be loaded. That will hopefully change soon since the new net code (power already has it) is way more performant and generally less hideous.
Although I'm not sure how the refinery can stay loaded on its own, since none of NTM's machines have any chunk loading abilities, and electricity pylons are expected to break off when unloaded, as the tile unloading code removes them from the network. I'm not entirely sure what's going on there, perhaps that last part about them leaving the net when unloaded is broken, since I never explicitly tested that part.
ChickenChunks could be useful in this.
on a sidenote; when I read this title, I thought it was gonna be like
"Tldr: make a fluid transportation thing that's like the pylons"
kind of funny that the tesseract or other things like it cant be used on HBM fluids and I think that's how it should stay, you want your fluids from long distances? Find another way XD
Exactly, so it'd be helpful for long pipelines to actually function despite minecraft's limitations
(even if the pylons not removing themselves from the network on unload is a bug, replicating that behavior for things like fluid pipes would be rather nice. You can get a lot done if you start managing your own network info and not entirely relying on chunk and block data to do that)
I finally know why unloaded tiles remain part of the network, I wrongly assumed that the invalidate
method that tiles use when they get removed (i.e. the block is removed) is also called when they are unloaded (which is what onChunkUnload
does), which means that networks are only dissolved (and subsequently re-created) when cable blocks are removed, but not when they are unloaded.
Due to the way the network works, adding cables or joining other networks should still keep the unloaded tiles (since the join operation is supposed to ignore invalidated ones - which they aren't), however removing cables will cause the network to dissolve, which can only be re-created by the update function of loaded tiles, effectively breaking the connection through unloaded chunks.
In order to make this accidental feature more useful and consistent, I'm planning on replacing the network's dissolution with a special re-evaluation function which should make the network itself create the resulting networks as it expires, which can also include the cached unloaded cable tiles.
As for fluids, I'll also be completely rewriting the fluid network code soon using the same approach as the power net code. I'm also aiming to make pipe blocks able to support multiple networks at once, allowing multi-channel pipes that can transport any number of fluids in a dingle block. There's also been the idea of pipelines which are functionally similar to electricity pylons going around, but I'm not making any promises right now.
Re-eval is now a proper feature which should be able to keep power networks connected even when cable blocks are removed. It hasn't been tested in multiplayer or through unloaded chunks yet, but the system works entirely using the cached cable instances, so whether they are loaded shouldn't matter. It's also pretty reliable so far, having it tested with power switches of different types, normal cables and all pylon types.