CleverRaven / Cataclysm-DDA

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

Basecamp crafting limits electric forge charge usage #60248

Closed Shados closed 2 years ago

Shados commented 2 years ago

Describe the bug

When using the basecamp crafting functionality, the basecamp can make use of any electric forges set up as apppliances or vehicles and placed within a Basecamp: Storage zone. However, instead of being able to make use of the full amount of energy storage connected to said forge, it can only seem to use up to 1,000 charges at a time (possibly the forge has an internal charge buffer of that size?).

I have a suspicion that the same behaviour happens with other powered appliance/vehicle tools, but I've not actually tested any.

Steps to reproduce

  1. Place an electric forge (or forgemaster) as an appliance, somewhere in a basecamp, ideally one with some smithy upgrades.
  2. Place a fully-charged large storage battery next to it as an appliance.
  3. Add both to a Basecamp: Storage zone.
  4. Add 300 scrap metal and 100 planks to the basecamp storage (enough to make 100 pliers).
  5. Open the bulletin board, go to the smithy/workshop menu, attempt to craft pliers.
  6. See that the batch size maxes out at 10 instead of 100.

The same happens with any craft or batch size that would require > 1,000 charges.

Expected behavior

I expect that basecamp crafting should be able to access and make use of all stored charges connected to the electric forge.

Screenshots

No response

Versions and configuration

Additional context

To add to the game report: I'm playing on NixOS unstable, using a local build of the game at cdda-experimental-2022-08-13-2356 with debug symbols included.

ZeroInternalReflection commented 2 years ago

I believe this was fixed by #56991 (or rather, pseudo crafting items were given a new, much higher arbitrary cap, rather than using the default battery of the reference item). I didn't get to crafting pliers in my attached test world, but I set up a situation where crafting of steel lumps would be charge-limited.

BasecampForgeTestWorld.zip

In an experimental version from 2022-08-05, the base camp can only craft 12 steel lumps (960 charges, limited by the 1000 charges of the default battery for an electric forge) In a fresh download today (2022-08-17-1336), the base camp can craft 125 steel lumps (10000 charges, the capacity of the attached medium storage battery)

This limitation will still apply to every appliance/vehicle part not changed by #56991/#60232. I think welding rigs are the next on my to-do list.

Shados commented 2 years ago

@ZeroInternalReflection OK, I'll close this off then. Slightly jank fix, and I feel I should note that one of your statements in "its capacity is large enough for a 50-batch of the most charge-demanding recipe" is invalid, because basecamp crafting can do batch sizes above 50.

ZeroInternalReflection commented 2 years ago

Yeah, I agree that it's not an ideal fix. I also had not considered base camp batch crafting. I might bump the capacity of the pseudo battery higher just on principle. Unfortunately, the only alternative fix I saw was reworking the pocket-handling code to sometimes allow pockets to be filled beyond capacity, and I felt that was basically guaranteed to break things.