Is your feature request related to a problem? Please describe.
So, yes, you have TONS of batteries installed on your awesome mobile base. And you want to charge this one car battery/small storage battery you have on your cart/in your hand? Well, you can't..you gotta wait for the TOP battery to be done first! And how long will that take..? Oh I don't know, probably a couple of hours in-game..oh look, sun's down.
Describe the solution you'd like
Kevin did mention this before, probably a year ago or so, that he would make batteries charge evenly, or rather, charge the lowest first. Shouldn't be too hard...right?
Describe alternatives you've considered
Maybe the ability to rearrange battery slots? Or tank slots? That would be neat too.
Additional context
Thanks again for making the Favorites tab! And again, just like the last suggestion I made, any other sorts of suggestions are more than welcome! Might even motivate devs to pick this suggestion up! c:
I'm sure this issue was raised several times in the past, though I'm not sure was it on forums only or here on github too.
Kevin did mention it would be an easy fix. Though, that might be just my memory failing me.
in src/vehicle.cpp, the charge_battery() function would need to have two loops where it has one: the first one to count all the battery parts, the second to divide the amount among each battery.
ideally, the counting would be moved to vehicle::refresh() (also in src/vehicle.cpp), and a battery cache would be added to src/vehicle.h like the other caches that are updated in refresh().
This is a great first issue for someone with some familiarity with programming who wants to get involved in CDDA's vehicles code.
As a in-game workaround for energy issues for bases, right now I do recommend a makeshift steam engine with a bunch of alternators on it. It uses surprisingly little fuel, and said fuel is quite easy to get once you are even slightly established, and can keep your electricity needs even if you uses massive amounts of it. Even more so if you manage to get a 7.5kw generator as well.
That said, back on the suggestion, charging evenly also has to consider full batteries, and for them not to drain further. And even assuming all charge is inserted, it doesn't really make much of a difference in terms of charging batteries other than the first, and in fact will take it even longer to fill the following batteries if you have more than two installed. It would work to give a little bit of charge, if that's all you need, but I've yet to see a situation where a character has both a base and need just a starter charge in a battery.
The implementation I'd prefer would be to scan the batteries and simply recharge the lowest charged (by proportion) battery for any given charge action.
That's what you mentioned before in Discord! It does sound less complicated to charge the lowest first.
That would handle the risk of "wasted charging" if there were multiple batteries, but still, I do have to ask what it would achieve. Having a bunch of half charged batteries is not really any more useful than a few fully charged ones and a few empty ones. In fact, in most situations, specially if you are charging multiple batteries, it's worse than charging them in order.
I would in fact prefer it was implemented as an switchable option or as a mod, not just changed with no option to keep the old way.
Should be fixed in #27122.
Most helpful comment
That would handle the risk of "wasted charging" if there were multiple batteries, but still, I do have to ask what it would achieve. Having a bunch of half charged batteries is not really any more useful than a few fully charged ones and a few empty ones. In fact, in most situations, specially if you are charging multiple batteries, it's worse than charging them in order.
I would in fact prefer it was implemented as an switchable option or as a mod, not just changed with no option to keep the old way.