Skip to content
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

Rework and sanity-check harvesting of tin #3197

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

chaosvolt
Copy link
Member

@chaosvolt chaosvolt commented Sep 21, 2023

Summary

SUMMARY: Balance "Bring back deconstruction of pewter items, reimplement salvaging tin from cans via electroplating using new larger can sizes"

Purpose of change

Back in the old days, you could simply scrap tin and pewter items to get tin directly, which back when I added bronze made it a bit more convenient.

Eventually, someone had the clever idea to allow extracting tin from tin cans using electrolysis. This is reasonable, while they aren't made wholly of tin it's still common to plate them, and the intended use case was just to get enough tin to make copper pots. Cans are super common so having to stockpile to make up for a low yield seems reasonable enough to me.

Then it went off the rails when someone else changed the recipe to only use pewter and tin items. This of course defeated literally the entire point of the electroplating PR, that being restricted to looting pewter items was a problem.

The followup to this made tin and pewter items more common, but in exchange it obsoleted the ability to easily deconstruct those items on the basis that it "defeats the purpose of the electrolysis tin crafting recipe," when the purpose had already been defeated by the preceding PR by the same contributor.

This aims to fix the problems caused by all this, along with taking advantage of the fact that nowadays we have larger sizes of cans.

Describe the solution

  1. Un-obsoleted the original deconstructs for tin and pewter items, set their yield to be closer to the weights of the items being deconstructed.
  2. Added a new deconstruct for tin cups, evidently that didn't exist back in the day.
  3. Reworked the electrolysis recipes to use all three sizes of tin cans at roughly consistent ratios of weight, with charges updated accordingly. The numbers are fudged a lil bit (rough lookup says tin cans have 1-2% tin in them, this is more like 5% to ~5.7% yield) to get the original yield of 10 charges of tin. On the plus side, the 1:5:10 ratio looks less messy than the ratio listed below in alternatives, and unlike the original version of the recipe precludes getting a 250 gram steel chunk out of a 40-gram small can. Still lower yield than the 25% or so the original recipe would get since it was obtaining 10 tin from a single small can.
  4. Added sulfuric acid as an option for the acid in the tin extraction recipe. Quick lookup indicates sulfuric acid is commonly used, and in-game it's a lot easier to obtain than the generic acid that will probably get axed one of these days now that there's like a half-dozen specific acids already represented.

Describe alternatives you've considered

  1. Changing the electroplating recipe and/or the weight of tin cans so that we can require 1 kg's worth of tin cans to get a completely realismic max of 2% yield. This would require ~3 large cans, ~15 medium cans, or 25 small cans at their current item weights. That'd be annoying but doable.
  2. Obsoleting the electrolysis recipe and just focusing on scraping pewter items because not being able to extract tin from tin cans has long since undermined the original purpose of the recipe anyway.
  3. Making it so you uncraft the tin/pewter dining items into a new pewter scrap item, using that in any recipe where we can justify it not needing to be completely pure tin (namely bronze crafting), and then have the electroplating recipe consume that instead of the tin/pewter items directly.
  4. Adding cutting, metal sawing, or hammering quality to the tin extraction recipe on the basis that you'd need some way to reduce the cans down to scraps that will fit in a glass jar.

Testing

Checked affected files for syntax and lint errors.

Additional context

Related PR links:

  1. Extracting tin from the tinplate of cans, by @Davi-DeGanne: New recipe for tin (from empty tin can) CleverRaven/Cataclysm-DDA#23767
  2. Removal of tin cans from electroplating recipe, by @ampersand55: change tin recipe to use actual tin items CleverRaven/Cataclysm-DDA#33111
  3. Removal of ability to deconstruct tin and pewter items, by @ampersand55: Increase availability of tin and only allow it to be extracted with electrolysis CleverRaven/Cataclysm-DDA#33301

I also plan to do a bit of tweaking to aluminum soon-ish, but when I do, should I go for replacing aluminum ingots with the standard small metal item, or should I just making the ingots a more manageable size (100 ml for example is about right for the archetypal hobbyist muffin tin ingot)?

Worth noting in the above that reducing ingots to 100 ml would make them 270 ml based off their density, and in doing so put things just about right such that we could justify making one with ~20 aluminum cans (13 grams a pop, would be slightly less wonky if adjusted to 14 or 15 grams). That would be a quantity closer to actually worth adding a recipe for aluminum ingots.

On the other hand, converting aluminum to a small metal would mean we could just have it weigh 27 mg per single unit of aluminum, and allow directly scraping aluminum cans into 4-5 units of aluminum without any faffing about with melting it down. Main counterpoints to that are that making muffin pan ingots is a classic metalworking project, and more importantly aluminum powder and aluminum foil make the whole "super low weight stacking aluminum item" category fairly crowded as it is.

@github-actions github-actions bot added the JSON related to game datas in JSON format. label Sep 21, 2023
@scarf005 scarf005 self-assigned this Sep 23, 2023
@scarf005 scarf005 mentioned this pull request Sep 23, 2023
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
image

@scarf005 scarf005 merged commit 7772cab into cataclysmbnteam:upload Sep 23, 2023
@chaosvolt chaosvolt deleted the tinplate-update branch September 23, 2023 03:48
@Davi-DeGanne
Copy link
Contributor

Just wanted to drop in and say thanks for doing this! I was always a little sad that my 2nd-ever PR got a bit butchered (though with understandable intentions) and now I'm feeling vindicated to see it revived. Good improvements on the ratios and overall implementation as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants