CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.1k stars 4.1k forks source link

Piping systems #72571

Closed PGR-14 closed 3 months ago

PGR-14 commented 5 months ago

Is your feature request related to a problem? Please describe.

A character could probably fit some pipes together for a water system, for bases, it'd be extremely useful.

Solution you would like.

Add: -Water Collectors -Pipelines (Could use similar code as the appliances? Might be too different) -Pump (Either manual, or maybe an electrical version) -Make sinks, showers, & toilets(?) "appliances"? (Source for water) -Water heaters functional (I think the ones in-game are gas powered? There should be an electric variant) -Hot showers? (Big morale bonus) Edit: -Make those water tankers also work as a storage solution -Pipelines would make pipes & pipe fittings more useful

Describe alternatives you have considered.

Maybe an entirely different system to do this

Additional context

No response

PatrikLundell commented 5 months ago

It would probably be a major undertaking, similar in scope to appliances and wiring.

In fact, you'd probably have to solve the problem appliances avoided when they became pseudo vehicles: How to have multiple "thingies" be present in the same tile concurrently and remain distinct (i.e. no accidental merging).

I'm not saying it's a bad idea, just that it seems rather difficult to implement.

Also, I think you mean plumbing rather than pipelines, as I assume you're not talking about shifting large volumes of stuff through meter wide pipes, but rather (mostly) indoor plumbing.

PGR-14 commented 5 months ago

It would probably be a major undertaking, similar in scope to appliances and wiring.

The outline's already there, so it wouldn't be as much of one, but still hard.

  • You'd have to figure out how to keep track of the piping, including the parts outside of the reality bubble when coming and going.

That's already a problem, so we'll assume all pipes that don't connect to anything are capped off, & any adjacent pipes next to it are connected

  • You'd have to keep track of sources (providing fluid), pressure (to make sure there is a flow in the right direction only).

We could assume that it's flowing in the right way (Like electricity)

  • You'd have to deal with sinks (where water disappear to), or otherwise handle the spreading of water. You may actually have to handle spreading of water from leaks (Yay! filling your basement by accident!).

That could happen, so let's introduce something like Teflon tape into the pipe recipe (Duct tape could work too)

  • You'd also have to figure out how to cross pipes in a world where you can have at most one of most things in any one location (such a wall segment) so you get the right stuff when you turn on your tap (you probably don't want the dairy farming operation milk to pop out in your shower).

It works already w/ the "reveal wall wirings, so why couldn't we reveal pipes?" Also, w/ the milk stuff, that could be implemented later, right now we should be concerned w/ just water

In fact, you'd probably have to solve the problem appliances avoided when they became pseudo vehicles: How to have multiple "thingies" be present in the same tile concurrently and remain distinct (i.e. no accidental merging).

You mind elaborating a bit? I'm a bit confused by what you mean

I'm not saying it's a bad idea, just that it seems rather difficult to implement.

It is, but also pretty worthwhile

Also, I think you mean plumbing rather than pipelines, as I assume you're not talking about shifting large volumes of stuff through meter wide pipes, but rather (mostly) indoor plumbing.

Yeah, that's what I mean

PatrikLundell commented 5 months ago

The current appliance grid doesn't have any flow direction. If the network reaches a point it can flow there. That's unlike water which can't flow against gravity (which doesn't affect electricity), and where you should have definite sources and sinks (electrical batteries are both, in contrast).

When talking about leaks I was thinking more in the line of something smashing the wall the pipe goes through. I guess you could have magic self closing pipes on both sides, though.

No, "reveal wiring" plucks "the" grid out of the wall and then magically hooks all of it up in all directions. It does not deal with crossing wiring because that's hand waved away and isn't particularly important for appliances. However, appliances already take up the "vehicle" spot in the wall.

"Just water"? So you'd have to select whether you should use "water" or "clean water" (or "salt water" or "murky water", but I don't think there are many takers for those). Once you've made your choice you're stuck with it, and something bad probably happens when plumbing of different kinds of water meet on expansion of one of them. Given that you already have the issue, it's probably better to try to solve the issue for all liquids (and possibly liquid like stuff like propane).

Thingie elaboration: The current appliance implementation postponed the big problem of actually solving the underlying issue by inventing "appliances" which are technically an abuse of the vehicle system, so each part in the appliance network is technically a vehicle, and there can only be a single vehicle on a tile at a time. "Real" vehicles can have multiple parts on a single tile, but appliances can only have one, namely the appliance itself. If you wanted to have multiple layers of appliance infrastructure on the same tile you'd either have to figure out how to create a set of multi part "appliances" for the infrastructure to handle both an electric network (or why not multiple when dealing with the problem) and multiple plumbing networks through the same tile, or how to introduce a new fluid infrastructure. Also note that the electrical appliance network skirts problematic tiles such as doors and windows by allowing you to set up magical electric teleportation points via extension cords. Teleporting water pipes would be harder (could still be solved by solving the problem of making "vehicles" that do not collide with vehicles running into them (e.g. a shopping cart run through a door that has a pipe fitted under the floor or in the ceiling)). However, vehicles currently can't coexist (you can see the mess resulting from them trying if you deal with wrecks and the magically appearing and disappearing vehicle parts there).

PGR-14 commented 5 months ago

For the wall wiring thing, I was confused w/ what you meant by crossing over, & thought you meant like a cross pipe (Going in 4 directions) We could probably solve this in 3 ways: Put in different variants, made w/ a menu? For instance N&S pipe over E&W pipe Ignore the problem entirely & not allow for that to happen. Allow 2 different appliances to be on top of eachother using a flag. (Would have the possibility to add stuff like wall lights, a microwave, & a table on the same spot, while a Fridge can't have anything w/ it).

If we want it to flow up a Z-level, we could add a pump, so that the water pressure can allow it to go through

W/ the water one, I think you could hook up 2 different pipelines for both (Perhaps you could offshoot regular water to go through a filter, then going into a new pipeline?) Here's a diagram: = is pipe F = Filter Z = electricity W = Water (Label) C = Clean water (Label) [] = tank _ = ignore

Z Z []==F==[] WW CCC

Here, unclean water from the right is put through the filter, where using electricity, it turns it into clean water (The pipes would be technically disconnected & part of different water grids, where the water filter deletes the water (At a certain rate), & when deleted, fills the other pipe w/ the same units of clean water while removing some electricity)

A lot of these problems seem way too complex for me to solve, or where to even start. W/ the appliance network, maybe we could add in a wall w/ socket & all sockets in a building could be connected? (Maybe all of them in an overmap tile, but this'd cause some problems for multi-tile buildings) Allowing you to plug in devices from it, & put in less emphasis on having 38 extension cords to wire 3 things that aren't adjacent.

PatrikLundell commented 5 months ago

Allowing multiple "vehicles" share the same tile is not a trivial problem. The underlying data structure allows for a single entry, and queries after what "vehicle" there is in a tile does not allow for the return of a list.

Your filtration relies on a number of assumptions:

It is a big, non trivial task, which is a reason nobody has done it yet. After all, appliances are still not completely stable.

Maddremor commented 5 months ago

This is one of those suggestions that sounds good, but aren't really actionable within the scope of developing the game. I think it would be far easier and relevant to just assume that people are hauling buckets/cans of water to fill elevated tanks on any setup that needs it.

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.