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

Fuel remaining wildly inaccurate #37943

Closed
Funguss opened this issue Feb 12, 2020 · 8 comments · Fixed by #59297
Closed

Fuel remaining wildly inaccurate #37943

Funguss opened this issue Feb 12, 2020 · 8 comments · Fixed by #59297
Labels
<Bug> This needs to be fixed Info / User Interface Game - player communication, menus, etc. Vehicles Vehicles, parts, mechanics & interactions

Comments

@Funguss
Copy link
Contributor

Funguss commented Feb 12, 2020

When 'e'xamining a vehicle you're driving the fuel remaining counter seems to calculate time until empty by using the old time format where one turn = three seconds. There may be other issues with it, but from some limited testing it seems that this accounts for most inaccuracy.

Steps To Reproduce

  1. Get an electric vehicle and attach a small (e.g. car) battery.
  2. Get up to a cruising speed of whatever you like.
  3. 'e'xamine and note the time remaining on the clock. Compare the time remaining every few turns. Minutes will tick by over a matter of seconds.

Versions and configuration

  • OS: Windows
    • OS Version: MINGW/CYGWIN/MSYS2 on unknown Windows version
  • Game Version: 0.D-12105-gda56791 [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    Aftershock [aftershock],
    C.R.I.T Expansion Mod [crt_expansion],
    Magiclysm [magiclysm],
    Makeshift Items Mod [makeshift],
    More Survival Tools [More_Survival_Tools],
    Mythological Replicas [nw_pack],
    Hydroponics [hydroponics],
    Mutant NPCs [mutant_npcs],
    No Rail Stations [No_Rail_Stations],
    Folding Parts pack [deoxymod],
    Vehicle Additions Pack [blazemod],
    Tanks and Other Vehicles [Tanks],
    Roadheader and other mining vehicles [Heavy miners],
    No Fungal Monsters [No_Fungi],
    Beta National Guard Camp [national_guard_camp]
    ]
jkraybill added a commit to jkraybill/Cataclysm-DDA that referenced this issue Feb 12, 2020
@jkraybill
Copy link
Contributor

I've submitted a work-in-progress PR to address this. It's still not 100% accurate but seems at least quite a bit better than what was in place. There was an off-by-6x error in the current code, but it was still quite off, so I reworked it. If my changes turn out to be off the mark (the code is surprisingly complex for this), just changing the off-by-6x thing may be determined to be a better interim measure.

@jkraybill
Copy link
Contributor

I closed my PR due to it being half-baked and a bit beyond my paygrade at this point. Unfortunately when I went back and tried again with a more modest attempt that just fixed the 6x issue, and changed the cruising estimate from 70 to 40, the projected fuel time was still massively off.

I think my PR had a decent idea - using actual recent fuel consumption to give the estimate - and I think I backed into a formula that was OK for the cases I tested at least (it was reasonably accurate at reasonable cruising speeds for diesel, gasoline, and electric), but this one needs an expert in fuel consumption and that's not me at this point.

@Funguss
Copy link
Contributor Author

Funguss commented Feb 13, 2020

Aww, no worries. Thanks regardless! There's also an issue with watt calculation, though I'm confused by what the charge of a battery relates to in terms of watts and watt hours.

@Funguss Funguss closed this as completed Feb 13, 2020
@Funguss
Copy link
Contributor Author

Funguss commented Feb 13, 2020

Oops. I wish there was a confirmation dialogue for that close and comment button.

@Funguss Funguss reopened this Feb 13, 2020
@jkraybill
Copy link
Contributor

Can you clarify what the issue is? Preferably with some examples or screenshots? It's entirely possible that is a different issue!

@mlangsdorf
Copy link
Contributor

Power generation should probably show 3 numbers: current power draw, current power generation, and nominal power generation. ie:
-75 W / +0 W / 200 W
for an electric car with the headlights on in the middle of the night. The headlights are drawing 75 W while the solar panels are currently producing 0 W but could produce 200 W.

Estimating time until a battery is drained should be easier: 1 W for 1 hour is 3.6 battery charges.

@Funguss
Copy link
Contributor Author

Funguss commented Feb 14, 2020

I'm not precisely sure what the issue is, I'm trying to figure it out. Wind turbines certainly behave differently - they give a block of X charges every minute or so instead of ticking every second.

After doing a little testing this seems to be the cause of my confusion previously. On top of this items the charger is currently charging aren't taken into account by the power display on the examine screen. I vaguely recall there being something else but it was probably nothing.

@Night-Pryanik Night-Pryanik added Info / User Interface Game - player communication, menus, etc. Vehicles Vehicles, parts, mechanics & interactions <Bug> This needs to be fixed labels Feb 22, 2020
@hexagonrecursion
Copy link
Contributor

The fuel indicator is so inaccurate and confusing that even simply removing it would be an improvement over the status quo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Info / User Interface Game - player communication, menus, etc. Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
5 participants