-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Thermal electric gear power draw reduction #78834
Conversation
Applied values from CleverRaven#78798 (comment) Changed: thermal socks power draw thermal suit power draw, battery flag, and default battery thermal gloves power draw thermal mask power draw thermal outfit power draw
3 hours is not enough to last a night sleep, so I don't think it counts as success. The character will freeze, and hurt themselves. So, I decided to re-do the math. From the #78798 (comment)
This is underestimation. The product page for ORORO Mini 5K battery (link) shows that the bank contains two 18650 cells internally, and the Q&A says:
If we use 7.4V number we get 4.8Ah * 7.4 V * 3600 sec/h ~128 kJ So the options we have [that would make the suit usable in practice] are either half the consumption, or up the battery size to Doing market research on these kinds of suits is surprisingly unpleasant, but here are two models that either include or suggest 10000mAh battery, which looks reasonably like a "small tool battery". So we can use them as a real-world reference. (even though it's technically can't fit into power tools. But I would think that's not a deal breaker). TL;DR: I believe the suit (and the full outfit) needs to use |
p.s.: sorry, I'm very tired, and missed the part where 5W draw was calculated on the assumption of the total battery capacity being 56kJ in the first place. So if total capacity is increased 2-4x then the draw would be increased 2-4x to accomodate. I did not double-check that math. But if the math is right, then it's surprising that we get only 3h of suit runtime in game when it has been calculated to last 8. Either way, my overall point is that the suit should last 8h+, and if the battery needs to be bigger to ensure that's the case - then we can use bigger batteries. But 8h should be the goal. |
I will make that change and move each piece up a battery tier! |
Moved all thermal electric gear up one battery tier (ultralight/small -> medium, medium -> heavy)
With the change to the tool batteries, the TE outfit lasts 28 hours with the big tool battery, and with a small tool battery it ran for about 14 hours and ~30 minutes. Is that too long? |
Several alternatives:
|
The small tool battery appears to be have a bit more capacity than two of the 10000mAh power banks used to power the outfit moxian linked, much like how one of those power banks is a bit more than two medium rechargeable batteries. You're supposed to use two in the outfit, so that small tool battery seems right. Since the IRL outfit uses two of those batteries (pls check my math) (2 * 128 kJ) / 8 hr / 3600 sec/hr = ~8.9 W So I'll round to 9 W and see if I get an ~8 hr runtime with a small tool battery. Do I need to add the ability to plug the suit into power grids in a separate PR? That linked outfit seems to connect to its two power banks with two USB ports, suggesting the item in game could be powered by other means like a power grid. One question I have is, will the outfit and constituent parts of it spawn as loot with tool batteries, or will that need to be addressed in a separate loot table pr? thermal electric outfit thermal electric balaclava thermal electric suit pair of thermal electric gloves pair of thermal electric socks |
Increased power draw for TE gear to a total of 9 W from 5 W.
Currently: small tool battery: a couple minutes under 8 hours |
Possible, but would likely be shot down on the grounds of realism and lack of IRL sources supporting the number.
I would not expect any commercial TE wear to require you be plugged into AC grid. It would be extremely awkward to use in most any real life situation. You'd be tripping over the cable constantly.
Last I heard, we are trying to move away from UPS for technical reasons, so please don't make it UPS.
I haven't found any mention of using two of those. I assumed it's a single 10000mAh power bank for the entire suit. Which is two times smaller than our
math checks out, and is consistent with your testing - our
I still maintain that it should be over 8 hours. Especially given that our batteries are 2x bigger than the suggested IRL counterparts. Additionally, reading this closer, I'm not sure where the specific small percents (3%, 4%, 5%) for the power consumption of individual pieces are coming from (#78798 (comment)). The current experimental has balaclava/gloves/socks all have the same (ridiculous, admittedly) power draw of 7.5W. I think it's worth preserving the uniformity both from maintenance standpoint (it's easy to have things uniform) and from realism standpoint (really, they have the exact same amount of heating elements, so no reason for them to differ in consumption). So - assuming you would touch the total power draw anyway - I would suggest redistributing it as 5%/5%/5%/85% instead of 3%/4%/5%/88%. For the numbers:
(and of course you don't need to follow the split exactly. Picking random "round" numbers from roughly that range would work perfectly fine too, say 3x 450mW + 7250mW = 8600mW or some such) AlternativelyIf you are tired of fiddling with the numbers and want to be done with it, then you can also just say "hey, the suit portion of the outfit lasts 8h! If you want the full outfit to last 8h+ - then either power the accessories separately, or get a bigger battery, ez!", and that's a fine answer too.
They should spawn with the new batteries. That's what There will be migration errors (#78530) , when people with saves from before this PR try to load their game after the PR , since the batteries are different, and the existing thermal suits would be soft-bricked (until people find new batteries for them), but that's fine. Many other items have suffered this fate already, and if we're bothered about it, we'd have to devise a new migration anyway, and that would cover your change too. So, tl;dr: there's nothing for you to worry about here. Although, having said that, I think it's fine to allow using And also also, looking at the code, you did change the battery for the outfit but not for the suit (unless i'm misreading this), which is almost as power-hungry, and should use the same power storage. |
In this (edit: wrong link, here's the right link) example, there's one power bank on the top half's left side and a second on the lower half's right side. The video was really clarifying in that regard; the top and bottom halves of the outfit are separate and so need their own individual batteries. I don't mind making the power draw 8, 8.8, 8.9, or 9 W; 8.8 W should get it to be just barely over 8 hours, but 8 W is satisfyingly round and gives a little buffer past 8 hours runtime so I'll use that. I assumed the percentage breakdowns were derived from total body coverage of the gear, but it makes sense for the power draw to be the same for the gloves, socks, and probably the mask (I could see an argument for the mask being bigger but meh). I'll make it 5% x 3 and 85% for the suit. Lastly, I'll update the flags to allow medium batteries on the suit and outfit too. I don't think I missed the suit for the flag and default battery, but I'll double check. Thank you all for your help, will push and test in a sec! |
Changed thermal electric gear power draws to a total of 8 W with a different ratio equalizing power draw between the balaclava, gloves, and socks. Added MEDIUM_BATTERY flags to the TE suit and outfit.
At 8 W, |
Oh, last thing: I am happy to add the ability to connect any/all thermal gear to a grid. Although it would be awkward to be limited by a cable, it is plausible enough that someone would connect to a grid to stay warm, particularly if they don't have a recharging station to charge their batteries with. I just need a little info on what to do there. |
LGTM
Personally I don't think that's necceessary, but I also wouldn't mind it at all. On a technical level, adding grid support would mean changing the
Adjust cable_length and charge_rate as appropriate (these specific values above I just copied from mp3 player) |
As far as I understand it, if you make an argument for why this is so, it will be accepted. Something like, in reality it runs on N battery, but we don't have such batteries. So the consumption is reduced to ... to get a commensurate run time.
What confuses me is that the charger is 5V. How do they charge a ~8V battery? So I'm assuming that's not true. But in principle it doesn't matter. There are no comments on my part. I'm happy with any outcome. And yes, you're right. When I calculated the %, I took the coverage of body parts. It's not perfect (and doesn't match reality), but in the game it is. Without going into details, the higher the area, the stronger the cooling. Which means you have to heat harder. (Or longer, but that can't be implemented in the game). By the way, do you have a desire to make two modes of operation for the suit? UPD. Regarding the power from the cable. I would suggest doing a separate PR so as not to deviate from the stated topic. |
I can't see a real world case where a cable hookup would make sense. I would expect this gear to be used outside, where there aren't any connection points available (and there are few cases where you'd use the gear without moving more than a few meters from the connection point anyway). If you're sleeping in it, I would expect that's because you don't have means to heat your environment (which may well be a tent out in the wilderness). That doesn't mean it is impossible to hook a suit up, especially since there aren't any consumer protection enforcement to stop you from frying or cooking yourself, but any such capability should be a modded functionality, not a standard one. |
The use cases:
The cable length can be extended with extension cords. When connecting other tools to the power grid, the main benefit is that I don't have to micromanage batteries. So I need to add the "link up" bit to the use action. I'll do it for the suit and outfit. I'll make cable length 3 and the power draw equivalent to the default. I'm interested in doing two power modes for the suit and the outfit (could do the gloves, socks, and mask too, what do you think?)! Where do I start? |
There's no easy way, our codebase does not really support that. I see three potential options:
Either way, I would suggest limiting the scope of this PR to roughly what you have right now so as not to get lost in this. You can always make more PRs expanding on your work! |
I agree that cable and multiple modes are better done as separate PRs. Just in case the boss says “we don't need it”. So I'll put it under a spoiler. Here's the code for the suit: Details {
-- "id": "thermal_outfit",
++ "id": "test_thermal_outfit",
"type": "TOOL_ARMOR",
"category": "clothing",
"symbol": "[",
"color": "light_gray",
++ "name": { "str": "TEST thermal electric outfit" },
"description": "A suit of thin thermal underwear that covers you from head to toe and is equipped with internal battery-powered heating elements. Use it to turn it on.",
"flags": [ "VARSIZE", "SKINTIGHT", "WATER_BREAK" ],
"price": "300 USD",
"price_postapoc": "7 USD 50 cent",
"material": [ "cotton" ],
"weight": "5748 g",
"volume": "4500 ml",
"ammo": "battery",
-- "use_action": {
-- "type": "transform",
-- "msg": "You activate your %s.",
-- "target": "thermal_outfit_on",
-- "active": true,
-- "need_charges": 1,
-- "need_charges_msg": "The %s's batteries are dead."
-- },
++ "use_action": [
++ {
++ "type": "transform",
++ "menu_text": "Turn on: normal mod",
++ "target": "test_thermal_outfit_on",
++ "active": true,
++ "msg": "You activate your %s.",
++ "moves": 100,
++ "need_charges": 1,
++ "need_charges_msg": "The %s's batteries are dead."
++ },
++ {
++ "type": "delayed_transform",
++ "menu_text": "Turn on: light mod",
++ "target": "test_thermal_outfit_light_mod_on",
++ "transform_age": 0,
++ "not_ready_msg": "debug msg",
++ "active": true,
++ "msg": "You activate your %s.",
++ "moves": 100,
++ "need_charges": 1,
++ "need_charges_msg": "The %s's batteries are dead."
++ },
++ { "type": "link_up", "cable_length": 1, "charge_rate": "0 W" }
++ ],
"warmth": 10,
"material_thickness": 0.1,
"pocket_data": [
{
"pocket_type": "MAGAZINE_WELL",
"rigid": true,
"flag_restriction": [ "BATTERY_MEDIUM", "BATTERY_HEAVY" ],
"default_magazine": "heavy_battery_cell"
}
],
"armor": [
{
"coverage": 100,
"covers": [ "head", "mouth", "torso", "arm_l", "arm_r", "leg_l", "leg_r", "hand_l", "hand_r", "foot_l", "foot_r" ]
}
]
},
{
-- "id": "thermal_outfit_on",
-- "copy-from": "thermal_outfit",
++ "id": "test_thermal_outfit_on",
++ "copy-from": "test_thermal_outfit",
"type": "TOOL_ARMOR",
-- "name": { "str": "thermal electric outfit (on)", "str_pl": "thermal electric outfits (on)" },
++ "name": { "str": "TEST thermal electric outfit (on)", "str_pl": "TEST thermal electric outfits (on)" },
"description": "A suit of thin thermal underwear that covers you from head to toe and is equipped with internal battery-powered heating elements. It is currently on, and continually draining batteries. Use it to turn it off.",
"flags": [ "VARSIZE", "SKINTIGHT", "TRADER_AVOID" ],
-- "power_draw": "130 W",
-- "revert_to": "thermal_outfit",
++ "power_draw": "8 W",
++ "revert_to": "test_thermal_outfit",
-- "use_action": {
-- "ammo_scale": 0,
-- "type": "transform",
-- "menu_text": "Turn off",
-- "msg": "Your %s deactivates.",
-- "target": "thermal_outfit"
-- },
++ "use_action": [
++ {
++ "type": "transform",
++ "menu_text": "Turn off",
++ "target": "test_thermal_outfit",
++ "ammo_scale": 0,
++ "msg": "Your %s deactivates.",
++ "moves": 100
++ },
++ {
++ "type": "delayed_transform",
++ "menu_text": "Turn on: light mod",
++ "target": "test_thermal_outfit_light_mod_on",
++ "transform_age": 0,
++ "not_ready_msg": "debug msg",
++ "active": true,
++ "msg": "You activate your %s.",
++ "moves": 100,
++ "need_charges": 1,
++ "need_charges_msg": "The %s's batteries are dead."
++ },
++ { "type": "link_up", "cable_length": 1, "charge_rate": "0 W" }
++ ],
"warmth": 60
},
++ {
++ "id": "test_thermal_outfit_light_mod_on",
++ "copy-from": "test_thermal_outfit",
++ "type": "TOOL_ARMOR",
++ "name": { "str": "TEST thermal electric outfit (light mod on)", "str_pl": "TEST thermal electric outfits (light mod on)" },
++ "description": "A suit of thin thermal underwear that covers you from head to toe and is equipped with internal battery-powered heating elements. It is currently on, and continually draining batteries. Use it to turn it off.",
++ "flags": [ "VARSIZE", "SKINTIGHT", "TRADER_AVOID" ],
++ "power_draw": "4 W",
++ "revert_to": "test_thermal_outfit",
++ "use_action": [
++ {
++ "type": "transform",
++ "menu_text": "Turn off",
++ "target": "test_thermal_outfit",
++ "ammo_scale": 0,
++ "msg": "Your %s deactivates.",
++ "moves": 100
++ },
++ {
++ "type": "delayed_transform",
++ "menu_text": "Turn on: normal mod",
++ "target": "test_thermal_outfit_on",
++ "transform_age": 0,
++ "not_ready_msg": "debug msg",
++ "active": true,
++ "msg": "You activate your %s.",
++ "moves": 100,
++ "need_charges": 1,
++ "need_charges_msg": "The %s's batteries are dead."
++ },
++ { "type": "link_up", "cable_length": 1, "charge_rate": "0 W" }
++ ],
++ "warmth": 35
++ } Some of the changes are due to me testing things by adding copies through my mod. That's why the id and names have been changed. P.S. For a more classic version, you can look at an example:
|
I'll open another PR for cables, then multi mode! I'll wait until this one's merged. Happy New Year, y'all! |
Summary
Balance "Thermal electric gear power draw reduction + medium battery for TE suit"
Purpose of change
Currently, the thermal electric (TE) outfit eats through a medium battery in seven minutes. This PR reduces the power draw of all TE gear to a total of 5 W for the TE outfit. It also changes the TE suit to use a medium battery instead of a light one, along with changing the battery flags for that item. See IdleSol's comment in Issue #78798
Describe the solution
Applied values from here to TE gear. Also changed TE suit magazine flag restriction to BATTERY_MEDIUM and default magazine to medium_battery_cell
Changed:
Describe alternatives you've considered
Considered letting the TE suit also reload with light batteries, but the outfit doesn't take light batteries so I stuck with what IdleSol said. Also considered lowering the power draw to a total of 4 or even 2 W, but 5 W is manageable.
Testing
Applied changes to local copy
Reloaded thermal electric outfit with medium battery
Turned it on, lasted from 2:20PM to 5:20PM. Success!
Additional context
Previous time on was around seven minutes, and 5 W is manageable (though it could be lower) for mutant cyborg psychics in a way that 130 W was not.