Pipe categories for allowed neighbor-pipes

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Honktown
Smart Inserter
Smart Inserter
Posts: 1026
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Pipe categories for allowed neighbor-pipes

Post by Honktown »

(did a brief search and couldn't find a similar topic)

The idea: certain pipe connections can only connect to other pipes.

The goal: allowing pipe restrictions for a fluid. This idea would also allow a mod to pipe-weave if multiple / compatible categorization were implemented.

An example implementation:
1) a new prototype of "pipe-category", the initial category being "default"
2) a fluidbox could have a new value for a pipe_category, or preferably, a table of pipe_categories, with the default being {"default"}

Game behavior:
A fluidbox connection only is established when a category of fluidbox A matches a category of fluidbox B. *on placement* is essential here, as this has no continuous runtime overhead, compared to how fluid filters would be tested every tick.

How fluid restriction benefits:
A fluidbox *of an entity* can be marked for only compatibility with category "super-dangerous-nuclear-fluid". Now, the fluid is generated in the fluidbox, and so must only flow in adjacent pipes which were tested on placement to be compatible. If no other plumbing shares "super-dangerous-nuclear-fluid", the super-dangerous-nuclear-pipes carry the fluid (and *only* from fluidboxes that make or consume that fluid). This allows an efficient means of filtering, both by permission and restriction, of fluids carried in this pipe system.

How pipe weaving could work, with compatibility for normal pipes:
1) Pipe A and pipe B carry different fluids, and are of default category.
2) An "adapter" pipe entity has categories default and "cat1", and another has default and "cat2"
3) A pipe which *only* has cat1 can now connect to the "adapter" pipe, and further connections, whether underground or above-ground, must have at least cat1. This is similar for a pipe of cat2. cat1 and cat2 underground pipes now can be lined up together, and an adapter back to a "default", or fluidbox compatible with "cat1", can receive the fluid.

Considerations:
I only just thought about how underground pipes get drawn, and if done for consistency, plumbing would need to check for compatible categories and pass-over eligible nearest-connections and keep going backwards. This doesn't feel too restrictive, but if not considered, rendering would show pipes being compatible when they were not...
I have mods! I guess!
Link

Honktown
Smart Inserter
Smart Inserter
Posts: 1026
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: Pipe categories for allowed neighbor-pipes

Post by Honktown »

pipe could be replaced with "fluidbox" in some of the early "pipe"s. I was thinking on the pipe connection definition level, but then realized it would be easier on the fluidbox concept level. It could be implemented, pipe connection wise.
I have mods! I guess!
Link

Post Reply

Return to “Modding interface requests”