Unipipe


Linked pipes that fill or extract from a single globally (planet-wide or galaxy-wide) linked storage, one per fluid type. Set the fluid type in the GUI or automatically based on pipe connections and the contents will be shared among all other unipipes with that fluid type. Pairs well with Unichest mod and its included selection tool for setting fluid filters.

Content
a day ago
1.1 - 2.1
2.06K
Logistics Fluids Cheats

g Good luck with the update!

a month ago

LuaEntity::fluidbox has been retired in favor of interactions through LuaEntity so, big changes.

I'm working on a local copy but it's looking like a pretty big overhaul so far. Simpler in some ways, I think at least.

a month ago

I took an aborted crack at this. If you'd like, you can see my attempt on the github here https://github.com/mpcomplete/factorio-unipipe .

I had trouble getting fluid to actually flow at a reasonable rate, or at all in some cases. I ultimately gave up because I suspect the 2.1 fluidbox changes may be reverted, or further altered, and the mod API may change yet again. (And this mod is sadly not a priority for me atm.)

a month ago

Oof! Appreciated either way, zysnarch. Yeah, when I looked into it myself it's just the entire existing fluid API dumpstered it felt like. I hope it works out better for folks in the future, but every mod I'm involved with or just poking around in for fun has some issue or another with the way fluids and fluidboxes work right now.

Good luck with your other endeavors, we'll see where fluidboxes end up as 2.1 approaches release at the end of the summer.

2 days ago
(updated 2 days ago)

Zysnarch! Fantastic news for a problem that's bothered me (and possibly you!) for quite a long time: linked fluidbox throughput.

The throughput limitation, which was causing the linked pipes to move at only 400-600 fluid per second instead of 12,000 as they were capable of, has to do with the buffer size of the Unipipe fluidboxes themselves. Every tick, an attached tank or pump would stuff 20 fluid into the Unipipe Filler, and then it would be taken out of the Unipipe Extractor. I would have thought this would result in 60x20=1200 throughput, but I think order of operations or something might be cutting the speed to only every other tick: 600. Even if the entities themselves report that they can pump at 12,000 per second, the absolute size of the linked fluidbox was the limit. By increasing the size of the fluidboxes to 500, I was able to get it to transport hundreds of thousands of fluid in just a few seconds, at the max rated limit of 12,000/s. 500x30 = 15,000. May need to be increased a bit more if you want to support Quality unipipes.

Incidentally, after several days of reading the new Fluidbox APIs (and a bit of help from Copilot to correctly identify every outdated API call >_>) I've got a version working for 2.1. It may need some more extensive testing, but if it continues working as well as it is on my end, I'll do a PR on GitHub for it, I think.

2 days ago
(updated 2 days ago)

I think I see now what you mean about "at all in some cases." I think something weird is going on with filter setting. A manually placed Filler and Extracter set to "Crude Oil" don't seem to always connect correctly. If you copy and paste the filter from the Filler to the Extracter, it works fine though, so something screwy is going on on the back end, I think.

At least I'm making progress, hah!

Edit: Think I've figured that out too. The issue was that the hidden surface wasn't updating connections when manually setting a filter, but it would work just fine if you were copy-pasting that filter from somewhere else. Even if that somewhere else was a manually set filter, and you could then copy it straight back to the original manually set entity, it worked. Weird stuff, huh?

I thought it was an issue with GUI timing at first, where selecting the filter would close the filter-selection GUI and not send an event in time. Then I thought it might have been table identity comparison not recognizing that the filter had changed due to some weirdness with the new fluidbox API. Uh... I still don't know which of those two it was, but while screwing with it, it started working perfectly exactly as expected, and neither one represents a regression, so I'm just going to leave it at that. It's a lot less kludgy than the first fix I tried which was trying to force the network to update itself every 120 ticks which... sort of broke every single filter on every unipipe in the game every two seconds lmao.

2 days ago

Pull Request submitted after about three weeks of learning more Lua and a final night of great progress. Feel free to message me there, here, or on Discord. I'm off to get some dinner... I mean breakfast... I mean lunch. Yeesh!

a day ago

Awesome. Thanks so much for doing the work. I made a few comments on your PR. With those fixed, it should be ready for a new release.

New response