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.
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.
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.
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.
Oops. I wish there was a confirmation dialogue for that close and comment button.
Can you clarify what the issue is? Preferably with some examples or screenshots? It's entirely possible that is a different issue!
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.
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.
The fuel indicator is so inaccurate and confusing that even simply removing it would be an improvement over the status quo.
Most helpful comment
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.