Game version:
0.C-24022-gcbad6e7 (tiles)
Operating system:
Windows 7 Professional x64 SP1
Tiles or curses:
Tiles
Mods active:
"type": "MOD_INFO",
"ident": "user:default",
"dependencies": [
"dda",
"Experimental-Z-Level",
"Medieval_Stuff",
"More_Survival_Tools",
"No_Fungi",
"StatsThroughSkills",
"blazemod",
"Tanks",
"boats",
"deoxymod",
"filthy_morale",
"makeshift",
"more_classes_scenarios",
"more_locations",
"national_guard_camp",
"no_npc_food",
"no_rivtech_guns",
"novitamins",
"realguns"
Charge lowest capacity batteries first OR let the user pick which battery type or specific battery to charge first.
The batteries that were installed first get charged first.
Install a few storage batteries, car batteries, and motorcycle batteries on a vehicle and watch them being charged by an alternator or solar panel/s.
The reason I'm asking for this change is because I like to use battery compartment mods and when I'm using a electric car, the storage batteries get charged first since I never really take them off.
A "Priority battery charging station" item could be added and made to be attachable to a vehicle similar to the storage battery case. Therefore, any battery placed in this special battery case will try to be charged first, or even take charge from other batteries to fill it completely.
If you don't add a special vehicle item to make this happen, my second vote would be toward allowing the user to select the priority for each battery. Make the default priority at (0), and have it go to (99) where (99) charges first.
If you do make the code charge the lowest capacity batteries first, I can see the usage, but it might be a little intensive on performance to search for the battery with lowest charge each tick.
I really like the idea of giving some batteries priority seeing as they already charge in a predefined order.
I think it should be coded as priorities that way you can change it any which way later. Set some defaults as well like:
Small Storage | Medium Storage | Storage | Motorbike | Car | Swappable | Priority charger
--------------- | ------------------ | -------- | ----------- | --- | ------------- | -----------
50 | 45 | 40 | 10 | 25 | +11 | +20
maybe even have like >85% charged -> +20 priority
If you do make the code charge the lowest capacity batteries first, I can see the usage, but it might be a little intensive on performance to search for the battery with lowest charge each tick.
Battery order could be kept somewhere. By sorting batteries by charge and keeping that saved, only two batteries would need to be checked each time the charging triggers - the charged battery and the one right after it. Unless that change caused them to swap places, then other batteries would need to be checked too.
Charging all the batteries evenly (each unit of charge goes to the battery with the lowest charge, probably proportionally rather than by comparing absolute charge) would be straightforward and reflect the way battery systems work IRL. This kind of thing would be pretty trivial to handle efficiently.
Disconnecting batteries you don't want charged or discharged is another scheme that is used IRL, particularly in marine environments where having a charged spare is a safety issue, this would also be simple to implement.
A priority system starts departing from reality, doesn't sound like it solves a real need, and would have a more complex ui.
A simple tweak would be to add Batteries could be added as compatible items that can be placed in a UPS-compatible recharging station.
Making it work via priorities at the code level will allow for easy tweaking and future changes. Make priority "0" be "disconnected" and won't charge. Then give the player limited charging control options such as:
Disconnect Battery -> sets priority = 0. won't charge
Smallest First -> priority = 100/size
Larges First -> priority = size
Evenly -> priority = 1/%charge
Fill Up -> priority = %charge
That should squash the UI interface problem a bit but allow changes to stuff later.
A priority system starts departing from reality, doesn't sound like it solves a real need, and would have a more complex ui.
IRL everything is going to be proportionally charged because they going to wired in parallel effectively becoming one big battery because it's the simplest way and there is usually no reason to do otherwise. Really, batteries should be made to even themselves out. (putting a 100% car battery in a dead car will result in two 50% batteries after some time)
That said, if do have an electrical system that keeps your batteries separate for some reason, a priority system is not any more complicated to build. By wiring the chargers in series, the first one would receive twice the power of the second.
On further thought, how about having vehicles by default charge proportionately evenly and then potentially having a new part that allows for other options.
Closed by #27122
Most helpful comment
Charging all the batteries evenly (each unit of charge goes to the battery with the lowest charge, probably proportionally rather than by comparing absolute charge) would be straightforward and reflect the way battery systems work IRL. This kind of thing would be pretty trivial to handle efficiently.
Disconnecting batteries you don't want charged or discharged is another scheme that is used IRL, particularly in marine environments where having a charged spare is a safety issue, this would also be simple to implement.
A priority system starts departing from reality, doesn't sound like it solves a real need, and would have a more complex ui.