Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upvehicle: display engine power and electrical drain/production #27089
Conversation
mlangsdorf
added this to In progress
in Extended Vehicle Tune-Up
via automation
Dec 13, 2018
This comment has been minimized.
This comment has been minimized.
|
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: |
BevapDin
reviewed
Dec 14, 2018
src/veh_interact.cpp Outdated
BevapDin
reviewed
Dec 14, 2018
| 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.
This comment has been minimized.
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.
This comment has been minimized.
mlangsdorf
force-pushed the
mlangsdorf:vehicle_power_display
branch
from
c4af7ca
to
34574dd
Dec 14, 2018
mlangsdorf
changed the title
[WIP] vehicle: display engine power and electrical drain/production
vehicle: display engine power and electrical drain/production
Dec 14, 2018
Night-Pryanik
reviewed
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.
This comment has been minimized.
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.
This comment has been minimized.
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
self-assigned this
Dec 14, 2018
mlangsdorf
force-pushed the
mlangsdorf:vehicle_power_display
branch
from
34574dd
to
828850f
Dec 15, 2018
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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. |
mlangsdorf commentedDec 13, 2018
•
edited
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 prettierIn a luxury RV, with the engine idling and most of the power consuming stuff off.
Same RV, cruising at 66 mph, with the floodlights on.