-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Water purification tablets only purify up to 4 water each #71971
Water purification tablets only purify up to 4 water each #71971
Conversation
Interesting moment, most of real world water purification tablets not works instant, but takes time (from 30 min to 4h). Mostly something like 1-2 tablet for 5-10 liters depending of water quality. |
I've been doing some digging trying to figure out the origin of the stated 1:250mL ratio, and can't find any documentation behind it, so I don't know if there was a particular 'model' of tablet in mind. The description change was way back in #5586, and the tablets themselves were added back in 2013: a6b5cd0. The clean water recipe json lists references for purifiers and charcoal filters, but nothing for tablets. Changing the ratio of tablets:water is (probably) pretty simple if we want to point at a specific tablet like that. Having the transformation take time makes sense from a 'realism' perspective, but a previous attempt apparently fell apart: #39973. I believe there's infrastructure to turn the water into an item that can be |
Something like fermentation tank mechanics? Sounds pretty similar at least on code logic. I could be wrong, but it seems that we once had large carbon water filters with similar mechanics (but not sure here, in another fork or in mods). Anyway, I think 1 to 250ml per unit will make tablets mostly useless with current spawn numbers of this kind of items. With this changes needs some re-balance as well, imho. |
A delay process would be good. In progress items are weird for liquids, though. Back before someone informed me that you could purify water passively with fire I had manual water purification being broken off a lot, resulting with in progress items. Note that an increase in the amount of water a tablet can purify shouldn't make it mandatory: an early game character may only have access to one or two bottles, and demanding that they'd have 10 (or whatever number) before they could start to purify the water would be bad. |
The notion | have at the moment (pending sifting through the code for transforming items) is:
If we specifically reference the aquatabs that Rokharn found then I'd rework the tablet:water ratio. However, there's probably also a minimum recommended ratio. The link gives "8-10L" and "20L if clear", but is pretty insistent on the 'do not swallow tablets' thing, and they may not be suitable for use in, e.g. a 500mL water bottle. To think I only touched this to fix the crafting recipe so I could continue with #60417... |
For example water, heat and time can automatically turn 'water' into 'clean water' already, mostly same thing, I think. Aftershock ice can be turned into water at similar way. Another example of similar sounds mechanic (currently ingame too) is 'sauerkraut' and 'wild yeast'. Using some components and container sealing recipe, after some time we can get complete new item or items. This one might work better. |
I think the sealed container recipes suffer from a standard problem with recipes; namely that the container is a fixed part of the recipe result, so while you can vary a container input item through a list of alternatives, the resulting product is always going to be in the same fixed type of container. |
Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details. Click to expand
This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to |
Alright, this is most of the way to "put in the tablets, walk away, and come back half an hour later to clean water". The tablets create "water (purifying)" which is not yet consumable, but can be transformed into clean water 40 minutes later. The transformation uses the existing mechanism used for sourdough starters and was surprisingly easy to set up. It also almost works in a toilet tank, but some more testing and debugging is still required, so I've marked it as draft for now. |
6d43a01
to
de0f594
Compare
de0f594
to
efeb1e4
Compare
I'm calling this one ready for review (again). There are still a variety of water-quality-related issues, but this PR is already complicated enough. There are also a couple of bits I'm not sure about, particularly how I go about pulling the water_per_tablet variable from json and the use of test_mode in iuse.cpp, but at this point it needs another set of eyes. |
This looks super cool. I like it! |
Needs a rebase for clang and some minor touch-ups to switch over to mod_moves instead of touching moves directly. |
@PatrikLundell sorry to bother but when I resolved conflicts on this stale PR it looks like some mapgen changes since then have changed how this should have been written. If you have any suggestions on how to fix it I would greatly appreciate it. If not and I was confused about the cause, my apologies. |
I assume you're referring to test failures (at least something in the first one seems related to my changes)? I'd need some help, in that case. In order to examine and modify the code in a sane manner I'd need to know how to download it and then push the modified code up again onto the same branch (assuming, of course, it could be fixed). I can get master and my own branches down, but I don't know how to "name" someone else's as I assume the branch name isn't global. |
The easiest option is probably to add ZeroInternalReflections fork as a remote, then you can just pull the branch this PR is based on. Though I doubt you'll have the permissions to push directly back to it. But if you push your changes to your fork and then make a PR to their branch on their fork, Maleclypse might be able to merge that. |
Code fix for #71971 Water purification tablets only purify up to 4 water each
Summary
Bugfixes "Water purification tablets purify 1-4 water each"
Purpose of change
Attempt 2:
Water purification tablets do not appear to be modeled on any specific real-world item and behave in unexpected ways:
a
ctivating the tablets will purify any amount of water selected, andFixes Water purification tablet. Wrong work? #71818
In addition, there are some odd behaviours related to activating/examining/consuming comestibles that I needed to fix to get this working satisfactorily:
e
xamine a water source, select the "consume" option, then back out (e.g. because you decide the toilet tank water is too gross, or because you're full), a unit of water is still consumed from the sourcea
ctivate water or certain other comestibles (such as alcohol), it will immediately consume all charges rather than only oneDescribe the solution
Tasks remaining:
a
ctivatione
xaminationDescribe alternatives you've considered
I think this is how they originally worked, but initial testing didn't seem promising
I was sorely tempted, but then you can just
E
at the tablets to do nothing, which is less than idealNot today.
Testing
In-game testing:
a
ctivating the tablets uses 1 for up to 4 water in the container selecteda
ctivating the purifying water 40 minutes later turns it into clean waterE
ating the tablet leads to thea
ctivation route and worksE
ating the purifying water leads to thea
ctivation route and worksa
ctivating six tablets will turn a toilet tank to water_purifiyng, which becomes clean water after 40 minutese
xamining a toilet tank or tank full of water allows you to back out after selecting "consume"a
ctivating various food/drink items follows the same route asE
ating them, and adds the appropriate nutrients to the player's stomachUnit testing:
a
ctivation to use the consume_activity_actor broke one of the eoc unit tests, since the eoc was structured to expect the character to immediately get the effects from consuming the item. I think my modification still fits the intent of the testAdditional context