CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.34k stars 4.14k forks source link

Electric Chainsaws drain batteries after just one cut #35203

Closed Odieman1 closed 4 years ago

Odieman1 commented 4 years ago

Describe the bug

Electric Chainsaws can't realistically cut a single tree. Using disposable batteries (the 1200 ones), you may be able to cut down two with 0 charge left.

Steps To Reproduce

  1. Acquire Electric Chainsaw and applicable batteries
  2. Observe battery level before and after the tree has been cut

Expected behavior

Looking online, Electric chainsaws can last as long as an hour on rechargeable batteries. They can cut through a log pretty quick, in less than a minute. Unless this is some sort of shrubbery chainsaw, then a standard electric chainsaw should act as a slightly more time consuming standard gas chainsaw with a decent amount of trees to be felled before requiring a recharge.

Keep in mind reading recent articles about electric vs gas chainsaws, as I was a bit disheartened to read an article from 2008 saying a single tree per single battery, but then found an article from 2019 that said electric chainsaws are on the same league as gas chainsaws now. CDDA seems to take place in some alternate universe where electric and solar seems to be a bit more advanced compared to reality anyway.

Screenshots

I shouldn't need to screenshot this, but if it's needed I can show it...

Versions and configuration

Build #9842 0.D Electric Chainsaws are in the base game, and no mods change them to my knowledge.

kevingranade commented 4 years ago

Some very brief research says that electric chainsaw battery packs can range from 400 to 800 Wh, have a runtime from 200 to 400 seconds, and weigh 3-5 lbs. A VERY quick adjustment is to switch to the heavy battery pack for these instead of the medium, but that leaves us far short, so we could also considering either doubling the size (weight,volume,capacity) of the heavy battery pack or adding a new one with these stats.

Source: http://tcimag.tcia.org/publication/?i=539289&article_id=3228578

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not \'bump\' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

Zourin2 commented 4 years ago

This was supposedly fixed in #33154 but appears to have broken. Gas and electric chainsaws and circular saws are consuming 100% charges for single actions, confirmed as per Build 9979

The gas chainsaw consumes approximately 5 chareges every 3 seconds (I assume the electric does as well). This gives it an effective run time of under 4.5 minutes (assuming you succeed in starting it on the first pull, which takes 5 charges). Felling a tree takes 10 minutes, and cutting logs takes 7ish minutes, meaning the chainsaw actually runs out of fuel halfway through and the game just 'wings it' for the rest of the construction task.

If an electric chainsaw is having the same issues, then it's in the balance between consumption rates and task completion time. First, it's easily taking 5-10x too long (most YT videos complete the task in under a minute easy with five minutes or so of jabber) to complete these woodcutting tasks, and/or the charge consumption per-second is too high (which is also mostly true, at least for gas-fueled). On the first point, it can easily take less than sixty seconds to fell a tree or make simple cross-cuts. On the second, a gas operated chainsaw can operate for easily 30+ minutes, compared to the 4 minute representation in-game. The electric chainsaw seems to be on the raw end of the deal, as is the circular saw, as it's getting short-changed mostly on the task-duration end, and it's something that could probably err on the side of generous rather than onerous in this case.

Either way, operable lifespan needs to be extended to meet realistic expectation. I'm not sure where deliberating over wattage delivers a tool that delivers a real-world level effect. It may be more productive to work a solution back from an endpoint and handwave minor details. Pardon the pun, but "missing forest for the trees".

24634 largely adjusted work times in 2018 down to supposedly the 6 minute mark or so on just 'tool abstraction' (which also appears to be behaving oddly based on my tests), but we aren't quite living the dream when we see a circular saw.

Davi-DeGanne commented 4 years ago

This was supposedly fixed in #33154 but appears to have broken.

No, that PR adjusted gas chainsaws, it didn't touch electric. Please keep the discussion here focused on electric chainsaws

Gas and electric chainsaws and circular saws are consuming 100% charges for single actions, confirmed as per Build 9979

Yes, this is a very widespread bug caused by #35896 due to either inattention to copy-from or misunderstanding of the effects of charges_per_use , or both. It is causing chainsaws, rm13 armor, circular saws, and lots of other things to go through fuel 5x as fast as intended.

EDIT: Disregard this, I was wrong, I dont think this was affecting tools with power_draw instead of turns_per_charge like the electric chainsaw (as pointed out below by @Night-Pryanik and myself).

Night-Pryanik commented 4 years ago

35896 doesn't increase consumption rate of electric chainsaws to the point that they are able to cut down only one tree. To test it, just fully remove charges_per_use field from elec_chainsaw_off and see the consumption rate of the chainsaw. These chainsaws fully drained their battery after one cut even pre-#35896.

Code explicitly states that game reads either charges_per_use or power_draw fields. https://github.com/CleverRaven/Cataclysm-DDA/blob/72dbda868da802919366b475105d40aa5191224e/src/item.cpp#L8854-L8863 So adding charges_per_use does not increased consumption rate five times, it overrided previous 2000000 mJ power_draw. It increased consumption rate twofold, but even without that consumption rate was too high and allowed cutting of only one tree.

Davi-DeGanne commented 4 years ago

Hmm, I actually don't think charges_per_use does override power_draw in this case. As long as turns_per_charge is at its default value of zero. In the above snippet, charges_per_use doesn't enter into things until ammo_required() is called.

Still, I added "charges_per_use": 0 to this and other "on" tools with power_draw, because I don't think the inheritance of charges_per_use by the "on" variants was intentional, as it wasn't indicated or justified in #35896.

Zourin2 commented 4 years ago

Circular Saw is attempting to draw ~1430 charges for a single Log > 10 plank action, and it takes 20 minutes. By default it appears with a Medium battery (500 charge), but is attempting to consume more power than is in a High Capacity Heavy Battery (1250 charges). When turned on, it drains approximately 1 charge per turn.

Here's the fun thing. It ALSO takes 20 minutes to do the same job with a wood saw (both are rated Wood Sawing 2). While the item should probably be set to be Wood Sawing 4 rather than 2, changing this does not alter the power demand.

As of Build #10010

Davi-DeGanne commented 4 years ago

The power draw is not the problem, to be clear. 60V * 20A = 1200W =1,200,000mW which matches this entry perfectly: https://github.com/CleverRaven/Cataclysm-DDA/blob/9b667e7b828512f7a8b429f6c3e3c5d4f155a0df/data/json/items/tools.json#L1295 The sawing speed and battery capacity could certainly use a reality check though. I believe battery charges are in kJ, though I could be wrong.

kevingranade commented 4 years ago

My relatively brief research indicated that either doubling the stats (volume, weight, charge) ofvtge heavy battery pack, or adding a new 'largest portable battery pack' as "industrial battery" with those stats would be reasonable.

Possibly even larger, I don't remember the precise details.

Zourin2 commented 4 years ago

The weight of a 60v battery pack used for most of these tools are about 3lbs and are actually pretty small (fist-sized). Admittedly, I'm not sure of the output amps, just the amp-hours (9ah) which are very different. Just thought I'd mention it, since I happened to see some 2-packs at Home Depot.

Some extra research indicates it's not unusual to rotate through about 4 batteries for continuous operation. As a result, I am now inundated with ads for lumber tools and videos about woodworking, so I hope this is going somewhere. :)

Again, task completion time seems to be the issue, as it assumes constant operation as though it were cutting through extraordinarily thick/long trunks (which they are not)

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not \'bump\' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

stale[bot] commented 4 years ago

This issue has been automatically closed due to lack of activity. This does not mean that we do not value the issue. Feel free to request that it be re-opened if you are going to actively work on it