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 upSimple car electric circuits - Give option so that consuming devices not touch the dedicated engine battery. #24871
Comments
This comment has been minimized.
This comment has been minimized.
|
Looking at the code, I think this is pretty simple. I would probably implement it as a "Isolate engine batteries" menu option in the electronics control battery. That option would only appear if a vehicle has 2+ batteries and 1 or more of them is located on an engine and 1 or more of them is not. I'd want to add fields to vehicle_part to let an engine track the batteries and alternators associated with it. It's low priority but I'll note it. |
This comment has been minimized.
This comment has been minimized.
sfsworms
commented
Aug 16, 2018
|
Is the requirement that the dedicated "engine battery" only get power from the alternator of the engine needed? |
This comment has been minimized.
This comment has been minimized.
|
It would prioritize recharging of the main battery, also a good addition. |
This comment has been minimized.
This comment has been minimized.
|
Having a way to specify/change charging priority would be nice too. If I wanted to put in a battery into my swappable case have it charge it up real quick so I can put it back in my scooter type of situation. Alternatively, and I'm not sure how difficult this is, I think the charging system needs to be reworked a bit. Real world it should charge all the batteries simultaneously, not one at a time. |
This comment has been minimized.
This comment has been minimized.
|
If you isolate the engine circuit, excess alternator generation is going to go to the engine battery first, and only when that battery is fully charged will excess generation be fed back into the main system. That's probably the easiest way to handle it. A battery priority scheme runs into the issue that (aside from a battery mounted on the same tile as a specific engine), it's a hassle to know, game turn from game turn, where that battery actually is. Equal distribution among all batteries is doable (I think), and greedy engine batteries is doable, but I'd dubious about my ability to keep track of the 4th storage battery after the vehicle has been in a collision and had some parts destroyed. |
This comment has been minimized.
This comment has been minimized.
CoroNaut
commented
Aug 17, 2018
|
Instead of having to set a specific battery to store charge for the engine, could we implement a "starter battery" object or something similar that doesn't (or does) show up in the battery list? This way, you can rely on your car even if all batteries are 0%, the starter battery will come through for a couple attempts to start it up. This will automatically make it separate from regular batteries and the code would simply allow it to not discharge for anything but the vehicle engine. |
This comment has been minimized.
This comment has been minimized.
|
I feel like this is going to lead to more trouble than it's worth. Charging priority is a non-starter, it would be a hassle to manage, and generally speaking circuits dont work like that, at a minimum you need some device to manage it. Say you isolate some of your vehicle appliances, are you specifying the whole circuit? Because if the appliance is isolated it means its drawing from a seperate battery, and that battery is either discharging and will run out (and then become useless), or has a dedicated alternator, so now you have two independent circuits. Can you make more than two circuits? Is there a menu listing your circuits and what is as reached to each one? Are the circuits set up at installation time or are you switching them while the car is already assembled? This ends up sounding like a lot of work to make cars act a lot less like they do IRL and solve a pretty trivial problem. |
This comment has been minimized.
This comment has been minimized.
|
I gave the proposed implementation I did because I have been poking through the vehicle code a bit recently, and the engine + alternator + battery on an isolated circuit is something I am reasonably sure that can be implemented:
Electrical engineering wise, feeding all the current from an alternator to a specific battery until it's full and only then opening a way feed current to the rest of the vehicle requires some clever use of diodes but certainly doable in the age of semi-conductors. This implementation would not support multiple circuits. It wouldn't isolate subsets of vehicle appliances, which would be a huge design hassle, if it's even possible. It wouldn't let you have some engines that are isolated and others that aren't: the toggle would be vehicle wide. It wouldn't even let you put a fridge on an engine with a battery and an alternator, isolate the engine battery, and power the fridge off a dedicated generator. It would solely be a solution to the specific desire to not have secondary appliances steal from the starter battery. |
Androwski3000 commentedAug 16, 2018
Have you ever jumped out of the car with the headlights still on without noticing?
In the game Factorio you can create simple logic circuits for your factory needs. When you have full accumulators from solar power you want to use that first. Only if the accu´s are empty the coal power shall kick in. The player can craft a circuit to make that happen.
What would be great in CDAA would be an option on cars to make all power consumtion on a car not touch the battery dedicated to the engine. So that you always have a vehicle being capable of starting.
So that fridge, lights, etc only operate from the storage battery.