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: display engine power and electrical drain/production #27089

Merged
merged 1 commit into from Dec 16, 2018

Conversation

6 participants
@mlangsdorf
Copy link
Contributor

commented Dec 13, 2018

Summary

SUMMARY: Features "vehicle: display engine power and electrical drain/production"

Purpose of change

Without reading the code and the JSON, it is very difficult to understand how much engine power a vehicle has, whether it is producing or draining electrical energy, and how long it can run until it runs out of fuel, and the last one is hard to figure out even with access to the code and JSON.

Add some information to the vehicle interaction window to display total effective engine power, net electrical power consumption or production, and rough estimates of how long the fuel is going to last or when the batteries are going to get recharged.

Describe the solution

Add displays for total engine motive kW at safe and max levels, the next electrical power consumption/drain, and the amount of time it will take to completely refill or exhaust each type of
fuel.

Describe alternatives you've considered

I can probably do more along these lines, but this is good for start and I'd rather get the functionality out now than hold it up while I perfect it.

Additional context

Still really buggy.
TODO list
-[x] Display total effective engine power
-[x] Display nominal current electrical power (accounts for solar panels but not reactors or current sunlight
-[x] Display how long until active engines burn through their fuel
-[x] Display how long until the alternator or solar panels recharge the batteries
-[ ] Display when dirty water tanks being fed by funnels will be refueled (stretch goal)
-[ ] Make some of the columns in the center of the vehicle interaction window prettier

vehpowdispphase3
In a luxury RV, with the engine idling and most of the power consuming stuff off.

vehpowdispphase3b
Same RV, cruising at 66 mph, with the floodlights on.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Dec 13, 2018

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/concerning-the-new-power-to-wheel-to-weight-ratio-calculation/17854/38

Show resolved Hide resolved src/veh_interact.cpp Outdated
status_color( use_aid ), qual.obj().name.c_str(), lvl,
status_color( use_str ), str ) << "\n";

std::string install_color = string_format( "<color_%1$s>", status_color( ok || g->u.has_trait( trait_DEBUG_HS ) ) );
std::string install_color = string_format( "%1$s", status_color( ok || g->u.has_trait( trait_DEBUG_HS ) ) );

This comment has been minimized.

Copy link
@BevapDin

BevapDin Dec 14, 2018

Contributor

The format string "%1$s" is a bit useless. In fact, it's completely useless. It will be replaced by the argument string and no additional formatting will happen.

string_format( "%1%s", whatever ) == whatever;

This comment has been minimized.

Copy link
@mlangsdorf

mlangsdorf Dec 15, 2018

Author Contributor

Added translation notes.

@mlangsdorf mlangsdorf force-pushed the mlangsdorf:vehicle_power_display branch from c4af7ca to 34574dd Dec 14, 2018

@mlangsdorf mlangsdorf changed the title [WIP] vehicle: display engine power and electrical drain/production vehicle: display engine power and electrical drain/production Dec 14, 2018

std::string units;
if( fuel_data != fuel_usages.end() ) {
rate = consumption_per_hour( fuel_type, fuel_data->second );
units = _( "mL" );

This comment has been minimized.

Copy link
@Night-Pryanik

Night-Pryanik Dec 14, 2018

Member

Do we really need milliliters here? The tanks capacity in the vehicle examination screen is in liters.
Furthermore, players may use cups or quarters for volumes.

This comment has been minimized.

Copy link
@mlangsdorf

mlangsdorf Dec 15, 2018

Author Contributor

I'm just going to put it in percents for the general display, and leave mL for the debug display.

@ZhilkinSerg ZhilkinSerg self-assigned this Dec 14, 2018

vehicle: display engine power and electrical drain/production
Add displays for total engine motive kW at safe and max levels,
the net electrical power consumption/drain, and the amount of
time it will take to completely refill or exhaust each type of
fuel.

@mlangsdorf mlangsdorf force-pushed the mlangsdorf:vehicle_power_display branch from 34574dd to 828850f Dec 15, 2018

@GoLoT

This comment has been minimized.

Copy link
Contributor

commented Dec 15, 2018

Just throwing an idea: Add skill checks the same way the spoiling time feature does with cooking.

It could be a flat level requirement to have the information displayed or maybe make it more detailed based on your skill levels (a rough estimate at very low levels and a more accurate estimation at high levels, maybe showing more of the hidden values with extra skill levels).

Driving could be used for the gas estimation part and electronics for the batteries. Or a mix of both. And then a vehicle part could be added, one that is tied to a dashboard or electronics control unit and bypasses the requirements giving accurate readings.

@mlangsdorf

This comment has been minimized.

Copy link
Contributor Author

commented Dec 15, 2018

The fuel estimate is already pretty inaccurate: it's a rough estimate of how much fuel your vehicle consumes at idle (if you're at 0 mph) or at safe speed on pavement (if you're faster than 0 mph) and is +/- 50% even within that range due to rounding errors and whatnot. Same with the battery estimate, except that's worse because it depends on the electrical power estimate.

Engine kW is 100% accurate, but you can find that information by reading the JSON and I'd rather have the exact number so I can debug people's problems more easily.

Net electrical power is nominal, and overestimates the contribution of solar panels, which may not actually be generating any power if it's raining or at night.

Adding an estimate would complicate code that is already pretty complicated, and add uncertainty to values that are already fairly approximate.

@kevingranade kevingranade merged commit bc4013f into CleverRaven:master Dec 16, 2018

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
gorgon-ghprb Build finished.
Details

Extended Vehicle Tune-Up automation moved this from In progress to Done Dec 16, 2018

@mlangsdorf mlangsdorf deleted the mlangsdorf:vehicle_power_display branch Dec 16, 2018

@ZhilkinSerg ZhilkinSerg removed their assignment Dec 16, 2018

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.