Cataclysm-dda: Vehicle fuel indicators show confusing results as tanks are emptied.

Created on 28 Jan 2017  路  21Comments  路  Source: CleverRaven/Cataclysm-DDA

Hey,

after some search I only found a brief mention about this in #12601
With the generic tanks the % indication for any liquid is quite unintuitive now...

probably known thing, I just can't find it in the issues so I thought I'll bring it up.
If you have two tanks with the same liquid both full you will get 100% indicators... As the liquid gets used from one of the tanks it drops correctly up to the 50% mark... At the point when one of the tanks is sucked dry, instead of getting less than 50%, the indicators jump up to 100%, because the empty tank is not included in the calculations...

Can we maybe keep the liquid tag on a tank even after being sucked dry? It might show e.g. 0.0L Diesel, but the player will be allowed to put in another liquid to change that to another liquid if he so desires.. basically it will merely indicate the original purpose of the tank.

<Bug> <Enhancement / Feature> Vehicles

All 21 comments

Can we maybe keep the liquid tag on a tank even after being sucked dry?

IMO that's not a very good idea. A tank being empty means its contents.empty() == true.

How about displaying how many tanks it is? Then it'd go from 50%/2 to
100%/1.

This is a similar issue to what I brought up about designating tanks to use only one type of liquid. It was changed to this new system that allows any tank to carry any liquid without needing to install "water tank" or "diesel tank". I brought up the suggestion to be able to lock a tank to a certain liquid but it didn't receive much praise. This is more of a convenience bug than anything.

Speaking of fuel indicators, it'd be nice to have an energy level indicator while using gasoline/diesel, since it's possible to goof up and have it run dry because of fridge/lights/etc.

Your energy level indicator while using gas/diesel gave me an idea. How about adding a tool to show the exact numerical values of your batteries, gas/diesel tanks. Perhaps something like the lead acid battery testers. For the gasoline and other liquids there could be a gauge installed into the vehicle or something handheld.

I dig the gauges idea.

Gauges are really cool idea, which will kinda fix the messy % output as well.... Although I still think that even the % should be somehow fixed.

IMO that's not a very good idea. A tank being empty means its contents.empty() == true

Is that necessarily a problem? I'm not a programmer so not sure how or if that is possible. But what i meant is that a tank is shown as empty (so you can fill it with something else), but to add something like "last filled with" information for the percentage calculations and maybe even for some other use cases.

Is that necessarily a problem?

Not really a problem, more a complication of how containers and contents are handled everywhere, not just in vehicle examination window and HUD. A small UI improvement that potentially touches almost anything.

to add something like "last filled with" information

Hmm... Could work?..

  • Have a field like contents_residue, and update it when contents become empty or change.
  • Additionally consider contents_residue in HUD/UI when no contents (contents.empty() == true).

(Another approach snipped - it was awful.)


and maybe even for some other use cases.

One of those wonderfully horrible ideas: say, a bottle has sewage/gasoline residue; filling it with water makes the water "filthy"... X_X

Used that word on purpose. Anyway, this is OT.

Dropping a random thought here: is there anything wrong with simply displaying how many liters/gallons of fuel you have? It seems like that'd be a simpler and more intuitive approach than trying to implement new methods to obtain an accurate percentage across vehicle tanks that can have their contents change on a whim.

Dropping a random thought here: is there anything wrong with simply displaying how many liters/gallons of fuel you have?

Yep, would be a nice idea as well. It was mentioned above already in the form of the Gauges which is IMO very cool idea, but I would like to have it as an extra mod to vehicle with the default meter still showing % as we have now, just fixed.

Hmm... Could work?..

Ha, that contents_residue sounds exactly like what I was thinking.

One of those wonderfully horrible ideas: say, a bottle has sewage/gasoline residue; filling it with water makes the water "filthy"... X_X

I was thinking along similar lines here. But yeah that is OT, lets leave for later if it would be viable at all with contents_residue or other approach.

Suggest changing title of this issue to better describe the issue. I was searching for an issue about the player's inability to see the fuel gauge while driving, and thought this was it on reading the title, but after reading the description it sounds like something completely different.

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.

I don't think the issue is stale unless it's been fixed. It doesn't make sense to show 100% fuel when there is only 50% left.

The suggestions about a liquid tag, or indicating number of tanks, sound like wrong solutions. The driver of a vehicle doesn't need to know how many tanks there are (normally) - they only care how much fuel is left.

The correct solution is to fix the calculation so that it reports the actual percentage of fuel. If there is a switch to choose tanks, then we should probably show the amount of fuel in the currently selected tank. If there is no switch, then just show the actual amount in the vehicle, as a percentage of the maximum amount.

I agree, it's confusing to the point of being a UI bug so should be immune to being marked stale.

Percentage of maximum possible amount will lead to sillyness like the counter jumping from 100% to 50% when you empty a water tank since now that's a valid tank for gasoline.

I think the best solution is to store the last liquid that was in a tank, use that for calculating totals, in vehicle screen show the substance name in gray instead of its usual color.

The only problem is, how do you clear this tag or exclude a tank from it?

I think the best solution is to store the last liquid that was in a tank,

What about freshly installed tanks?

Simply don't store any info about its intended contents, it's not like it having this stored is critical for anything other than fuel and maybe auto-selecting the right container to pour water/mutagen/whatever into.

I think a better solution would be to evenly consume from tanks, not just the first tank, then the second, etc.
I'm not sure how difficult that would be to implement though.

Very easy, it's how it works for batteries allready.
However on not sure that's what we want to do since you can repurpose tanks, and that limits player flexibility.

So what should be shown when:

  • vehicle with 1 tank (full of gasoline) - add another tank - show 50% full or show 100% full? Logically it's the first: I can still fill stuff into the vehicle, so it can't be full.

  • vehicle with 2 tanks (one full of gasoline, one full of water) - add another tank - show 50% full for gasoline and for water or 100% full for both or something else? There is no logical solution to that: I can still put either liquid into the vehicle, so it's not full with either (100% would be wrong), but I also can't add the amount of one tank of gasoline and water into the vehicle (only 1 tank of gasoline or one tank of water).

  • vehicle with 3 tank (one full of diesel, one full of water, one empty) - remove the diesel tank - show what exactly?

The game doesn't know what you intend to put into the tank yet, therefore it should just show 100%, and only show 50% once the tank has previously held gasoline but is now empty, and if it's filled with water instead, gasoline jumps back up to 100% as there's only one, full, tank storing it now.

And if that doesn't sound good enough, why not just show the quantity in the UI, e.g. 2.3L clean water, 114L gasoline.

vehicle with 3 tank (one full of diesel, one full of water, one empty) - remove the diesel tank - show what exactly?

----, like what missing limb hp gets, as there is simply no storage identifiable as intended for gasoline.

Was this page helpful?
0 / 5 - 0 ratings