Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up water purification #72

Open
kevingranade opened this issue Feb 18, 2013 · 23 comments
Open

Clean up water purification #72

kevingranade opened this issue Feb 18, 2013 · 23 comments
Labels
<Enhancement / Feature> New features, or enhancements on existing (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@kevingranade
Copy link
Member

For something that's pretty central to survival, water purification is quite haphazard.

Some cleanups we can do:

  1. Differentiate between clear (but possibly contaminated), cloudy (obviously dirty), and tainted (from a very dangerous source) water.
  2. Differentiate between biological and chemical contamination. (internally, this will not be player-visible without a test)
  3. Carry contamination across recipes as called for.
  4. Differentiate between sterilized (boiled/chemically treated, not that tasty) and filtered/distilled water (very clean).

To be more concrete, I'm proposing:
New Items:
cloudy water (obviously dirty, probably unsafe, from rivers)
toxic water (obviously dirty water from an obviously dangerous source)
sterilized water (flat or chemical-tasting water, biologically safe, output of boiling or chemical purification, lower morale boost than clean water)
water test kit (item used to detect chemical contamination in water)
New item attributes:
bio_contamination
chem_contamination
Code changes:
Enhancing recipe code to copy contamination from inputs to output
Enhance recipes to indicate whether they transfer contamination
Item changes:
Let iodine be used to sterilize (percent chance?) water.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@KA101
Copy link
Contributor

KA101 commented Dec 7, 2013

If water from the same source (river/lake/etc) retains the same cleanliness, etc when I get more of it later, then yeah, this sounds interesting. Nontrivial chance for tedium though, I'm thinking?

@illi-kun
Copy link
Contributor

This issue was closed as it appears inactive.

Reducing open issues to those which are (or will) be actively worked upon helps us focus our efforts. This issue has not been deleted - it still appears in searches and if it contains relevant information you are encouraged to continue to link to it.

If this issue was a bug

It should be reopened if it can be reproduced in the current build. You can obtain the most recent copy here. Please check there is not a more recent report of this bug before doing so. If no more recent report exists you should continue the discussion in this issue.

If this was a feature request

If the consensus was that the idea was good you could consider submitting an implementation via a PR. If you want to comment further please do so here as opposed to opening a new issue. Before posting check nobody has already made the same point and consider whether your comments are likely to lead to an implementation. If you have doubts about either consider instead voting for the issue

If you want to work on this issue

Then either assign it to yourself or if you are unable to do so claim it via adding a comment. Please don't assign others or make a general request for action.

@MrHrulgin
Copy link
Contributor

MrHrulgin commented May 15, 2019

Here's my take on water and its sources:

  1. Terrain: Fresh shallow and deep water in flowing and still versions, shallow and deep salt water as well as pool water and sewage.
    a. Still water would be clear by default. Unless there's a current to keep it moving solid particles would drop to the bottom and even sewage would settle out within a few days of the sewer system ceasing to function. This would have no effect on its potability.
    b. Flowing water would be cloudy, but not inherently any more unsafe than still water in the region. How to model that variation in potability effectively is an open question, discussed below.
  2. Water from pre-cataclysm municipal sources (currently hot water heaters and toilets). Clean and clear, though potentially dropping in safety over time if water contamination is modeled.
  3. Water from wells, shallow and deep. Presumably water heaters and toilets in more remote houses and locations would also be from local wells. Of variable safety depending on local groundwater.
  4. Water that is visibly off or definitely tainted. Pools of water in gutters with a sheen of oil, toilet tanks with brightly colored toilet bowl cleaner pucks, water from swimming pools etc. Possibly water flowing from pipes like you can see at homeless encampments. This water would not be made potable by boiling, as these contaminants wouldn't be neutralized by heat. Possibly a more advanced water filtration system would be able to deal with this stuff.

Questions:

  1. How to test water safety? Many minerals or pollutants will change the water quality in ways that are easily noticed ( taste, color, odor and staining of fixtures). This can affect all of the types of terrain as well as wells, and should be very visible to the player once they're looking at it. Some of this water, while having alarming characteristics, is still safe to drink. (Or, in extremis, having deleterious health effects that are much longer-term than dehydration.) I haven't found anything online that shows how to make your own kits that test for potability, so they're single use and pretty irreplaceable?
  2. How to model water safety? Water flows the entire length of the Mississippi in 90 days, so within a few months pollution from industrial sources would have gone into the ocean or terminal lake, but in that same timeframe you'd see new issues from lack of maintenance on those same industrial systems. Is it possible to affect groundwater quality based on distance from special locations? The groundwater will be worse next to a dairy farm than it will far away from human construction. Presumably there would be a groundwater safety quality and a flowing water safety quality, and the sum of the two is how dangerous the rivers are to drink? There's some work being done on lakes and rivers; possibly model groundwater boundaries based on that system? Depending on the complexity of the groundwater modeling, there could be significant amounts of useful trace minerals in the water.
  3. Longer term water storage: should water in unsealed containers become contaminated? Water in toilet tanks and water heaters that might be good in the first few weeks may not be good indefinitely, and water that's boiled and poured into an open tin can on the counter will not stay good for long. This opens up possibilities for preserving water sources much like other foods are preserved. You shouldn't expect to boil 60L of water, leave it sitting by your stove and then come back in a month and find it fine.

I agree with the types of water laid out by Kevin. There's been recent upgrades to recipes to track calories from the base ingredients and will carry the (rotten) effect across; will that system work for water contamination? (See here) Will the types of contamination have different effects? Requiring different purification types? I don't know if there were as many options for water purification when Kevin proposed this. As it stands, boiling, the water purification tablets, charcoal water filter and the electronic water filter all would deal with biological contaminants, but only a distillation system like a still or a solar distiller would consistently separate the chemical contaminants from polluted water. Some chemicals have a lower boiling point than water, so even those wouldn't be removed IRL, but we might handwave that issue.

@kevingranade
Copy link
Member Author

This issue has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/why-are-swamps-in-this-game-filled-with-salt-water/25349/6

@I-am-Erk
Copy link
Member

I-am-Erk commented Dec 11, 2021

There's really no reason not to implement this now, it should be pretty trivial (to start on the framework, at least)

@I-am-Erk
Copy link
Member

I was requested to add some implementation details here, so here are some general thoughts. Let me know here or on discord if you're interested and want more implementation talk.

  • water could use the item fault system to track purity.
  • there are three major contamination types for water that we could track. Two are fundamental, one is hard. The fundamental ones are "particulate" and "biological", the tricky one is "soluble".
  • particulate contaminants make it hard to clear biological contaminants. Particulate can be removed through several forms of filtration. Filtered water is safer but still not safe.
  • once particulates are filtered the biological contaminants can be removed in many ways such as boiling, UV exposure, chemical cleaners.
  • soluble contaminants are generally rare and represent things like chemicals in the water, or salt, or other stuff that isn't removed by filtration and boiling. We have two options here, we could just call this water unsalvageable or we could make it possible to distill it to get pure water. I think allowing distillation to purify it ultimately is a pretty decent option but worth noting it requires a bit more knowledge than one might expect... You do need to make sure that you know what to keep and what to discard.

@nornagon
Copy link
Contributor

nornagon commented Feb 2, 2024

Thinking through some more technical/implementation details.

  • Currently the way to repair an item fault is to select (m)end on the item, which seems like a sort of strange verb for purifying water. The crafting system seems like a more natural fit here, perhaps?
  • Breaking contamination down into particulate, biological and chemical makes sense. That's roughly how the EPA breaks it down, too (they add "radiological" as a fourth category). In theory, water with only particulate contamination would be safe (but unpleasant) to consume, but it's unlikely that a survivor will encounter particulate-contaminated water that isn't also biologically contaminated, so probably not worth modeling.
  • Modeling increasing biological contamination over time for clean or sterilized water in unsealed containers seems reasonable to me. This is essentially similar to food going rotten.
flowchart LR
cloudy_water -->|filter| water -->|sterilize| sterilized_water -->|distill| clean_water
sterilized_water -->|time unsealed| water
clean_water -->|time unsealed| water
water -->|distill| clean_water
Loading
  • Water in lakes, rivers and in puddles would become cloudy_water. Water in toilet tanks would become clean_water (degrading to water over the course of a few weeks). Water in water heaters and such is already clean water; additionally, those containers are SEALED so the water in them would stay clean indefinitely.
  • I don't think it's reasonable for a survivor to be able to remove arbitrary soluble contaminants from water. Further, I think this case is rare enough to not worry about terribly much—there are many better sources of water, a survivor doesn't need to resort to complicated sewer-water distilling mechanisms. We have mutations if you want to roleplay a sewer rat.

I think it's reasonable to assume a survivor would have a pretty good idea of what water is how safe to drink. Drinking from a river, or puddle in the dirt? Probably not great. Drinking from a toilet tank? ehhh if it's been a few months it'll probably look pretty yucky. So I don't think it's worth trying to hide the particulate/biological contaminant status of water from the player behind a test kit—especially as such test kits are not reasonably craftable by a survivor, so they'd be a consumable resource. I could see it being interesting/fun to have certain chemical contaminants be undetectable without a test kit, e.g. radiological or other contaminants leached from a toxic waste dump, perhaps with the possibility of causing mutations if you drink too much?

[Edited to add a line from water --> clean_water via distillation without sterilization, as distillation also removes contaminants.]

@nornagon
Copy link
Contributor

nornagon commented Mar 1, 2024

I've been looking through the current system for water contamination, wanted to note down what's currently there to capture existing thought. Whether or not we want to preserve any of this behavior, we should at least know what we're replacing :)

How does water become contaminated?

The definition for water doesn't include anything pertaining to contamination, so how does it become contaminated?

  • water sometimes has poison in it, depending on where it spawns. This is set on the item at spawn time in map code.
  • SPAWN_WITH_LIQUID + FRESH_WATER on a terrain spawns it with some water. This is only used for t_puddle and t_puddle_underground currently, which both also have the MURKY flag, which causes the water to have poison = rng(1,6), as well as parasites = 5 and contamination = { { disease_bad_food, 5 } }.

    Cataclysm-DDA/src/map.cpp

    Lines 2247 to 2257 in 9eaa5d4

    if( new_t.has_flag( "SPAWN_WITH_LIQUID" ) ) {
    if( new_t.has_flag( "FRESH_WATER" ) ) {
    item water( "water", calendar::start_of_cataclysm );
    // TODO: Move all numeric values to json
    water.charges = rng( 40, 240 );
    if( new_t.has_flag( ter_furn_flag::TFLAG_MURKY ) ) {
    water.poison = rng( 1, 6 );
    water.get_comestible()->parasites = 5;
    water.get_comestible()->contamination = { { disease_bad_food, 5 } };
    }
    add_item( p, water );
  • Water from water-source terrain ("examine_action": "water_source") with the MURKY flag gets the same treatment—poison = 1..6, parasites = 5, and 5% contamination with food poisoning.

    Cataclysm-DDA/src/map.cpp

    Lines 5308 to 5316 in 9eaa5d4

    if( has_flag( ter_furn_flag::TFLAG_MURKY, p ) ) {
    for( item &ret : get_map().i_at( p ) ) {
    if( ret.made_of( phase_id::LIQUID ) ) {
    ret.set_item_temperature( std::max( weather.get_temperature( p ),
    temperatures::cold ) );
    ret.poison = rng( 1, 6 );
    ret.get_comestible()->parasites = 5;
    ret.get_comestible()->contamination = { { disease_bad_food, 5 } };
    return ret;
  • Water from water-source terrain with the TOILET_WATER flag is clean 1/3 of the time, otherwise has poison = rng(1,3).

    Cataclysm-DDA/src/map.cpp

    Lines 5321 to 5327 in 9eaa5d4

    if( has_flag( ter_furn_flag::TFLAG_TOILET_WATER, p ) ) {
    for( item &ret : get_map().i_at( p ) ) {
    if( ret.made_of( phase_id::LIQUID ) ) {
    ret.set_item_temperature( std::max( weather.get_temperature( p ),
    temperatures::cold ) );
    ret.poison = one_in( 3 ) ? 0 : rng( 1, 3 );
    return ret;
  • Water from other water-source terrain will have a varying chance of poison from 1/3 to 1/20 depending on the DEEP_WATER and CURRENT flags.

    Cataclysm-DDA/src/map.cpp

    Lines 5345 to 5363 in 9eaa5d4

    if( terrain_id->has_examine( iexamine::water_source ) ) {
    int poison_chance = 0;
    if( terrain_id.obj().has_flag( ter_furn_flag::TFLAG_DEEP_WATER ) ) {
    if( terrain_id.obj().has_flag( ter_furn_flag::TFLAG_CURRENT ) ) {
    poison_chance = 20;
    } else {
    poison_chance = 4;
    }
    } else {
    if( terrain_id.obj().has_flag( ter_furn_flag::TFLAG_CURRENT ) ) {
    poison_chance = 10;
    } else {
    poison_chance = 3;
    }
    }
    if( one_in( poison_chance ) ) {
    ret.poison = rng( 1, 4 );
    }
    return ret;
  • Water from rain has a 1/10 chance of being poisoned per, uh, attempt? I think this chance might currently differ depending on whether the funnel is in the reality bubble or not.
    if( contents.can_contain( ret ).success() ) {
    // This is easy. Just add 1 charge of the rain liquid to the container.
    // Funnels aren't always clean enough for water. // TODO: disinfectant squeegie->funnel
    ret.poison = one_in( 10 ) ? 1 : 0;
    put_in( ret, pocket_type::CONTAINER );

What are the effects of poison?

  • Consuming water with poison > 0 will give you food poisoning for (poison * 30) mins, and if the poison is above rng(2,4), you'll be extra poisoned for (poison * 10) mins. Unless you're an Eater Of The Dead.
    // If it's poisonous... poison us.
    // TODO: Move this to a flag
    if( food.poison > 0 &&
    !you.has_trait( trait_EATDEAD ) ) {
    if( food.poison >= rng( 2, 4 ) ) {
    you.add_effect( effect_poison, food.poison * 10_minutes );
    }
    you.add_effect( effect_foodpoison, food.poison * 30_minutes );
  • Crafting anything with poisoned water removes the poison. This is a bug; only recipes which heat the water should remove poison.
  • Combining water with differing poison levels (e.g. by Unloading) will result in the poison level of one being overwritten by the other, depending on which one is being poured in. This is a bug.
  • Finally, NPCs won't accept poisoned food from the player, so this can be used as a water test kit. Also seems like a bug :)
    if( it.get_comestible_fun() < 0 || it.poison > 0 ) {

@nornagon
Copy link
Contributor

nornagon commented Mar 1, 2024

My feeling on the existing system is that it is fairly incoherent and doesn't provide that much interesting play. Water from different sources will have different likelihoods of poisoning you, but in a quite opaque-to-the-player way. It's fairly easy to purify water for drinking, so most players group all unclean water together as "not safe to drink" regardless of its source, which flattens all the mechanics described above about source location.

I propose we actually flatten the mechanics and make the different contamination levels more visible to the player.

  • water should become "safe-ish" to drink. This is water from rivers/lakes, or water that's been standing in a container but unsealed for a while. The water is visually clean, but obviously not sterile, based on its source. The main danger here is water-borne disease such as cryptosporidium, giardia, or E. coli, which generally come from contamination with animal feces. I couldn't find a good estimate of how likely you are to get one of these diseases from drinking e.g. water from a river. But we can make something up and tweak it until it feels right. Something in the range of 0.1% to 1% chance per unit of water consumed seems about right to me. Let's flatten out the specifics of whether the water came from a river, or from deep water, or from rain, into a flat, low probability. This seems about the same as carefully tracking the source, from a gameplay perspective—if you're okay risking illness, you can drink river water; if you want to be safe, purify it first.
  • Instead of immediately giving you food poisoning/poisoning, model something closer to cryptosporidiosis/giardiosis/gastroenteritis, where it takes a little while after consuming the contaminant to experiencing symptoms.
  • Add water_murky, which is e.g. puddle water or swamp water. This is obviously contaminated, full of particulate matter and/or algae. I'd say this water shouldn't even be drinkable, or if it is it's guaranteed to make you sick. But it can be filtered (via a variety of methods) to become water.
    • Filtering techniques should include using a commercial filter (e.g. LifeStraw, tablets, etc. which can go directly from water_murky -> water_sterilized), using an improvised filter using e.g. sand, charcoal, coffee filters (which would go from water_murky -> water, after which it could be boiled to get water_sterilized).
  • Add water_sterilized, which is identical to water_clean in everything but morale. It doesn't taste as good.
  • water_clean and water_sterilized degrade to water over time, unless in a sealed container.
  • Non-boiling recipes should carry over contaminant risk if they're made with water instead of water_clean.

I think this is a bit of a different vision from what others proposed in that there's less hidden information about contaminants, rather than more. But I think this system makes the underlying mechanics more visible and thus more interesting to the player.

I think I have enough here to start working on a PR, but I'll wait a few days to see if there's comment on this direction before going ahead with the work.

@XygenSS
Copy link
Contributor

XygenSS commented Mar 2, 2024

Throwing a few ideas here.

'Visibly unclean water' (murky, cloudy, muddy...)
Stagnant natural water sources, obviously unsafe to drink.

'Visibly clean but risky water' (Just called water)
Flowing natural sources, stagnant manmade sources, Filtered water that does not remove microorganisms (charcoal filters etc)

  • Water in toilet cisterns and water heaters should be safe enough but not fully safe, especially toilet water - basins could accumulate biofilms or mold, or be treated with toxic chemicals like drain cleaners etc. Toilet water definitely shouldn't give you parasites though. Toilet tank water should be safe to drink #30520

'Potable water' (Current clean water, but could instead be called potable, pure, purified, sterilized...)
Treated in some way that kills or deactivates microorganisms and/or removes chemicals. You should not be able to purify visibly unclean water without filtering it first, or enforce a filtering implement in the crafting recipe. Boiling, water treatment tablets, Lifestraw, bleach, other high tech filtering methods will net you potable water.

'Distilled water'
Mainly for use in chemistry, applied science recipes that involve water should enforce distilled water instead. Laboratory type locations should spawn jugs of distilled water.
Of course the survivor should be able to craft some using a distilling setup.
However it could be argued that since chemistry kit has a distilling quality, the survivor distills the water in situ in any recipe involving water; In that case there would be little to no merit towards distinguishing distilled water from potable water.

Then there's the problem with commercial bottled water, currently there's sealed bottles of clean water which is mostly useless past earlygame and sealed bottles of mineral water which is otherwise unobtainable. They could be collapsed into a bottled water which has +1 extra morale but shouldn't give you +10 extra hydration like mineral water currently does.

This would give you 4 or 5 types of water:
visibly unclean water, which is clearly unsafe
water, free of debris and mostly safe, but might carry microorganisms
potable water, which you can 100% rely on
bottled water, fancy pre-cataclysm water
and possibly distilled water.

@ZeroInternalReflection
Copy link
Contributor

Filtering techniques should include using a commercial filter (e.g. LifeStraw, tablets, etc. which can go directly from water_murky -> water_sterilized), using an improvised filter using e.g. sand, charcoal, coffee filters (which would go from water_murky -> water, after which it could be boiled to get water_sterilized).

I'm currently trying to finish up #71971, which reworks the behaviour of water purification tablets (mostly so that they can no longer any amount of water instantly). The aquatabs you reference are also the ones I based the new version off of.

The system in that PR when you use the tablets is water->water_purifying (wait 40 minutes)->water_clean.
Changing it to go water_purifying->water_sterilized should be a simple JSON change.
Adding a path of water_murky->water_purifying->water_sterilized would require a check in the iuse function of "how dirty is the water you selected" to figure out if you need to use more tablets, but also shouldn't be too bad.

@nornagon
Copy link
Contributor

nornagon commented Mar 2, 2024

@XygenSS I'm in agreement. Perhaps instead of "sterilized water" being the new thing, we use "clean water" to mean "water that is guaranteed safe to drink" (i.e. it's been sterilized), and introduce a new type for "bottled water" / "pure water" (maybe "spring water"?) that's more or less the same as mineral water.

@ZeroInternalReflection thanks for the PR reference, agreed that the tabs should be usable to sterilize murky water as well. I'm not sure about how that works with something like Aquatabs, if it takes longer and/or uses more tablets that should be relatively easy to model. Also, if we go with the suggestion from @XygenSS to make "clean water" mean "sterilized water", then your PR shouldn't need any JSON changes at all in that regard :)

@nornagon
Copy link
Contributor

nornagon commented Mar 2, 2024

So here's the new transition graph, quite a bit simpler.

flowchart LR
water_murky -->|filter| water -->|sterilize| water_clean
water_clean -->|time unsealed| water
Loading

Pre-Cata bottled water would become water_spring and get a little morale boost.

@ZeroInternalReflection
Copy link
Contributor

I'm not sure about how that works with something like Aquatabs, if it takes longer and/or uses more tablets that should be relatively easy to model

That's one thing I forgot to mention in my note above. The specific tablet I'm basing things off of calls for 1 tablet/L, or, if the water is cloudy or <4C, 2 tablets/L. (That's the Canadian website, but I believe the same tablet is sold in the US. The US website is just substantially more annoying)

That's a check that would need to happen in the iuse function, where after the player selects the water, we check "is it murky? Is it cold? Then we need bonus tablets"

It looks like the timeline/other instructions are the same, which is good because different processing times on water_purifying would probably be annoying.

@Nebnis
Copy link
Contributor

Nebnis commented Mar 2, 2024

Clean water/purified for sterilized/boiled water seems good enough for me. Maybe tap water for pre-cata water? Then add those to those heaters and other places. Would also differentiate from the mineral bottled water we have now.

@IdleSol
Copy link
Contributor

IdleSol commented Mar 3, 2024

water should become "safe-ish" to drink.

Fungal spores. If I ever met them in real life. I'd boil water ten times.

Remind me how the survivor interacts with the blob? Which is contained in the water. Did he gain immunity or was he lucky to survive?

flowchart LR
ocean --> ocean_shallow_water --> |always| salt_water_murky
swamp --> swamp_shallow_water -->|always| salt_water_murky
ocean --> ocean_deep_water --> |always| salt_water
ocean --> ocean_submerced_salt_water --> |always| salt_water
swamp --> swamp_deep_water -->|always| salt_water
swamp --> swamp_murky_shallow_water -->|always| water_murky
puddle ---> |always| water_murky
pool --> pool_water -->|chance? | water_murky
pool_water --> |chance? | water
pond --> pond_shallow_water --> |always| water_murky
pond --> pond_deep_water --> |always?| water_murky
fishing_pond --> fishing_pond_shallow_water --> |always| water_murky
fishing_pond --> fishing_pond_deep_water --> |always?| water_murky
stream --> stream_flowing_shallow_water -->|always?| water_murky
stream --> stream_shallow_water -->|always| water_murky
lakes --> lakes_shallow_water --> |always| water_murky
lakes --> lakes_deep_water --> |always| water_murky
lakes --> lakes_bulkhead --> |always| water_murky
lakes --> lakes_flowing_shallow_water --> |always| water
lakes --> lakes_flowing_deep_water --> |always| water
lakes --> lakes_submerced_water --> |always| water
river --> river_flowing_shallow_water --> |always?| water
river --> river_flowing_deep_water --> |always| water
sewer ---> sewage
sewage_treatment_plant --> STP_sewage --> sewage
sewage_treatment_plant --> STP_pool_water --> |always| water_murky
sewage_treatment_plant --> STP_shallow_pool_water --> |always| water_murky
natural_spring -->natural_spring_shallow_water --> |always| water
natural_spring -->natural_spring_deep_water --> |always| water_clean
water_heater --->|always| water_clean
hot_spring -->hot_spring_water --> |always ?| water_clean
Loading

There are still random encounters (?) with the ponds:
debug menu - m - n spawn map extra -

  • s mx_pond
  • t mx_pond_forest
  • u mx_pond_forest_2
  • v mx_pond_swamp
  • w mx_pond_swamp_2

And I'm probably forgetting something.

@IdleSol
Copy link
Contributor

IdleSol commented Mar 3, 2024

flowchart LR
water_clean -->|time unsealed| water
water_murky -->|filter| water -->|sterilize| water_clean 
water -->|Distillation| distilled_water
salt_water_murky --> |???| salt_water --> |Distillation| distilled_water --> |mineralization| water_clean
salt_water --> |Electrodialysis| water
salt_water --> |Freeze–thaw| water
Loading

As for electrodialysis, it would be best to check with those who understand.

UPD. My opinion. I'm against spoiling clean water. Because it will lead to additional lags. Based on the topic: #71419 (comment) But that's not relevant to the topic.

@XygenSS
Copy link
Contributor

XygenSS commented Mar 3, 2024

Fungal spores. If I ever met them in real life. I'd boil water ten times.

Mycus-infected water and how to render it safe would be a cool mechanic but IMO out of scope for now. Mycus infestations are pretty regional, both in lore and ingame, there is little to no sign that mycus spores are spread everywhere. (real, non-anomalous fungal spores are everywhere, but that's just ordinary business and nothing our immune systems can handle... most of the time)

Remind me how the survivor interacts with the blob? Which is contained in the water. Did he gain immunity or was he lucky to survive?

Every living thing on Earth is contaminated with Blob including all survivors, some kept their sanity, some went feral, some recovered, but all of them including the survivor will zombify when killed.

The blob infection inside the survivor is what drives mutations as well

@IdleSol
Copy link
Contributor

IdleSol commented Mar 3, 2024

I'm talking about the blob being in the water. If a survivor drinks this water, will they mutate further? In other words, is it necessary to add a small amount of mutagens to the water?

@XygenSS
Copy link
Contributor

XygenSS commented Mar 3, 2024

No, mutagen is a specific thing. Drinking more blob when you're already blobbed does nothing

@XygenSS
Copy link
Contributor

XygenSS commented Mar 3, 2024

Btw @nornagon - Per Kevin in discord on the topic of the survivor distilling water per-recipe, "No that's not a remotely sensible thing to do, distillation can take a very long time and is very good at being run in big batches." So adding RO/DI water or distilled water is greenlit it seems.

@nornagon
Copy link
Contributor

nornagon commented Mar 3, 2024

@XygenSS Yeah, RO/DI is a good idea for a followup, but this issue is mainly about collecting water for consumption, so I'll leave that for later.

@IdleSol I hadn't gotten to thinking about salt water, I think the only reasonable way for a survivor to convert salt water to drinkable water is through distillation, so that can maybe happen when we implement RO/DI water. Distilling murky salt water should be fine and directly produce distilled water; any particulate matter will remain in the undistilled portion. I'm not sure about freeze-thaw or electrodialysis for removing salt from water; I'm not familiar with those methods. As for mineralization of distilled water, how do you imagine that happening? What's the process for that?

And regards rot processing, I don't think the fact that it's currently under-optimized is a good reason not to have clean water spoil. The performance problems seem solvable :)

@IdleSol
Copy link
Contributor

IdleSol commented Mar 3, 2024

@nornagon

Think of it as a starting point. The main sources encountered in the game. Variants of tiles for these sources and my variant, what water can be taken from them. It can be simplified if necessary.

I was under the assumption that you might want to make different water for different sources. So I added the name of the source to the name of the tile.

I'm not sure about freeze-thaw or electrodialysis for removing salt from water

https://en.wikipedia.org/wiki/Desalination#Freeze–thaw
https://en.wikipedia.org/wiki/Desalination#Electrodialysis

It's more like content for labs and treatment plants. Maybe for oceanfront buildings, ships. I doubt it would be found in a garage.

Freezing and thawing of water. In the simplest case, it can be used for rough water purification. That is to turn murky water into water. It does not remove parasites or poisons. Based on the fact that ice begins to form around impurities. The main thing is to filter it in time.

As for mineralization of distilled water

There's a patent. Stumbled across it while looking for ways to do it. https://patents.google.com/patent/RU2616658C1/en

Fundamentally possible, with some simplifications and assumptions. Take salt water from the ocean and mix it with distilled water. Some scientific instruments are needed.

P.S. I apologize for the quality of the text.

nornagon added a commit to nornagon/Cataclysm-DDA that referenced this issue Mar 8, 2024
Maleclypse pushed a commit that referenced this issue Jun 4, 2024
* water rework part 1

ref #72

* drop char_purifier for purifying murky water

* clang-tidy

* astyle

* json style

* double-space

* add slow-sand filter and update murky water filtering to use it

* use bucket_5gal instead of jerrycan for water_filter_sand

* Apply suggestions from code review

Co-authored-by: osuphobia <[email protected]>

* Update data/json/recipes/recipe_food.json

Co-authored-by: osuphobia <[email protected]>

* Update data/json/items/tool/cooking.json

Co-authored-by: osuphobia <[email protected]>

* Update data/json/items/comestibles/drink.json

Co-authored-by: osuphobia <[email protected]>

---------

Co-authored-by: osuphobia <[email protected]>
sonphantrung added a commit to sonphantrung/Cataclysm-DDA that referenced this issue Nov 2, 2024
# This is the 1st commit message:

ios build

# This is the commit message #2:

Add legacy handling and overmapbuffer::is_in_city

# This is the commit message #3:

Correct doc example

# This is the commit message #4:

Correct distance calc

Not sure why I were checking 2 thick circles?

# This is the commit message #5:

Appease our clang overlords

# This is the commit message #6:

It helps if you add save/load handling

# This is the commit message CleverRaven#7:

Remove unnecessary project

Co-authored-by: ehughsbaird <[email protected]>
# This is the commit message CleverRaven#8:

Fix minor typos in keybdings.json
# This is the commit message CleverRaven#9:

Update data/raw/keybindings.json
# This is the commit message CleverRaven#10:

Added imgui_freetype.cpp to vcxproj to fix broken build.

# This is the commit message CleverRaven#11:

Fixing compile error related to map::get_field usage

# This is the commit message CleverRaven#12:

Adding a welding store (CleverRaven#77279)

* First draft

* Add the store

* Make it spawn

* Final touches
# This is the commit message CleverRaven#13:

fix NPCs stealing player default name

# This is the commit message CleverRaven#14:

Update materials.json

# This is the commit message CleverRaven#15:

Update dreamer_procgen.json (CleverRaven#77179)


# This is the commit message CleverRaven#16:

Fix the Dream magick hobbies (CleverRaven#76912)


# This is the commit message CleverRaven#17:

cody shows her math skills (CleverRaven#77303)


# This is the commit message CleverRaven#18:

Set `last_item` after the end of picking up

Also remoced mention of zombie spawning in `"LESSON_GOT_WEAPON` snippet.

# This is the commit message CleverRaven#19:

Normalize body stats on start of the tutorial

# This is the commit message CleverRaven#20:

fix zoo scenario spawn (CleverRaven#77237)

* zoo ZONE_START_POINT

* Update start_locations.json

* Update scenarios.json

* fix DinoMod

* fix Xedra

* Fix Limb WIP mod

* Fix deadly bites mod

* Update scenarios.json
# This is the commit message CleverRaven#21:

Unify all run_eocs in a single eoc function (CleverRaven#77000)

* Unify all run_eocs in a single eoc function

* add test suite

* fix typo

* handle condition better

* Simplify code, move few big stuff into it's own functions

* fix incorrect return

* fix mistakes that prevent eoc from firing

* rename iteration to iterations

* reflect changes in documentation

* change iteration to iterations in json

* please clang
# This is the commit message CleverRaven#22:

fix recent regression of CleverRaven#77191

Fixes CleverRaven#77191

# This is the commit message CleverRaven#23:

remove migo_bio_tech from spawns (CleverRaven#76940)


# This is the commit message CleverRaven#24:

Introduced untyped coordinate operations to typed ones (CleverRaven#77098)

* Introduced untyped coordinate operations to typed ones

* Missed rotate usages

* demanded changes
# This is the commit message CleverRaven#25:

fix 5 round magazine having 20 rounds
# This is the commit message CleverRaven#26:

Fix edges

# This is the commit message CleverRaven#27:

Allow debug revealing any OM

# This is the commit message CleverRaven#28:

Swap the order of the bind labels to a guess at most used -> least used

# This is the commit message CleverRaven#29:

Add ability to place terrain/special without exiting placement

# This is the commit message CleverRaven#30:

Revert "Swap the order of the bind labels to a guess at most used -> least used"

This reverts commit 05cf094.

# This is the commit message CleverRaven#31:

Revert "Allow debug revealing any OM"

This reverts commit 5d1fc0a.

# This is the commit message CleverRaven#32:

"all" option for distraction manager (CleverRaven#77342)

* distraction manager option for toggling all

* Update src/distraction_manager.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# This is the commit message CleverRaven#33:

Beaver audit (CleverRaven#77283)

* beavere big

* baby creature

* feaver

* dambreaker

* reproduction

* butchery

* monstergroups

* factions

* Update mammal.json

* Update monster_factions.json

* Update monster_factions.json
# This is the commit message CleverRaven#34:

Update electronic_parts.json

# This is the commit message CleverRaven#35:

Add a new widget to display weight with the format "##.#/##.#[unit]" (CleverRaven#77212)

* Add two new widgets to display weight with the format "##.#/##.# kg" and "##.#/##.# lb", and add the widgets to the legacy labels sidebar

* Apply suggestions from code review

I don't format goodly

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Remove imperial version of the feature, and modify the metric version to read users mass setting and adjust the display accordingly

* Apply suggestions from code review

Formatting

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Updated per IdleSol suggestion

* I think I forgot to pull before pushing and I don't understand git so I think it ate this space in the merge :(

* I'll get it right one day

* Update to use functions I didn't know existed, removing a few lines of code.

* Update src/display.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# This is the commit message CleverRaven#36:

Add Vitamin C Supplements (CleverRaven#77363)

* Add VitC Supplement

* Create Drug Spawn Groups

* Add VitC to softdrugs itemgroup

* Full vitC bottle Added to Doctor shopkeep

* Add VitC to vitamin_shop itemgroup

* Add VitC to SUS bathroom vitamins

* I really fucked up that last copy paste, fixed?
# This is the commit message CleverRaven#37:

Fixed broken Android build due to missing FreeType library

# This is the commit message CleverRaven#38:

wrap long text in the menu for choosing the type of faction camp to create

# This is the commit message CleverRaven#39:

[ Aftershock ] Make Flesh Golem heart a mission item 


# This is the commit message CleverRaven#40:

Routine i18n updates on 26 October 2024

# This is the commit message CleverRaven#41:

Fix cotton patch being unusable to stop bleeding

# This is the commit message CleverRaven#42:

First Draft

Update en.credits

# This is the commit message CleverRaven#43:

Update data/credits/en.credits
# This is the commit message CleverRaven#44:

Update data/credits/en.credits

Co-authored-by: David Seguin <[email protected]>
# This is the commit message CleverRaven#45:

Update data/credits/en.credits
# This is the commit message CleverRaven#46:

Update data/credits/en.credits

Co-authored-by: Binrui Dong <[email protected]>
# This is the commit message CleverRaven#47:

Apply suggestions from code review

Co-authored-by: RenechCDDA <[email protected]>
# This is the commit message CleverRaven#48:

Update en.credits

Overhauled the Main Developers section.
Reordered special thanks alphabetically.
# This is the commit message CleverRaven#49:

Add links to tileset contributor lists.
# This is the commit message CleverRaven#50:

Removed heating elements drop from smashing the fume hood

# This is the commit message CleverRaven#51:

Add freetype, clean up 3rd-party CMake file

# This is the commit message CleverRaven#52:

[MoM/Magiclysm interaction] Synchronize anti-Stare powers, Thought Shield spell protects from telepathy (CleverRaven#77277)

* Create miscellaneous.json

* Create flags.json

* Acount for TEEPSHIELD

* Create eoc_misc.json

* Add MAGICAL_MIND_PROTECTION to thought shield

* Add mind protection to thought shields

* TEEPSHIELD effect

* Update data/mods/MindOverMatter/mod_interactions/magiclysm/item_overrides.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fixes

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# This is the commit message CleverRaven#53:

Decrement spawn quantity when no monster is selected in sub group

# This is the commit message CleverRaven#54:

Set mon_found properly when select monster from subgroup

# This is the commit message CleverRaven#55:

Update src/mongroup.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# This is the commit message CleverRaven#56:

Update ballistic_armor.json

# This is the commit message CleverRaven#57:

Factions don't mind the player smashing zombie corpses

# This is the commit message CleverRaven#58:

[Xedra Evolve] Add Ruach counter to sidebars (CleverRaven#77422)

* Update sidebar.json

* Create ruach_counter.json

* Initial commit

* Add to sidebars
# This is the commit message CleverRaven#59:

Forbid drinking liquids underwater for characters with `WATERSLEEP` and `UNDINE_SLEEP_WATER` mutations

# This is the commit message CleverRaven#60:

Characters with `UNDINE_SLEEP_WATER` mutation sleep less in water

# This is the commit message CleverRaven#61:

Fix recent clang-tidy errors.

# This is the commit message CleverRaven#62:

Set owner for new appliances (CleverRaven#77211)


# This is the commit message CleverRaven#63:

Lever action rifles (CleverRaven#77409)

* Add Rio Bravo

* Henry Golden Boy

* Add .44 R92

* Adds Uberti 1873

* Added sources

* 357 R92

* Minor fixes

* fix in ammo count for nested r92

* Spelling fixes

* Apply suggestions from code review

Co-authored-by: TheShadowFerret <[email protected]>

* Apply suggestions from code review

Co-authored-by: Anton Burmistrov <[email protected]>

---------

Co-authored-by: TheShadowFerret <[email protected]>
Co-authored-by: Anton Burmistrov <[email protected]>
# This is the commit message CleverRaven#64:

Add myself
# This is the commit message CleverRaven#65:

Initial commit (CleverRaven#77414)


# This is the commit message CleverRaven#66:

Minor gun fixes

# This is the commit message CleverRaven#67:

Update spells.json
# This is the commit message CleverRaven#68:

Feral Agent fix and loot update (CleverRaven#77421)

* Feral Agent fix and loot update

Co-Authored-By: gettingusedto <[email protected]>

* Update data/mods/Xedra_Evolved/itemgroups/monster_drops.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: gettingusedto <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# This is the commit message CleverRaven#69:

Apply copy-from to mod scenarios (CleverRaven#77417)

* Apply copy-from to mod scensarios

* apply to Limb_WIP

* Mind Over Matter

* Xedra

* Update scenarios.json

* document
# This is the commit message CleverRaven#70:

Mutations can have a custom activation message

# This is the commit message CleverRaven#71:

Changed implementation of battery chargers to make them work outside the reality bubble.

# This is the commit message CleverRaven#72:

Added last_charged to serialize and deserialize

# This is the commit message CleverRaven#73:

Prevent overflow

# This is the commit message CleverRaven#74:

Moved dischargeable check earlier to catch situations when dischargeable is 0 from the beginning

# This is the commit message CleverRaven#75:

[MoM] Move Mirror-mask bonus to effect, obsolete mutations (CleverRaven#72370)

* Obsolete old mutations

* Obsolete switcher EoC

* Move switcher EoC

* Move effect to enchantment

* Remove rather than obsolete mutations

* lint

* Fixes + documentation

* Linting
# This is the commit message CleverRaven#76:

Reworked check for flammability

# This is the commit message CleverRaven#77:

Changed text to mention a non-lit cig

# This is the commit message CleverRaven#78:

Refactoring armor ordering

# This is the commit message CleverRaven#79:

migo sideplates

# This is the commit message CleverRaven#80:

[Xedra Evolved] Require Traverse the Wilds to target a tree as the endpoint (CleverRaven#72655)

* Require teleporting to a tree

* Edit description

* Update data/mods/Xedra_Evolved/mutations/paraclesians/arvore_eocs.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update EoC for map_run_eocs

* Update spell

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# This is the commit message CleverRaven#81:

[Xedra Evolved] More Lilin powers (CleverRaven#77269)

* Initial commit

* Add more powers

* Fix n_vitamin

* Add the Evil Eye

* Duration edits, increase ruach cost of Reap the Whirlwind

* Fix math

* Cry of the Night Bird reduces speed by percentage, not flat number

* Those who have the evil eye are immune to the evil eye

* Add Owl's Wisdom

* Update xe_lilin.json

* Add The Pestilence that Stalks in Darkness

* Add Stand Before the Cold

* Add more abilities

* Various updates

* Increase cost of Neither Sleep nor Slumber

* Add strix to dictionary

* Fix typos

* Fix ruach cost
# This is the commit message CleverRaven#82:

modify random NPC starting equipment based on time passed

-some very basic item groups for now, needs to be expanded on later
-add_profession_items(): replace raw inv with i_add()
-very minor edits to some professions

# This is the commit message CleverRaven#83:

[DinoMod] mountable and harnessable audit (CleverRaven#77391)

* [DinoMod] riding and harness audit

* juvenile fixes

* rem harnessable

* Remove harnessable

* juvenile fixes

* flag spellcheck
# This is the commit message CleverRaven#84:

Use corner symbols for vehicle Corner variations
# This is the commit message CleverRaven#85:

Removing and/or using some unused itemgroup IDs (CleverRaven#77356)

* ``accessory_ring``

* unused

* Update drugs.json

* I told you to remove them

* cinnamon groups

* yeast

* seasoning salt

* flour bags

* Update druid_tower.json
# This is the commit message CleverRaven#86:

Use parametrized carpets where appropriate (CleverRaven#77287)

* Add the carpet palette

* Nested basements

* Make the carpet not fallback

* Fix oopsie

* Fix oopsie

* Switch palette name to be clearer

* Carpets in nests

* First few buildings

* Most of the maps

* bungalow08

* Use correct palette name

* Last few touch-ups

* Remove old palette

* Use correct palette name
# This is the commit message CleverRaven#87:

Update urban_20_house.json

# This is the commit message CleverRaven#88:

Initial commit

# This is the commit message CleverRaven#89:

add terminal punctuation to bulletin board examination message

# This is the commit message CleverRaven#90:

Allowed throwing items while piloting mechs

# This is the commit message CleverRaven#91:

Fix CleverRaven#77179 and a Book in Magiclysm (CleverRaven#77408)

* Update dreamer_procgen.json

* Update recipe_books.json

* Update data/mods/Xedra_Evolved/procgen/dreamer_procgen.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# This is the commit message CleverRaven#92:

eoc: clear deferred math on error

# This is the commit message CleverRaven#93:

fix scenario spawns (CleverRaven#77451)

* fix scenario spawns

* road mayhem start

* wild party

* update sloc hospital entry

* revert road sloc terrain

* simplify road terrain

* Try TYPE for crash sloc
# This is the commit message CleverRaven#94:

Add recommended palettes

# This is the commit message CleverRaven#95:

Stop 20x Melatonin Spawns (CleverRaven#77347)

* Fix Up Melatonin

* Woops, too much deleted
# This is the commit message CleverRaven#96:

Refugee center cleanups (CleverRaven#77331)

* dino dave

* door position

* lobby cleanup
# This is the commit message CleverRaven#97:

Remove Calcium from Rare Drugs (CleverRaven#77349)


# This is the commit message CleverRaven#98:

eoc: clean up run_eocs

# This is the commit message CleverRaven#99:

eoc/run_eocs: don't allow queue+loop in one invocation

# This is the commit message CleverRaven#100:

eoc/run_eocs: add test for talker mixes

# This is the commit message CleverRaven#101:

Allow any grade of steel ofr the metal axe head

# This is the commit message CleverRaven#102:

Switch relationship to enum class

# This is the commit message CleverRaven#103:

Faction relationships can be modiifed through dialogue

# This is the commit message CleverRaven#104:

Asking for a bed gives you permission to sleep there

# This is the commit message CleverRaven#105:

Update lumbermill map+dialogue
-Outer fence is no longer permalocked with no way in
-You can ask for a gate to be opened.

# This is the commit message CleverRaven#106:

Appease clang, the one true overlord

# This is the commit message CleverRaven#107:

Fix food calcs for items with non-food components

# This is the commit message CleverRaven#108:

Flush debug log writes immediately
# This is the commit message CleverRaven#109:

fix two supressors in m4_cqbr
# This is the commit message CleverRaven#110:

magus.json description change

This is my first contribution/change. I apologize if it isn't formatted or done correctly.

I noticed that magus_slow had the same description as magus_haste.

Slow should indicate that it slows the target's speed.

# This is the commit message CleverRaven#111:

less loopy conversation loops

# This is the commit message CleverRaven#112:

found another

# This is the commit message CleverRaven#113:

math: improve diag_value constructors

# This is the commit message CleverRaven#114:

math: add monostate to diag_value

# This is the commit message CleverRaven#115:

math: add kwarg_or helper function

# This is the commit message CleverRaven#116:

Repeat survey missions without leaving interface

# This is the commit message CleverRaven#117:

Made game recognize burst fire mode as well as full auto when pressing 'Burst fire wielded weapon'

# This is the commit message CleverRaven#118:

simple knife spear quest options (CleverRaven#77335)

* options

and random word choice

* just spears then
# This is the commit message CleverRaven#119:

Rejecting some area threats near safe locations

# This is the commit message CleverRaven#120:

Globally unique -> prio 1 and SAFE_AT_WORLDGEN

# This is the commit message CleverRaven#121:

Use global coordinates in global calls...

# This is the commit message CleverRaven#122:

Removed remaining development variable

# This is the commit message CleverRaven#123:

fix: -Werror=range-loop-construct (CleverRaven#77302)


# This is the commit message CleverRaven#124:

some mistake fixing
# This is the commit message CleverRaven#125:

:pray:
# This is the commit message CleverRaven#126:

idk
# This is the commit message CleverRaven#127:

heh
# This is the commit message CleverRaven#128:

cmon do something
# This is the commit message CleverRaven#129:

astyle

# This is the commit message CleverRaven#130:

try to deal with undefined type
# This is the commit message CleverRaven#131:

i'm desperate
# This is the commit message CleverRaven#132:

resorting
# This is the commit message CleverRaven#133:

idk what's happening
# This is the commit message CleverRaven#134:

dunno
# This is the commit message CleverRaven#135:

stupid resorting
# This is the commit message CleverRaven#136:

Update input_context.h
# This is the commit message CleverRaven#137:

attempt to workaround 'inaccessible member'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Enhancement / Feature> New features, or enhancements on existing (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

10 participants