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

Vehicle-mounted water purifier limited in charges #7075

Closed
SeanMirrsen opened this issue Apr 7, 2014 · 16 comments

Comments

Projects
None yet
10 participants
@SeanMirrsen
Copy link
Contributor

commented Apr 7, 2014

As reported here: http://smf.cataclysmdda.com/index.php?topic=6061.0

The vehicle-mounted water purifier (inside a FOODCO kitchen buddy) doesn't have the entire battery capacity of the vehicle at its disposal - instead it just draws 100 charges, and then deposits the leftovers back into the battery(ies). The problem is that the large metal tank, for instance, holds more than 100 units of water, so you can't purify the water in the tank even though you may have more than enough available power to do so.

From game.cpp, game::pickup

    if(menu_items[choice]==_("Use the water purifier?"))
    {
        //Will be -1 if no battery at all
        item tmp_purifier( itypes["water_purifier"], 0 );
        // Drain a ton of power
        tmp_purifier.charges = veh->drain( "battery", 100 );
        if( tmp_purifier.is_tool() ) {
            it_tool * tmptool = dynamic_cast<it_tool*>((&tmp_purifier)->type);
            if ( tmp_purifier.charges >= tmptool->charges_per_use ) {
                tmptool->use.call( &u, &tmp_purifier, false );
                tmp_purifier.charges -= tmptool->charges_per_use;
                veh->refill( "battery", tmp_purifier.charges );
            }
        }
        return;
    }

Wouldn't it be better if the tmp_purifier got ALL the battery charges from the vehicle, since it then deposits the charges back anyway?

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

@kevingranade

This comment has been minimized.

Copy link
Member

commented Apr 7, 2014

Yea that's probably ok. I'm not a fan of it purifying all that water
near-instantly, but I like someone having to spend the time to overhaul it
to handle incremental purification somehow even less.

@SeanMirrsen

This comment has been minimized.

Copy link
Contributor Author

commented Apr 7, 2014

One thing that always bugged me was how you can't use the vehicle's own water tank as the destination when purifying water. Generally speaking, it doesn't make sense for any purifier that isn't chemical tablets tossed into the tank to use the same container as both the source, and the destination, of the water.

How about overhauling it so that using a charcoal or electric purifier requires a destination container that isn't the same container as the source? Then it could be less "incremental purification" and more the same kind of variable-duration action that dropping a few items is. And as an extension, if the purifier is vehicle-mounted and the vehicle also has a water tank, then the player could choose to directly fill the water tank with the purified water.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Apr 8, 2014

That's precisely the kind of overhaul I didn't want to force on anyone,
but if you want to do it, feel free.
I would expect complaints about not being able to purify from/to the same
container, but that's the lesser evil IMO, containers are pretty easy to
find.

@NaturesWitness

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2014

I only set it to take 100 charges because that was all the water purifier would hold; I was afraid if I gave it more something would break, like you would lose the excess charge or something. If it wouldn't make the game's engine barf, we can always increase the charge number to allow bigger containers to be purified.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Apr 10, 2014

Like I said, the problem with that is purifying all that water at once.

@SeanMirrsen

This comment has been minimized.

Copy link
Contributor Author

commented Apr 10, 2014

Well, I could probably take a look at making an activity out of it. I need to migrate my recipe code over to the current master anyway.... _how hard could it be?_™

@Xpyder

This comment has been minimized.

Copy link
Contributor

commented Apr 29, 2015

For the Foodbuddy purifier I think a better solution would be to have it store dirty water and then over some period of time purify that and deposit it into the vehicle's water tank. Since it has a 400 cargo capacity, Is there any way to have it consume water charges from containers you store in it? If not then maybe add a tank to it's construction and let purify from that.

Long term I'm hoping we get unified liquids tanks that we can store different types of liquids in. If so you could have it automatically move dirty water to clean water tanks as it purifies.

@eliotcougar

This comment has been minimized.

Copy link

commented Oct 13, 2016

Problem 1: Purification of water in the vehicle tank is instant no matter how much water is there (purifying water from inventory takes time)
Problem 2: It uses too little battery
Since we actually got unified liquids tanks...
I support @Xpyder solution: It should require both dirty water and clean water tanks... It should work continuously like a minifridge, drain battery (quite a lot) and slowly transfer water from one tank to another... If there's no free space in the clean water tank it will overflow and spill clean water on the ground... It should probably require some work, tools and time in order to change which tanks are used as a source and sink (i.e. manually reconnecting water tubes)
Disabling the ability to purify water in vehicle tanks using FOODCO Kitchen Buddy is also realistic... Right now it's quite overpowered...

@Xpyder

This comment has been minimized.

Copy link
Contributor

commented Oct 13, 2016

To be clear, I don't think the water purifier should overflow and spill, and I do think you should be able to flip it on and off.

But working over time, and pushing water between tanks internally seems to make the most sense to me. Perhaps, if the new tank system supports it, the water purifier could be something that's attached to a particular tank, like a funnel.

@mugling

@Leland

This comment has been minimized.

Copy link
Contributor

commented May 25, 2017

Tanks and purifiers were overhauled quite a bit. Can anyone verify that this is still an issue?

@eliotcougar

This comment has been minimized.

Copy link

commented May 25, 2017

@Leland I'm not sure if the original issue in the first post is present It is not present (it's hard to spawn 60L tanks full of water in debug menu and install them), but I still have the issue with purification being instant and taking too little power (0 charge/L), compared to boiling water in the cooking menu (12 charges/L)... I've got 60L water tank, purified it, it took 0 charges from the battery and 0 seconds...
Another issue I think is quite annoying is that water purifier doesn't transfer clean water to another tank... If you have a 60L tank with a funnel on top, and you purify it, it will not collect water again until it's empty... And there is no easy way of transferring liquids between two vehicle tanks, only between the tank and a carried container and back...

@Xpyder

This comment has been minimized.

Copy link
Contributor

commented Jun 1, 2017

With the new changes to multi-liquid tanks and the way funnels work, I'd suggest changes to the vehicle mounted water purifier as follows:

  • Must be installed onto a tank, like a funnel
  • Turned on/off from the controls like a recharger or fridge
  • If water is available in the vehicle, purifies the water over time until it's matched tank is full, consuming both power and dirty water

Does this approach seem reasonable?

Also the foodco kitchen buddy wouldn't work with this approach, maybe it should just function like other purifiers (purifying held containers) just have the maximum charges increased to 1000 (limited by battery) for the time being? I think this should get changed eventually, but until other purifiers are changed I think it's best to keep that one consistent with the portable ones.

@Xpyder

This comment has been minimized.

Copy link
Contributor

commented Jun 1, 2017

It's outside the scope of this issue, but a possible approach for the portable water purifiers might be when you activate them you choose a container and then a tile, and have them set up a tile (similar to the funnel) and work over time until finished (like a kiln).

The kitchen buddy version of this would just take the water container and hold onto it until it was finished, but again these would fall under a different issue

@kevingranade

This comment has been minimized.

Copy link
Member

commented May 5, 2019

If #21095 is working as described, this is addressed.

@Mooses2k

This comment has been minimized.

Copy link
Contributor

commented May 26, 2019

This appears to be fixed. Using a FOODCo allows purifying an entire 60L tank at once.

@Night-Pryanik

This comment has been minimized.

Copy link
Member

commented May 26, 2019

Ok, closing then. If this still an issue, feel free to ping me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.