Different pipes for different fluids

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1197
Joined: Wed May 18, 2016 4:55 pm
Contact:

Different pipes for different fluids

Post by Mooncat »

Concept:
Implement a way for separating fluids into groups, and entities with fluidboxes can only handle fluids in certain groups.
Also a way to replace "Temperature" by other strings, like "Pressure", "RPM", "Torque", etc. (Suggested by YuokiTani here)

Details:
I am thinking about something like recipe-category, which separate recipes into groups, and each type of assembling machine can only handle some of the categories. My idea will also work in the same way, but mainly for pipes and storage tanks instead of assembling machines.

2 new types of category will be involved: fluid-category and fluidbox-category.

Each fluid prototype should have one fluid-category. It can be just a string. For example, in the fluid prototype:

Code: Select all

{
    type = "fluid",
    ... same as usual ...

    -- Name of the fluid-category this fluid belongs to.
    category = "normal-fluid-category",

    -- As suggested by YuokiTani, I have thought a way to replace "Temperature"
    -- This is the locale key. For example, this can be "pressure", "rpm", "torque", etc.
    localised_temperature = {"temperature"}
},
And then, in the entity prototypes, each fluidbox can have zero or one fluidbox-category. It will be weird if the entity can accept water or produce water but its fluidbox cannot accept it. That's why fluidbox can have no category, i.e. it accepts fluids in all categories.
The structure of a fluidbox-category:

Code: Select all

{
    type = "fluidbox-category",

    -- Name of this fluidbox-category.
    name = "normal-fluidbox-category",

    -- Table of fluid-categories that this fluidbox-category can handle.
    -- If no fluidbox-category is defined in prototype, the fluidbox can handle all fluid-categories.
    fluid_categories = {"normal-fluid-category", "whatever-fluid-category"},

    -- Table of fluidbox-categories that can be connected with this category.
    -- It is fine if the another-fluidbox-category doesn't have this category in its connect_with. They will still be connectable. Maybe another file for defining this?
    -- If no fluidbox-category is defined in prototype, the fluidbox can connect with all other fluidbox-categories.
    connect_with = {"another-fluidbox-category"}
}
And in the entity prototype, just add the fluidbox-category into its fluidbox(es).

How it will work:
  • Fluidboxes in different entities, like pipes and storage tanks, can only connect with each other according to the connect_with property in their categories.
  • Connected fluidboxes don't necessarily need to be able to handle the same set of fluid-categories. For example, Pipe A can handle FluidCatA, FluidCatB, FluidCatC, Pipe B can handle FluidCatC, FluidCatD. Pipe A and Pipe B can still be connected so the fluids in FluidCatC can flow through them.
  • If a fluidbox cannot handle certain fluids, it simply blocks the fluids from flowing into it. Or, more interestingly, the entity will be damaged and eventually destroyed if the fluids are in a connected fluidbox. For example, if Pipe A contains a fluid in FluidCatA, the fluid cannot flow into Pipe B.
  • When a fluidbox contains a type of fluid, its tooltip will show the correct unit according to its localised_temperature instead of "Temperature".
What this can bring us:
  • Better hydromechanic power control in Yuoki Industries. I got this idea initially when I first saw its blue shaft and red shaft. According to Yuoki, blue shafts are supposed to use for transmitting hydromechanic power in low rpm/torque/pressure and red shafts are for high rpm/torque/pressure. But due to the absence of pipe-vs-fluid restriction, people can use and are using the generic pipes to do that.
  • The most powerful creation will be Pneumatic Tubes. Imagine when this is properly implemented in PipeEverything, only Pneumatic Tubes (pipes) can handle the liquefied items. :P
Thanks for reading. The idea is not very refined. Feel free to give feedback. ;)
Post Reply

Return to “Ideas and Suggestions”